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

On 05/11/2012 10:00 AM, magnum wrote:
> On 05/11/2012 02:04 AM, Frank Dittrich wrote:
>>> Now, I look forward to some more bash completion magic from Frank! 
>>
>> May be I'll not be able to work on this tomorrow. We'll see.
>> But it shouldn't be too hard for you to extend the current logic.
> 
> I committed a first version using this.

OK, before I start doing anything, I'll check the latest git.

> I believe there was a bug in
> original line #163 - should there not be a %=* in that?
> 
>                 --rules|--single)
> -                       if echo "${valopts}" | grep "^${cur}$" >
> /dev/null ; then
> +                       if echo "${valopts}" | grep "^${cur%=*}$" >
> /dev/null ; then
> -                               COMPREPLY=( $(compgen -W "${cur}
> ${cur}=NT ${cur}=single ${cur}=wordlist" -- ${cur}) )
> ...

No, I don't think so (But will check this later).
In valopts, the options with optional values --option[=something] are
listed without the =, only the options with mandatory values contain the
=. And options with just one value (--subformat=List) are not at all in
valopt, as well as options without (optional or mandatory) parameters.
("--subformats=LIST" is part of options, so that -su will get completed
to --subformat=LIST after pressing [tab] once.

For test purposes, you can add
echo $valopts
or
echo $valopts|grep single
after --rules|--single)

> My version always lists all external modes. 

I think that's absolutely OK for now.
If --list=ext-modes is not implemented, you should probably keep the old
logic.
(In the unlikely event that it is implemented, but --rules and --single
don't allow optional parameters, just "--rules" or "--single" should be
the possible completion values, so that pressing [tab] adds the trailing
space.

> It will be tricky to decide
> when to only list filters/modes. Or maybe not always? If we do not know,
> we list all. If another cracking mode is already present, we list only
> filters.

I think that's just fine. Identifying other cracking modes already
present on the command line might cause work.
Wordlist mode can be started with -wo:file --wor=file, ... --wordlist=file.
A lot of different ways to specify it.
Even more work if we try to identify --woo=file as an invalid option to
use wordlist mode.

> Anyway, I will not do any more than this.

OK.
Do you have any idea what to do for completing --plugins=?
How do I find out which plugins are available?

> BTW I also committed this:
> 
> $ ../run/john --list=hidden-options
> --list=NAME               list configuration, rules, etc
> --mkpc=N                  force a lower max. keys per crypt

Will implementing the completion confuse users?

> magnum
> 
> 
> 

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.