Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [day] [month] [year] [list]
Date: Fri, 29 Aug 2014 7:43:48 -0400
From:  <jfoug@....net>
To: john-users@...ts.openwall.com
Subject: New JtR Feature:  john.conf parameter overriding

In the latest bleeding john version, I have completed some work 
which was left undone at the time I created the .include logic 
within the john.conf engine.  When we created the ability to 
include files, we created a 'john.local.conf' file also. That file 
was to be used to set local settings so the user would not have to 
edit the john.conf file, which is not really a good thing to do. 
The john.conf file is owned by JtR, and is modified by the JtR 
developers. Thus, if you edit that file, your changes can (and 
likely will) be lost, since that file is replaced when new version 
is pulled or downloaded.

So what we have needed, is the ability to modify the settings 
contained within john.conf. Well within the john.local.conf, we 
have always had the ability to replace a section, simply by putting 
that same section into the john.local.conf file.  But, if you only 
want to change one (or several) parameters within a section, you 
could not do that without replacing the entire section. 

If you put this into john.local.conf

[Options]
idle = N

This 'would' set john to not use idle processing (WARNING, do not 
do that unless you know what you are doing).  What it would do is 
to throw away ALL parameters in the [Options] section from 
john.conf, and the ONLY thing left would be the 'idle' param.

The code I have just checked into the bleeding tree
https://github.com/magnumripper/JohnTheRipper/commit/0aadb4edf2d78601d33e45d6214e991acbbc63f3
now allows single (or multiple) parameters in an existing section 
to be overridden by the user.  This would make sense for things 
like MinLen or MaxLen in the Incremental sections, any of the 
parameters in Options, things like Options:MPI, Options:OpenCL, 
etc, where these really SHOULD be set for your PC, etc.  To make 
this work, simply add a new section into john.local.conf prepending 
Local: to the section name. So to override something within the 
[Options] section, create a section  [Local:Options].  NOTE, you 
can not add any new parameters within a Local: section. You can, 
but they will not be added as parameters to the original section,
since the merging code will not find this new parameter.

Example.  If you wanted to run JtR in NOT idle mode, and always 
wanted dynamic format to try to load raw hashes, then this section 
within john.local.conf will do just that, no matter what the 
settings for these are in john.conf.

[Local:Options]
DynamicAlwaysUseBareHashes = Y
Idle = N

The documentation ./doc/CONFIG explains the Local sections (but not 
much more than in this email).  Also, the configure script has been 
changed.  It will not create a john.local.conf file, putting good 
comments into it, AND putting skeleton Local sections for each 
section found in john.conf, along with a comment for each new empty 
section.  NOTE, this will only work for sections with params. So 
any List. section ( [List.Rules:xxxx], etc) will not be able to be 
modified. In these cases, about all you can do is fully replace the 
section. This is because each param line is not stand alone.  It is 
an order list of 'things'. 

Here is what the skeleton john.local.conf file looks like.

# Within john.local.conf, we can add or fully overwrite any exiting section
# from any of the other .conf file. However if we add a special named
# section that is the same name as some other section, but with Local:
# appenneded, then this special section will allow the params from the
# original section in john.conf, to be modified.  Any param from that
# original section which is placed into this 'Local:' section will be
# updated, without having to edit the john.conf file. The john.conf file
# is a file owned by the JtR project.  It gets updated and edited by the
# JtR development team.  User hand edits to this file are lost when JtR
# updates. So it is recommended that updates to sections in that file are
# not done by editing the john.conf file, but by adding 'Local:' sections
# to this file, overriding parameters. NOTE, that a section starting out
# with 'List.' can not be modified with a 'Local:'. This is because
# there is no way to edit a List.  A List is used for things such as
# Rules, or External scripts.  Those sections can be replaced fully if
# put into this file, but can not be done with a 'Local:'
#
# This file was auto-created by the ./configure script when run. The
# ./configure added Local: sections for all non-list sections from the
# set of *.conf files present at the time ./configure was run. This will
# ONLY be done if this john.local.conf file does NOT exist. Once this
# file exists, it will not be updated again, by JtR code.

# Use this section used to override params in section [Options]
[Local:Options]

# Use this section used to override params in section [Options:MPI]
[Local:Options:MPI]

# Use this section used to override params in section [Options:OpenCL]
[Local:Options:OpenCL]

# Use this section used to override params in section [Markov:Default]
[Local:Markov:Default]

# Use this section used to override params in section [UserClasses]
[Local:UserClasses]

# Use this section used to override params in section [Regen_Salts_UserClasses]
[Local:Regen_Salts_UserClasses]

# Use this section used to override params in section [Incremental:Custom]
[Local:Incremental:Custom]

# Use this section used to override params in section [Incremental:UTF8]
[Local:Incremental:UTF8]

# Use this section used to override params in section [Incremental:Latin1]
[Local:Incremental:Latin1]

# Use this section used to override params in section [Incremental:ASCII]
[Local:Incremental:ASCII]

# Use this section used to override params in section [Incremental:LM_ASCII]
[Local:Incremental:LM_ASCII]

# Use this section used to override params in section [Incremental:LanMan]
[Local:Incremental:LanMan]

# Use this section used to override params in section [Incremental:Alnumspace]
[Local:Incremental:Alnumspace]

# Use this section used to override params in section [Incremental:Alnum]
[Local:Incremental:Alnum]

# Use this section used to override params in section [Incremental:Alpha]
[Local:Incremental:Alpha]

# Use this section used to override params in section [Incremental:LowerNum]
[Local:Incremental:LowerNum]

# Use this section used to override params in section [Incremental:UpperNum]
[Local:Incremental:UpperNum]

# Use this section used to override params in section [Incremental:LowerSpace]
[Local:Incremental:LowerSpace]

# Use this section used to override params in section [Incremental:Lower]
[Local:Incremental:Lower]

# Use this section used to override params in section [Incremental:Upper]
[Local:Incremental:Upper]

# Use this section used to override params in section [Incremental:Digits]
[Local:Incremental:Digits]


Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.