>From 42468a31795bd3719e55cd4f289931d7a00b59ab Mon Sep 17 00:00:00 2001 From: Frank Dittrich Date: Wed, 27 Jun 2012 12:49:19 +0200 Subject: [PATCH] Important fixes (detecting dynamic formats) and others 1. Since --subformats=LIST became a hidden option, dynamic formats where not tested anymore. 2. Use long option names with = as separator whereever possible, to avoid naming conflicts with future options that might be added to john 3. Minor grammer change for screen output of supported formats --- jtrts.dat | 20 ++++++++++---------- jtrts.pl | 33 ++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/jtrts.dat b/jtrts.dat index 2be66e5..c54487c 100644 --- a/jtrts.dat +++ b/jtrts.dat @@ -50,10 +50,10 @@ # (dynamic)(base),(X),(jumbo),10000,dynamic_29-raw,pw,rawmd5u_raw_tst.in,dynamic_29,Y,X,(1500),(1500) (dynamic)(base),(X),(jumbo),10000,dynamic_29,pw,rawmd5u_tst.in,dynamic_29,Y,X,(1500),(1500) -(dynamic)(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,dynamic_29-raw-utf8,pw,rawmd5u_raw_tst.in,dynamic_29,Y,-enc:utf-8,(1229),(1229) -(dynamic)(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,dynamic_29-raw-utf8,pw-utf8,rawmd5u_raw_tst_utf8.in,dynamic_29,Y,-enc:utf-8,(1500),(1500) -(dynamic)(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,dynamic_29-utf8,pw,rawmd5u_tst.in,dynamic_29,Y,-enc:utf-8,(1229),(1229) -(dynamic)(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,dynamic_29-utf8,pw-utf8,rawmd5u_tst_utf8.in,dynamic_29,Y,-enc:utf-8,(1500),(1500) +(dynamic)(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,dynamic_29-raw-utf8,pw,rawmd5u_raw_tst.in,dynamic_29,Y,--encoding=utf-8,(1229),(1229) +(dynamic)(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,dynamic_29-raw-utf8,pw-utf8,rawmd5u_raw_tst_utf8.in,dynamic_29,Y,--encoding=utf-8,(1500),(1500) +(dynamic)(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,dynamic_29-utf8,pw,rawmd5u_tst.in,dynamic_29,Y,--encoding=utf-8,(1229),(1229) +(dynamic)(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,dynamic_29-utf8,pw-utf8,rawmd5u_tst_utf8.in,dynamic_29,Y,--encoding=utf-8,(1500),(1500) # (dynamic)(base),(X),(jumbo),10000,dynamic_30,pw,dynamic_30_tst.in,dynamic_30,N,X,(1500),(1500) (dynamic)(base),(X),(jumbo),10000,dynamic_31,pw,dynamic_31_tst.in,dynamic_31,N,X,(1500),(1500) @@ -65,10 +65,10 @@ # (base),(X),(jumbo),10000,raw-md5u-raw,pw,rawmd5u_raw_tst.in,raw-md5u,Y,X,(1500),(1500) (base),(X),(jumbo),10000,raw-md5u,pw,rawmd5u_tst.in,raw-md5u,Y,X,(1500),(1500) -(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-raw-utf8,pw,rawmd5u_raw_tst.in,raw-md5u,Y,-enc:utf-8,(1229),(1229) -(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-raw-utf8,pw-utf8,rawmd5u_raw_tst_utf8.in,raw-md5u,Y,-enc:utf-8,(1500),(1500) -(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-utf8,pw,rawmd5u_tst.in,raw-md5u,Y,-enc:utf-8,(1229),(1229) -(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-utf8,pw-utf8,rawmd5u_tst_utf8.in,raw-md5u,Y,-enc:utf-8,(1500),(1500) +(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-raw-utf8,pw,rawmd5u_raw_tst.in,raw-md5u,Y,--encoding=utf-8,(1229),(1229) +(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-raw-utf8,pw-utf8,rawmd5u_raw_tst_utf8.in,raw-md5u,Y,--encoding=utf-8,(1500),(1500) +(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-utf8,pw,rawmd5u_tst.in,raw-md5u,Y,--encoding=utf-8,(1229),(1229) +(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-utf8,pw-utf8,rawmd5u_tst_utf8.in,raw-md5u,Y,--encoding=utf-8,(1500),(1500) # ,(full),(core),200,md5,pw,md5_1_tst.in,md5,N,X,(1500),(1500) ,(full),(core),200,md5_apr1,pw,md5_apr1_tst.in,md5,N,X,(1500),(1500) @@ -90,7 +90,7 @@ (base),(X),(jumbo),10000,raw-md5thk-dyno0,pw,dynamic_0_raw_tst.in,raw-md5thick,Y,X,(1500),(1500) (base),(X),(jumbo),10000,raw-md5u,pw,rawmd5u_tst.in,raw-md5u,Y,X,(1500),(1500) (base),(X),(jumbo),10000,raw-md5u-raw,pw,rawmd5u_raw_tst.in,raw-md5u,Y,X,(1500),(1500) -(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-utf8,pw-utf8,rawmd5u_tst_utf8.in,raw-md5u,Y,-enc:utf-8,(1500),(1500) +(utf8)(utf-8)(enc),(X),(jumbo)&(encode_valid),10000,raw-md5u-utf8,pw-utf8,rawmd5u_tst_utf8.in,raw-md5u,Y,--encoding=utf-8,(1500),(1500) (base),(X),(jumbo),10000,raw-sha1,pw,rawsha1_tst.in,raw-sha1,Y,X,(1500),(1500) (raw-sha1),(X),(jumbo),10000,rawsha1-ng,pw,rawsha1_tst.in,raw-sha1-ng,Y,X,(1430),(1430) (sha1-gens)(base),(X),(jumbo),10000,sha1-gens,pw,sha1s_tst.in,sha1-gen,Y,X,(1500),(1500) @@ -309,7 +309,7 @@ # This is a very slow, and VERY large input file hash. (ssh),(full),(jumbo),1600,ssh,pass,ssh_1500_tst.in,ssh,N,X,(1500),(1500) # -# these use -inc:all and -inc:alnum and NOT a password dict. +# these use --incremental=all and --incremental=alnum and NOT a password dict. # # These are 'quick' to run, so will be run under 'normal' testing. WARNING, since these do NOT use # a dictionary, then they CAN 'lock up' the test suite run, IF the increment files are changed. We may want diff --git a/jtrts.pl b/jtrts.pl index 0bbdf1c..7590145 100755 --- a/jtrts.pl +++ b/jtrts.pl @@ -130,7 +130,7 @@ sub johnPrelims { } sub johnTest0_one { if (length($_[0]) < 2 || stringInArray($_[0], @types) || stringInArray("enc", @types) || stringInArray("full", @types)) { - if (length($_[0]) >= 2) { $_[0] = "-enc:$_[0]"; } + if (length($_[0]) >= 2) { $_[0] = "--encoding=$_[0]"; } ScreenOutSemi("testing: john -test=0 $_[0]\n"); my $sCmd = "$JOHN_EXE -test=0 $_[0]"; foreach my $s (@passthru) { $sCmd = $sCmd . " " . $s . " "; } @@ -186,7 +186,8 @@ sub showTypeData { } ############################################################################### # Setup the program to run. Parses through params, strtok's the ./john screen -# output, and also possilby ./john -sub:LIST and ./john -enc:LIST to find +# output, and also possilby ./john --subformat=LIST (deprecated) or +# ./john --list=subformats and ./john --encoding=LIST to find # internal 'variable' data built into jumbo, which can be added to, or removed # over time, and between builds. ############################################################################### @@ -215,9 +216,9 @@ sub setup { # now use the john error screen to determine if this is a jumbo john, or # a core john. Then use this data to figure out what formats ARE and are NOT # able to be run by this build (so we can later skip formats NOT built in - # this build. Also check for how to do -utf8 or -enc:utf8 (different syntax + # this build. Also check for how to do -utf8 or --encoding=utf8 (different syntax # in different builds of john. Also certain extra options like -nolog may - # be 'possible'. We simply parse that screen (and also a john -sub:list to + # be 'possible'. We simply parse that screen (and also a john --subformat=LIST to # get a list of dynamics, if we are in a jumbo), so we know HOW to proceed. ScreenOutVV("John 'usage' data is:\n"); @@ -257,7 +258,7 @@ sub setup { push(@caps, "local_pot_valid"); ScreenOutV("--pot=NAME option is valid\n"); } - # can we use -enc:utf8, -enc:koi8r, etc. + # can we use --encoding=utf8, --encoding=koi8r, etc. if (grepUsage("--encoding=NAME")) { push(@caps, "encode_valid"); ScreenOutV("--encoding=NAME option is valid\n"); @@ -339,8 +340,13 @@ sub loadAllValidFormatTypeStrings { $fmt_str = substr($fmt_str, 0, -1); # Ok, now if we have 'dynamic's, LOAD them - if (grepUsage("--subformat=LIST")) { - system ("$JOHN_EXE --subformat=LIST >JohnDynaUsage.Scr 2>&1"); + if (grepUsage("--list=WHAT") || grepUsage("--subformat=LIST")) { + if (grepUsage("--list=WHAT")) { + system ("$JOHN_EXE --subformat=LIST >JohnDynaUsage.Scr 2>&1"); + } + else { + system ("$JOHN_EXE --list=subformats >JohnDynaUsage.Scr 2>&1"); + } open(FILE, "; close(FILE); @@ -360,14 +366,14 @@ sub loadAllValidFormatTypeStrings { push(@caps, "inc"); if ($verbosity > 3) { my $cnt = @validFormats; - ScreenOutVV("There are $cnt formats this john build can handle are:\n"); + ScreenOutVV("There are $cnt formats this john build can handle. These are:\n"); foreach my $line(@validFormats) { ScreenOutVV($line . ","); } ScreenOutVV("\n"); } } sub loadAllValidEncodings { ScreenOutV("--encoding=LIST is valid, so we get valid encodings from there\n"); - system ("$JOHN_EXE --enc:LIST >JohnEncUsage.Scr 2>&1"); + system ("$JOHN_EXE ---encoding=LIST >JohnEncUsage.Scr 2>&1"); open(FILE, "; close(FILE); @@ -519,9 +525,9 @@ sub process { LINE: foreach my $line(@tstdata) { my @ar = split(',', $line); if (substr($ar[5],0,10) eq "INCREMENT_") { - $dict_name = "-inc:" . substr($ar[5],10); + $dict_name = "--incremental=" . substr($ar[5],10); } else { - $dict_name = "-w:$ar[5].dic"; + $dict_name = "--wordlist=$ar[5].dic"; } my $cmd = "$cmd_head $ar[6]"; unless (-e $ar[6]) { next LINE; } @@ -530,7 +536,7 @@ sub process { open (FILE, "<".substr($dict_name,3)); my @lines = ; close(FILE); - $dict_name = "-w:$ar[5]-$ar[3].dic"; + $dict_name = "--wordlist=$ar[5]-$ar[3].dic"; $dict_name_ex = substr($dict_name,3); open (FILE, ">".substr($dict_name,3)); my $i; @@ -595,10 +601,11 @@ sub process { my $cmd2 = sprintf("cut -f 2- -d\"%c\" < $pot | $UNIQUE pw3 > /dev/null", 31); system($cmd2); } else { + # FIXME: shouldn't we be even more paranoid, and use cut -f 2- -d: -s my $cmd2 = sprintf("cut -f 2- -d: < $pot | $UNIQUE pw3 > /dev/null"); system($cmd2); } - $cmd =~ s/$dict_name/-w:pw3/; + $cmd =~ s/$dict_name/--wordlist=pw3/; ScreenOutVV("Execute john (.pot check): $cmd\n"); unlink ($pot); -- 1.7.7.6