Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 16 May 2012 12:48:12 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Fwd: bash auto-completion for john

On 05/13/2012 12:22 AM, magnum wrote:
> On 05/12/2012 10:37 PM, Frank Dittrich wrote:
>> We should probably decide which behavior is better and unify it for the
>>  expansion of --rules (jumbo only), --single (jumbo only),
>> --incremental, --restore and --status (session names derived from .rec
>> files) .
>> (Of course, I could also allow a user specific configuration of the
>> behavior. But may be this is overkill.)
> 
> Yes it may. OTOH, if you are having fun when implementing it, no harm
> done :)

Now I implemented this.
The value of __john_completion (at the time of completion, not at the
time you source the bash completion script) determines what completion
logic is used.

Currently, this is the default (__john_completion unknown or
__john_completion != "2") completion:

$ . ../src/john.bash_completion
$ ./john --rules
--rules           --rules=nt        --rules=single    --rules=wordlist
$ ./john --incremental
--incremental          --incremental=alnum    --incremental=digits
--incremental=lanman
--incremental=all      --incremental=alpha    --incremental=digits8

To change the completion logic:

$ export __john_completion=2

$ ./john --rules=
nt        single    wordlist
$ ./john --incremental=
all      alnum    alpha    digits   digits8  lanman
$ john --incremental=
All     Alnum   Alpha   Digits  LanMan

Switch back to default completion logic:

$ export __john_completion=1
$ ./john --single
--single           --single=nt        --single=single    --single=wordlist
$ ./john --incremental
--incremental          --incremental=alnum    --incremental=digits
--incremental=lanman
--incremental=all      --incremental=alpha    --incremental=digits8
$ export __john_completion=2
$ ./john --single=
nt        single    wordlist


I also included hard coded completion lists depending on john version
for --incremental= (if --list option doesn't exist).

If completion is based on a hard coded list, you'll see mixed case names:

$ john --external=
AppendLuhn        DateTime          Filter_Alnum      Filter_LanMan
LanMan            Repeats
AtLeast1-Generic  Double            Filter_Alpha      Keyboard
Parallel          Strip
AtLeast1-Simple   DumbForce         Filter_Digits     KnownForce
Policy            Subsets

I think I fixed the problem of listing all files as completion options
for --restore= and --status=, if there were no .rec files in the current
directory.

We do have to decide whether or not I should list existing .chr files as
completion options for --make-charset=.
This can be done on john-users.
I'll wait until this version appears in your git repo, then I'll post to
john-users and ask the users for their opinion.

Frank

View attachment "john.bash_completion" of type "text/plain" (17409 bytes)

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.