Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <BLU0-SMTP9836A91D758A921F9D461BFD100@phx.gbl>
Date: Tue, 8 May 2012 02:27:59 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Fwd: bash auto-completion for john

Hi all,

this started on john-users (that's why the last john-users mail on this
topic is appended full-quoted), meanwhile it might be more on topic in
john.dev.

The Q&D solution to support bash completion for
--wordlist=filename_starting_with_a_tilde
was to add a line to ~/.bashrc:
complete -F _filedir_xspec john

Proper bash completion support for john needs much more effort.


But here is a first humble attempt to support expansion of option names
and expansion of file names for options --wordlist=, --config=, --pot=,
and --make-charset= (the last option probably should be ignored, to make
accidentally overwriting files harder).

If the current word doesn't start with -, filename expansion is used.


This is still more or less a q&d proof of concept.
Current limitations, TODOs and FIXMEs are mentioned in the attached code.
I have put this file into /etc/bash_completion.d, and for me it is a
useful addition, even with its currently limited functionality.

Feel free to do with the attached file whatever you want.

If you do have suggestions what to change, priority of most urgently
needed improvements, or whatever, please let me know.
(Though this is not a promise that I'll implement all suggested changes.
Everybody else is also welcome to change the script as needed.)

Should I have posted the script and continued the discussion on
john-users instead?

Frank

-------- Original Message --------
Subject: Re: [john-users] bash auto-completion for john (Was: file name
expansion for --wordlist= and file name starting with ~)
Date: Mon, 07 May 2012 19:54:37 +0200
From: magnum <john.magnum@...hmail.com>
Reply-To: john-users@...ts.openwall.com
To: john-users@...ts.openwall.com

On 05/07/2012 11:31 AM, Frank Dittrich wrote:
> Should I dig into bash auto-completion even more, to support expanding
> --wo to --wordlist= and so on?

This has been on the wiki wishlist for quite some time. But doing it
"properly" is not a one beer job.

> What other john-specific auto-completion would be useful?
> (Doing this correctly for all possible cases will probably be hard.
> Jumbo supports an extended set of options. Different shells might have
> different auto-completion mechanisms. Some distributions might already
> provide auto-completion logic for john.)

An excellent example of advanced autocompletion is git. If I write "git
checkout j" and hit tab twice, it will list branches starting with j.
Behind the scenes, it actually queried the repos in real time (and
probably caches results too).

So an ideal implementation for john IMO would be, for example, --rules=
auto-completing with a list of your currently available rules. And
--external= would auto-complete with a list of currently available
external modes/filters. From your own very john.conf, and including
sub-conf-files sourced with the .include directive... this could start
out much simpler than this but the possibilities are endless!

magnum




View attachment "john" of type "text/plain" (6222 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.