Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100308191842.GA14650@openwall.com>
Date: Mon, 8 Mar 2010 22:18:42 +0300
From: Solar Designer <solar@...nwall.com>
To: john-users@...ts.openwall.com
Subject: Re: generate passwords with wDDDwDDD template

On Mon, Mar 08, 2010 at 04:00:07AM -0500, Matt Weir wrote:
> >> I would like to generate a passwords list 
> >> with wDDDwDDD template, where 'w' is a 
> >> [a-Z] and 'D' is a [0-9]. 
> 
> You can do this using the preprocessor in JtR's rules file. I had written a
> sample config showing how to compose similar targeted brute force rules a
> while ago and I figure this is as good a time as any to re-upload it to the
> web. It's labeled john_bruteforce.conf and you can download it here:
> 
> http://sites.google.com/site/reusablesec/Home/john-the-ripper-files/john-the-ripper-sample-configs-1

This works, but it's a bit inefficient.  The rules preprocessor was not
meant to be performance-critical, so it was not coded as such.  Also,
all of the rules are generated and validated at startup (then they're
generated again as JtR is running), which may causes JtR to "freeze" for
a while at startup with a ruleset like that.

That said, I'd appreciate it if you clean up the ruleset a little bit
(perhaps replace your weird uses of "Ct" with simple "c", make use of
the "A" command), then upload to the wiki.  The relevant pages could be:

http://openwall.info/wiki/john/usage-examples
http://openwall.info/wiki/john/tutorials

I think you may turn this into a tutorial (write it as a new wiki page
under the tutorials DokuWiki namespace) and include the replacement
[List.Rules:Wordlist] section within <code> ... </code> in the wiki page
source (or upload it as a separate file if it's too large to be included
on the page - but I don't think it will be).

> Note, it assumes your run JtR in wordlist mode with an input dictionary
> consisting of the 26 lower characters in the alphabet, one per line. Aka
> 
> a
> b
> c
> d
> ...
> z

This is a nice way to reduce the overhead of the non-optimized rules
preprocessor.  That way, it is invoked 26 times less frequently.  This
also makes the startup delay I mentioned above 26 times shorter.

The alternative would have been to include just an empty line in the
wordlist file, and to prefix all of your ruleset lines with "$[a-z]".

> While I don't have your rule in the sample config, it would probably look
> like
> 
> :$[0-9]$[0-9]$[0-9]$[a-z]$[0-9]$[0-9]$[0-9]
> 
> I haven't tested it myself so there may be a typo.

It works.  The startup delay is noticeable, but not prohibitive (it's a
few seconds to generate and validate the 26 million rules).

The leading colon (no-op) is not needed.  Also, you could use the "A"
command to potentially speed this up:

Az"[0-9][0-9][0-9][a-z][0-9][0-9][0-9]"

I think Gogol wanted to include uppercase letters as well.  If so, this
can be achieved with:

Az"[0-9][0-9][0-9][a-zA-Z][0-9][0-9][0-9]"

and indeed the "wordlist" would need to be expanded from 26 to 52 lines.
This change would also double the startup delay (still acceptable).

> >> I also wish to know how to generate the full 
> >> list of words where each word is 8 symbols in length and word contains 
> >> at least one digit or word.
> 
> I think I understand you. Aka you are trying to construct a bruteforce rule
> to target passwords that were created under a password creation policy that
> mandated passwords must be eight characters long and contain at least one
> letter and one digit.

This topic was discussed in here before:

http://openwall.info/wiki/john/mailing-list-excerpts

Making "incremental" mode follow a password policy by an external filter() (2009/10/28)
    * ...with specific external filter() examples (2009/10/28)
    * ...also for another policy (2009/02/10)

http://www.openwall.com/lists/john-users/2009/10/28/10
http://www.openwall.com/lists/john-users/2009/10/28/11
http://www.openwall.com/lists/john-users/2009/02/10/3

Thanks,

Alexander

Powered by blists - more mailing lists

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