Skip to content

Commit 7b04659

Browse files
committed
Many perl scripts: Print errors and usage to stderr
1 parent aa172d4 commit 7b04659

File tree

5 files changed

+35
-35
lines changed

5 files changed

+35
-35
lines changed

run/cisco2john.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353

5454
sub usage {
5555
my $dn = $0; $dn =~ s/(.*)\/cisco2john.pl/$1/;
56-
print "Usage:\t$0 [cisco config file(s)] >>hashfile 2>>seed.txt\n";
57-
print "\t${dn}/john -format:md5 -wordlist:seed.txt -rules hashfile\n\n";
56+
print STDERR "Usage:\t$0 [cisco config file(s)] >>hashfile 2>>seed.txt\n";
57+
print STDERR "\t${dn}/john -format:md5 -wordlist:seed.txt -rules hashfile\n\n";
5858
exit 1;
5959
}
6060

run/itunes_backup2john.pl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,35 +181,35 @@ sub itunes_plist_get_hash
181181

182182
if (! defined ($WPKY))
183183
{
184-
print "ERROR: WPKY could not be found in '$file_name'\n";
184+
print STDERR "ERROR: WPKY could not be found in '$file_name'\n";
185185

186186
return "";
187187
}
188188

189189
if (! defined ($SALT))
190190
{
191-
print "ERROR: SALT could not be found in '$file_name'\n";
191+
print STDERR "ERROR: SALT could not be found in '$file_name'\n";
192192

193193
return "";
194194
}
195195

196196
if (! defined ($ITER))
197197
{
198-
print "ERROR: ITER could not be found in '$file_name'\n";
198+
print STDERR "ERROR: ITER could not be found in '$file_name'\n";
199199

200200
return "";
201201
}
202202

203203
if (length ($WPKY) != 40)
204204
{
205-
print "ERROR: the WPKY within the file '$file_name' should be exactly 40 bytes long\n";
205+
print STDERR "ERROR: the WPKY within the file '$file_name' should be exactly 40 bytes long\n";
206206

207207
return "";
208208
}
209209

210210
if (length ($SALT) != 20)
211211
{
212-
print "ERROR: the SALT within the file '$file_name' should be exactly 20 bytes long\n";
212+
print STDERR "ERROR: the SALT within the file '$file_name' should be exactly 20 bytes long\n";
213213

214214
return "";
215215
}
@@ -218,14 +218,14 @@ sub itunes_plist_get_hash
218218
{
219219
if (int ($DPIC) < 1)
220220
{
221-
print "ERROR: the DPIC within the file '$file_name' has an invalid value ($DPIC)\n";
221+
print STDERR "ERROR: the DPIC within the file '$file_name' has an invalid value ($DPIC)\n";
222222

223223
return "";
224224
}
225225

226226
if (length ($DPSL) != 20)
227227
{
228-
print "ERROR: the DPSL within the file '$file_name' should be exactly 20 bytes long\n";
228+
print STDERR "ERROR: the DPSL within the file '$file_name' should be exactly 20 bytes long\n";
229229

230230
return "";
231231
}

run/lion2john-alt.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Data::Plist::BinaryReader;
1717

1818
sub usage {
19-
print "Usage: $0 <plist file> ...\n";
19+
print STDERR "Usage: $0 <plist file> ...\n";
2020
exit(1);
2121
}
2222

run/netntlm.pl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@
3737
);
3838

3939
sub showUsage {
40-
print "john-netntlm.pl v$VERSION\n\n";
41-
print "JoMo-Kun <jmk\@foofus.net>\n\n";
42-
print "Usage: $0 [OPTIONS]\n";
43-
print " $0\n";
44-
print " --seed [RainbowCrack/HalfLM Response Password]\n";
45-
print " --file [File Containing LM/NTLM challenge/responses (.lc format)]\n";
46-
print " Ex: Domain\\User:::LM response:NTLM response:challenge";
47-
print "\n";
48-
print " Ex:\n";
49-
print " $0 --file capture.lc\n";
50-
print " $0 --seed \"GERGE!!\"--file capture.lc\n";
51-
print "\n";
40+
print STDERR "john-netntlm.pl v$VERSION\n\n";
41+
print STDERR "JoMo-Kun <jmk\@foofus.net>\n\n";
42+
print STDERR "Usage: $0 [OPTIONS]\n";
43+
print STDERR " $0\n";
44+
print STDERR " --seed [RainbowCrack/HalfLM Response Password]\n";
45+
print STDERR " --file [File Containing LM/NTLM challenge/responses (.lc format)]\n";
46+
print STDERR " Ex: Domain\\User:::LM response:NTLM response:challenge";
47+
print STDERR "\n";
48+
print STDERR " Ex:\n";
49+
print STDERR " $0 --file capture.lc\n";
50+
print STDERR " $0 --seed \"GERGE!!\"--file capture.lc\n";
51+
print STDERR "\n";
5252
exit(1);
5353
}
5454

@@ -70,7 +70,7 @@ sub showUsage {
7070
while(<HAND>) {
7171
next if ( /\d+ password hashes cracked, \d+ left/ );
7272
last if /^$/;
73-
print "\t$_";
73+
print STDERR "\t$_";
7474
push @{ $data{'cracked-lm'} }, $_;
7575
}
7676
close(HAND);
@@ -80,7 +80,7 @@ sub showUsage {
8080
while(<HAND>) {
8181
next if ( /\d+ password hashes cracked, \d+ left/ );
8282
last if /^$/;
83-
print "\t$_";
83+
print STDERR "\t$_";
8484
push @{ $data{'cracked-ntlm'} }, $_;
8585
}
8686
close(HAND);

run/potcheck.pl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@
5151

5252

5353
sub usage {
54-
print "usage: $0 [args]\n";
55-
print "\targs:\n";
56-
print "\t -? | -help Provide this help screen\n";
57-
# print "\t -quiet Less output (multiple -q allowed)\n";
58-
print "\t -verbose More output\n";
59-
print "\t -validate Returns 0 if .pot valid, or 1 if any lines are problems\n";
60-
# print "\t -stoponerror If there is any fatal problem, stop\n";
61-
# print "\t -canonize_fix Apply canonizaton rules to convert formats\n";
62-
# print "\t -encode_fix Fix encoding issues (cannonize to utf8)\n";
63-
print "\t -longline_fix Overlong lines are converted to short .pot format\n";
64-
print "\nThe program is a filter. stdin/stdout are used for input and output\n";
54+
print STDERR "usage: $0 [args]\n";
55+
print STDERR "\targs:\n";
56+
print STDERR "\t -? | -help Provide this help screen\n";
57+
# print STDERR "\t -quiet Less output (multiple -q allowed)\n";
58+
print STDERR "\t -verbose More output\n";
59+
print STDERR "\t -validate Returns 0 if .pot valid, or 1 if any lines are problems\n";
60+
# print STDERR "\t -stoponerror If there is any fatal problem, stop\n";
61+
# print STDERR "\t -canonize_fix Apply canonizaton rules to convert formats\n";
62+
# print STDERR "\t -encode_fix Fix encoding issues (cannonize to utf8)\n";
63+
print STDERR "\t -longline_fix Overlong lines are converted to short .pot format\n";
64+
print STDERR "\nThe program is a filter. stdin/stdout are used for input and output\n";
6565
exit (0);
6666
}
6767

0 commit comments

Comments
 (0)