Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BLU0-SMTP199A07A52F72BA9CC492C3EFD170@phx.gbl>
Date: Fri, 11 May 2012 21:44:01 +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. 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}) )
> ...


I just tested this. I remembered correctly. Since for --rules and
--single the values are optional (for the john-jumbo versions), they
appear in $valopts without trailing '=', so there was no bug.

I tested your version for the current git version and for the
(non-jumbo) version of fedora 16:
John the Ripper password cracker, version 1.7.8

My version:

$ $ john --incremental=
All     Alnum   Alpha   Digits  LanMan

Your version:

$ john --incremental=
--list=inc-modes  option:           Unknown

I will change this.
I'll redirect stderr to /dev/null.
Then, I'll check $?.
On success, I'll use the output of this command for expansion, otherwise
I'll fall back to my old hard coded list.

For --rules= and --single=, I'll do the same.
Non-jumbo versions don't allow optional parameters for -rules and
single, but there might exist "older" jumbo versions which allow
parameters for --rules and --single, but don't have --list=...

Then, I'll declare list as a local variable.

If all this works, I'll try to make the options depending on a different
config file that might be specified on the command line.
My plan is to use the complete current command line including all
parameters and options, and to replace the current option with --list=...

May be you'll have to wait for this version until Sunday.
When do you plan to release a new jumbo version?
Should bash completion be included in this version?

> My version always lists all external modes. 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.

Compared to all the other stuff which is already implemented or will
soon be implemented, this really is nice to have.
So, this has to wait a little longer.


BTW, why did you name the /etc/bash_completion.d file
john.bash_completion, and not just john (following the common naming
convention)?
Is it just that you think it is more likely a file named john already
exists in /etc/bash_completion.d/, and you don't want to risk
overwriting that file?

Frank

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.