Professional Documents
Culture Documents
--regen-lost-salts=type:hash_sz:mask
This option will allow certain types (with short salts), to be found, when
they are present in a set of raw hashes, but where we have lost the salt value.
Normally, without the salt, JtR would not be able to do anything with the hash,
and could not find the password. In this mode, JtR will load the hashes, giving
each a 'fake' salt (but all get the same salt). JtR then builds all of the
possible salt values for this format, and associates every hash with each one
of these salts. So, JtR will now run, and find passwords using all possible
salts for each of the hashes, thus recreating the salt (and finding the passwords).
This function has recently been re-written. The prior way of usage is still
supported
(limited), and should be considered depricated. See the end of this document for
the *** NOTE section.
Usage:
--regen-lost-salts=dynamic_9:32:?d?d?d- --format=dynamic_9
Note, regen has been updated to work with dynamic generic expression compiler also.
Usage for same media-wiki as above is:
--regen-lost-salts='@dynamic=md5($s.md5($p))@:32:?d?d?d-'
--format='dynamic=md5($s.md5($p))'
The above command will run on a set of 32 byte 'raw' hashes, but which are known
to contain media-wiki hashes. Media-wiki is of the format md5(salt.-.md5(pass))
the salt is a decimal number (it actually was the user id of the wiki user). There
is a dash separating the salt and the md5(pass) part. What this regen-lost-salts
line does, is checks all 3 digit salts (appending the '-' char also), and uses
the dynamic format 9 (which is md5($s.md5($p)) that is 'almost' correct. By our
adding the '-' character to the salt as a constant, dynamic_9 works just fine.
With this information in hand, we can look back at that original example given:
--regen-lost-salts=dynamic_9:32:?d?d?d- --format=dynamic_9
We can optimize this, with a little insite (speeding things up 10% in the process).
Knowing that mediawiki assigns the user account number as the salt, we know that we
will never have these salts 000- to 099- So we can redo this regen in this
manner.
[Regen_Salts_UserClasses]
1 = [1-9]
--regen-lost-salts=dynamic_9:32:?1?d?d- --format=dynamic_9
This will use the user class-1 for the first byte, then digits for the other 2.
This means our salt will start from 100- and go to 999- which skips 10% of the
salts, and speeds things up by 10%. This is due to the user-class-1 not having
the '0' byte in it.
At this time, only a fixed length salt is handled. Doing a variable sized salt
regen, simply adds too much complexity, and does slow things down, just a touch.
This is different than the older --regen-lost-salts=3 This 'used to do 0- to 9-
then 00- to 99- then 000- to 999- The 'depricated' --regen-lost-salts=3 now only
does 000- to 999- and would require running 2 more regen-salt runs to cover the
entire salt range.
******************************************************************************
*** NOTE, depricated method (still works, but should not be used)
There are only a few types supported. To properly run, you MUST use one of the
proper types in the -format=type command, AND use the -regen-lost-salts=N with
N being set properly. The valid N's are:
--regen-lost-salts=1 --format=PHPS (form md5($p.$s) s is 3 bytes)
--regen-lost-salts=2 --format=OSC (form md5($s.$p) s is 2 bytes)
--regen-lost-salts=3 --format=mediawiki (user id's from 0 to 999)
--regen-lost-salts=4 --format=mediawiki (user id's from 1000 to 9999)
--regen-lost-salts=5 --format=mediawiki (user id's from 10000 to 99999)
For types 3, 4, 5, we only look for numeric user id's, of the type:
md5($u.'-'.md5($p)) Mediawiki made some changes to use longer 8 byte hex strings
as salts. This salt is too long to try to find, so JtR only focuses on the older
type $B$ with the shorter numeric user id's. The found lines in john.pot will
be output as type $dynamic_2$ for the found PHPS (with the salts filled in). It
will be $dynamic_4$ for the OSC (with salt), and $dynamic_9$ (with user id as
salt), for the mediawiki items.
NOTE, normally the salt is preserved with the hash, and thus JtR can properly
find them using 'normal' methods. This new functionality was added to handle
leaked hashes where the original salt has been lost. It is VERY slow to run
in this manner, due to JtR having to check every possible salt, but it does
allow these hashes to be cracked 'properly'.