File: securenotes2hashcat.pl

package info (click to toggle)
hashcat 6.2.6%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 63,932 kB
  • sloc: lisp: 584,043; ansic: 372,246; perl: 24,890; cpp: 23,731; sh: 3,927; python: 868; makefile: 777
file content (35 lines) | stat: -rwxr-xr-x 802 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl

##
## Author......: See docs/credits.txt
## License.....: MIT
##

use strict;
use warnings;
use DBI;
use DBD::SQLite;

die "usage: $0 NoteStore.sqlite\n" unless (scalar @ARGV == 1);

my $database = shift @ARGV;
my $dsn      = "DBI:SQLite:dbname=$database";
my $userid   = "";
my $password = "";

my $dbh = DBI->connect ($dsn, $userid, $password, { RaiseError => 1 }) or die $DBI::errstr;

my $sth = $dbh->prepare ("SELECT Z_PK,ZCRYPTOITERATIONCOUNT,ZCRYPTOSALT,ZCRYPTOWRAPPEDKEY FROM ZICCLOUDSYNCINGOBJECT WHERE ZISPASSWORDPROTECTED=1");

$sth->execute () or die $DBI::errstr;

while (my $row = $sth->fetchrow_arrayref ())
{
  printf ("\$ASN\$*%d*%d*%s*%s\n", $row->[0], $row->[1], unpack ("H*", $row->[2]), unpack ("H*", $row->[3]));
}

$sth->finish;

$dbh->disconnect ();

exit (0);