mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1716] Add bash completion for dynamic compiler formats #1131
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1131
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @magnumripper on GitHub (Aug 28, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1716
Originally assigned to: @frank-dittrich on GitHub.
This is half a joke and half serious. If we brainstorm a little, maybe we find out it's actually possible.
It would be very cool to
and get
and so on
As always with bash completion, it's not so much about saving a keypress. It's about listing the alternatives in a super convenient way.
I'm a bit worried the (mandatory) single-quote makes it harder though. Not that I have any other source for my worries than gut feeling.
@frank-dittrich commented on GitHub (Aug 28, 2015):
If I get a
It should be easy. I should list
'md5( 'sha1( ...because that's what you really would insert.Not so easy will be the part where you are in the middle of an expression (
$p,$s, tons of other stuff).Another --list=?
And, depending on how many opening parentheses you have, I can also add
) )) )))to the list of possible completions.Next time you'll ask for completion in --mask mode for completing
?.@magnumripper commented on GitHub (Aug 30, 2015):
We can list them like this:
For bash-completion I guess you can omit everything after the sort. Note that I'm filtering out cisco because it's a false result when doing this.
@jfoug commented on GitHub (Aug 30, 2015):
Not fully valid:
cisco, peoplesoft show up as subformats.
@magnumripper commented on GitHub (Aug 30, 2015):
I beat you to it ;-) Command was edited and a commit changed the PeopleSoft thingy.
@jfoug commented on GitHub (Aug 30, 2015):
Ok, pplsoft is gone, but cisco still shows.
@magnumripper commented on GitHub (Aug 30, 2015):
@jfoug ideally PIX should list (in subformats) as "md5($p) (Cisco PIX)" or something like that, and similar for ASA. Much like I did to PeopleSoft. Are they truncated? What would a compiler formula look like?
@magnumripper commented on GitHub (Aug 30, 2015):
@jfoug I'm changing dynamic_preloads.c to this for now:
@magnumripper commented on GitHub (Aug 30, 2015):
The
grep -v ciscois no longer needed after8564945@jfoug commented on GitHub (Aug 30, 2015):
will this need adjustments in relbench?
@frank-dittrich commented on GitHub (Aug 30, 2015):
No, it won't. And benchmark-unify neither.
relbench is ignoring anything within
[and].@frank-dittrich commented on GitHub (Jan 15, 2016):
I now have a patch which does the following:
completes to
as before this patch (provided dynamic is a valid format).
Prior to this patch,
would get completed to
So, for john versions which have dynamic, but don't support dynamic=, this is a regression.
completes to
completes to
And finally, as with older bash completion
Is that good enough?
@frank-dittrich commented on GitHub (Jan 15, 2016):
For older john versions which don't have
--list=subformatsbut which have--subformat=LIST, I could suppress 'dynamic=' and complete 'dynamic' to 'dynamic_', but I doubt it is worth the effort.(Nobody should run such an old jombo version.)
@frank-dittrich commented on GitHub (Jan 15, 2016):
May be it would be better to use
and
This could be a little bit harder.
And may be users prefer to escape
$petc. in a different way...(Time for another john bash completion environment variable in addition to
__john_completion?)Even if I change the "default" completion to
dynamic=', I could still support completingto
and also still support
in addition to
But I'll definitely not support completing any of these:
@magnumripper commented on GitHub (Jan 16, 2016):
What is listed after
$ ./john --format=dynamic='sha1([tab][tab]?@frank-dittrich commented on GitHub (Jan 16, 2016):
@frank-dittrich commented on GitHub (Jan 16, 2016):
I just found a bug.
does not complete to
sha1_64(, even[tab][tab]will not list any completions.Similarly
does not append
(.Will look into that.
@frank-dittrich commented on GitHub (Jan 16, 2016):
Fixed now, but that's not good enough.
I'll have to escape the
(and)(and the$) like this:@frank-dittrich commented on GitHub (Jan 16, 2016):
This is tricky.
Now I have
completing to
But
And when I try
bash just removes the final
\, andcompletes to
OTOH, escaping every special character with `' might allow us to suggest completions for variables like $p, $s, $c1 etc.
I might even suggest completions like
,debugafter the final closing).(Might be better with some --list=hidden-option support, for variables like $s, 4p, ... as well as for functions like lc(), uc(), ...=
@frank-dittrich commented on GitHub (Jan 16, 2016):
Suggesting
,\$c1as a completion for./john -test --format=dynamic=md5\(\$p.\$c1)might require some effort.@magnumripper commented on GitHub (Jan 16, 2016):
Do you list functions like unicode(), lc() and uc() for possible inclusion after a left paren? Not sure we list them anywhere, maybe we should - so completion can learn and adapt. Edit: you mentioned that.
@frank-dittrich commented on GitHub (Jan 16, 2016):
So far I don't support any completion after the opening parenthesis.
Before we implement a new --list= command for that, I need to figure out how to solve this in general, with
unicode\( lc\( uc\(added to the list of possible functions.If that works, I also need to consider
MD5\(instead ofmd5\(etc.@frank-dittrich commented on GitHub (Jan 16, 2016):
@magnum if you want to test what I've got so far, see the commit
github.com/frank-dittrich/JohnTheRipper@0ebcc1e184to my git repo.I don't know when I'll have time to continue this work, but I know that supporting additional functionality will get a lot harder.
I even failed at suggesting completions for
--format=dynamic=gost\(.The same completions as for
--format=dynamic=should be suggested in a first step.Adding
unicode\( lc\( uc\(to that list is a second step.Adding variable names is a third step.
The next step will be supporting completions containing at least one opening parenthesis, but not ending with a parenthesis.
Then may be add support for completion after the final closing parenthesis:
,debugorc1=etc,Then we can think about implementing another --list= addition, to replace the hard coded lists with something automatically generated from dyna.
@magnumripper commented on GitHub (Jan 16, 2016):
Tried it out a little. It's good help already. Maybe we shouldn't bother too much with things that are very hard to accomplish.
@jfoug is there a way to "get" a list of primitives (including lc, uc and so on) from dynamic, for eg.
--list=dynamic-functions, or would it need to be hard-coded?@frank-dittrich commented on GitHub (Jan 16, 2016):
@jfoug I wouldn't bother with such a list yet.
Once I have an idea how to solve the other bash completion issues, there's still enough time to implement various
--list=dynamic-whateverlists.@jfoug commented on GitHub (Jan 18, 2016):
Please do not hard code too much. I would much rather supply --list function somehow. That way when primitives are added, you would not have to make changes in this.
@frank-dittrich commented on GitHub (Jan 18, 2016):
Of course, I would use a hard coded list only as long as I am trying to figure out how to implement tab completion inside a quoted string or after the first
(. Currently, I can't get that working at all.That's why implementing new --list= functionality isn't needed right now, since there is no user of such a functionality.