[GH-ISSUE #2056] Cracked-Password notification mechanism #1378

Closed
opened 2026-10-14 03:46:29 +07:00 by bsakaguchi · 13 comments
Owner

Originally created by @magnumripper on GitHub (Feb 16, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2056

I accepted #2054 from @akos-sereg and made some fixes in 4fb8c31c, then rejected #2055 and before that was fixed Solar rightfully stopped the whole train with http://www.openwall.com/lists/john-dev/2016/02/15/1 and we reverted all of it.

So back to the drawing board. Should we have this feature at all, in any form? If so, how should it work, and how should it be implemented?

I see three priorities:

  1. Security / reliability
  2. Simplicity: Minimize bloat and core impact
  3. Usefulness (eg. flexibility)

They are obviously more or less contradicting.

Originally created by @magnumripper on GitHub (Feb 16, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2056 I accepted #2054 from @akos-sereg and made some fixes in 4fb8c31c, then rejected #2055 and before that was fixed Solar rightfully stopped the whole train with http://www.openwall.com/lists/john-dev/2016/02/15/1 and we reverted all of it. So back to the drawing board. Should we have this feature at all, in any form? If so, how should it work, and how should it be implemented? I see three priorities: 1. Security / reliability 2. Simplicity: Minimize bloat and core impact 3. Usefulness (eg. flexibility) They are obviously more or less contradicting.
bsakaguchi 2026-10-14 03:46:29 +07:00
Author
Owner

@akos-sereg commented on GitHub (Feb 16, 2016):

I think that any kind of notification mechanism would be useful, even if it is just a parameterless script execution

<!-- gh-comment-id:184448903 --> @akos-sereg commented on GitHub (Feb 16, 2016): I think that any kind of notification mechanism would be useful, even if it is just a parameterless script execution
Author
Owner

@jfoug commented on GitHub (Feb 16, 2016):

I have stayed out of this, mostly because I knew what the reaction from Solar was going to be.

How about: tail -f john.log | working script

  1. very reliable.
  2. simplistic (0 core impact ;)
  3. super flexible.

Yes, I know, this is a cop-out to the original OP (which I do think this concept IS useful). But is it really some new bell that needs to be added to the code ?

<!-- gh-comment-id:184450064 --> @jfoug commented on GitHub (Feb 16, 2016): I have stayed out of this, mostly because I knew what the reaction from Solar was going to be. How about: `tail -f john.log | working script` 1. very reliable. 2. simplistic (0 core impact ;) 3. super flexible. Yes, I know, this is a cop-out to the original OP (which I do think this concept IS useful). But is it really some new bell that needs to be added to the code ?
Author
Owner

@magnumripper commented on GitHub (Feb 16, 2016):

I agree about the tail -f. Using perl, parsing is easy as pie. Perhaps we should just declare that's the solution and close this but I'll let others chime in for a while.

<!-- gh-comment-id:184455315 --> @magnumripper commented on GitHub (Feb 16, 2016): I agree about the `tail -f`. Using perl, parsing is easy as pie. Perhaps we should just declare that's the solution and close this but I'll let others chime in for a while.
Author
Owner

@jfoug commented on GitHub (Feb 16, 2016):

If we do declare that is the solution, it may not be a bad idea to generate a simple script as a starting point. Like you said, perl makes it simply. We could write a minimal parser in less than an hour, and place it into ./run. We could also document (comments in the script would be adequate) any settings which may make it work better (always emit passwords, emit user id, etc), so that all the proper info is in the log file.

<!-- gh-comment-id:184458842 --> @jfoug commented on GitHub (Feb 16, 2016): If we do declare that is the solution, it may not be a bad idea to generate a simple script as a starting point. Like you said, perl makes it simply. We could write a minimal parser in less than an hour, and place it into ./run. We could also document (comments in the script would be adequate) any settings which may make it work better (always emit passwords, emit user id, etc), so that all the proper info is in the log file.
Author
Owner

@kholia commented on GitHub (Feb 16, 2016):

Doing system() here is a terrible idea, I strongly prefer Jim's "tail -f" solution.

<!-- gh-comment-id:184603451 --> @kholia commented on GitHub (Feb 16, 2016): Doing system() here is a terrible idea, I strongly prefer Jim's "tail -f" solution.
Author
Owner

@jfoug commented on GitHub (Feb 16, 2016):

There are 3 'key' items in john.conf if we are going to use the log file for this.

  1. no secure mode can be used. If secure, pw does not show up in log file.
  2. LogCrackedPasswords = N must be overridden in john-local.conf.
  3. Save = 60 is default. log flushing is based upon this (as is other things like .rec/.pot file writing).
  4. (optional) StatusShowCandidates = N can make an impact on + Cracked lines.

Note, 2 (frequent save) may be OK for some, but may need to be dropped to 10s or so for other instances. NOTE, if this is set low like this (10s) and you are just starting out on some large list of fast cracks, then jtr will run slow. BUT this type log watching probably should not be done during that phase of the run. It is better to run a while, until cracking slows way down, and then take that data and off-line process found cracks. Then continue JtR with this tail -f log file method.

<!-- gh-comment-id:184701949 --> @jfoug commented on GitHub (Feb 16, 2016): There are 3 'key' items in john.conf if we are going to use the log file for this. 1. no secure mode can be used. If secure, pw does not show up in log file. 2. LogCrackedPasswords = N must be overridden in john-local.conf. 3. Save = 60 is default. log flushing is based upon this (as is other things like .rec/.pot file writing). 4. (optional) StatusShowCandidates = N can make an impact on + Cracked lines. Note, 2 (frequent save) may be OK for some, but may need to be dropped to 10s or so for other instances. NOTE, if this is set low like this (10s) and you are just starting out on some large list of fast cracks, then jtr will run slow. BUT this type log watching probably should not be done during that phase of the run. It is better to run a while, until cracking slows way down, and then take that data and off-line process found cracks. Then continue JtR with this tail -f log file method.
Author
Owner

@magnumripper commented on GitHub (Feb 16, 2016):

NOTE, if this is set low like this (10s) and you are just starting out on some large list of fast cracks, then jtr will run slow.

But nowhere near as slow as doing a system(script.sh) for every cracked password 😆

<!-- gh-comment-id:184860654 --> @magnumripper commented on GitHub (Feb 16, 2016): > NOTE, if this is set low like this (10s) and you are just starting out on some large list of fast cracks, then jtr will run slow. But nowhere near as slow as doing a `system(script.sh)` for every cracked password :laughing:
Author
Owner

@jfoug commented on GitHub (Feb 16, 2016):

Lol, yes, that would REALLY slow to a crawl. I have seen times where there are a 100k (or even 10x that many) cracks in a minute. Spawn that baby! :)

<!-- gh-comment-id:184897970 --> @jfoug commented on GitHub (Feb 16, 2016): Lol, yes, that would REALLY slow to a crawl. I have seen times where there are a 100k (or even 10x that many) cracks in a minute. Spawn that baby! :)
Author
Owner

@magnumripper commented on GitHub (Feb 17, 2016):

no secure mode can be used. If secure, pw does not show up in log file.

Well it can - but it obviously depends on what you are doing. Perhaps your script just updates a web page with patterns, like "top 8% of passwords look like '?u?l?l?l?s?d?d?d?d'" or something like that.

LogCrackedPasswords = N must be overridden in john-local.conf.

No this is optional really, depending on what you're doing. Maybe you only need the user name, or maybe the script actually looks in john.pot as well and does something more elaborate.

<!-- gh-comment-id:184932988 --> @magnumripper commented on GitHub (Feb 17, 2016): > no secure mode can be used. If secure, pw does not show up in log file. Well it can - but it obviously depends on what you are doing. Perhaps your script just updates a web page with patterns, like "top 8% of passwords look like '?u?l?l?l?s?d?d?d?d'" or something like that. > LogCrackedPasswords = N must be overridden in john-local.conf. No this is optional really, depending on what you're doing. Maybe you only need the user name, or maybe the script actually looks in john.pot as well and does something more elaborate.
Author
Owner

@jfoug commented on GitHub (Feb 17, 2016):

Really all that needs to be done, is to document the few 'options' which should be set in the [Local::Options] section of a john-local.conf file (to override what is in john.conf), and then simply to run:

tail -f john.log | grep -- " + Cracked " | ./my_script.sh

after writing my_script.sh

You get lines that look like

0:10:01:14 + Cracked bigjohn: poopypass1
0:10:01:16 + Cracked bigjohn2: poopypass1
0:10:14:26 + Cracked root: boner!ripper852

That should be pretty easy to parse in pretty much any script file, and then do whatever you want with them. Nothing is passed on command line, the script runs outside of john's execution path, and is separated by the tail -f command, and pipes to queue data.

I see little 'wrong' with this solution, and it is damn near as good as a 'spawned' notification execution, with the exception that it has none of the serious problems of spawning a process like that.

<!-- gh-comment-id:184945155 --> @jfoug commented on GitHub (Feb 17, 2016): Really all that needs to be done, is to document the few 'options' which should be set in the [Local::Options] section of a john-local.conf file (to override what is in john.conf), and then simply to run: ``` sh tail -f john.log | grep -- " + Cracked " | ./my_script.sh ``` after writing my_script.sh You get lines that look like ``` 0:10:01:14 + Cracked bigjohn: poopypass1 0:10:01:16 + Cracked bigjohn2: poopypass1 0:10:14:26 + Cracked root: boner!ripper852 ``` That should be pretty easy to parse in pretty much any script file, and then do whatever you want with them. Nothing is passed on command line, the script runs outside of john's execution path, and is separated by the tail -f command, and pipes to queue data. I see little 'wrong' with this solution, and it is damn near as good as a 'spawned' notification execution, with the exception that it has none of the serious problems of spawning a process like that.
Author
Owner

@jfoug commented on GitHub (Feb 17, 2016):

LogCrackedPasswords = N must be overridden in john-local.conf.

No this is optional really, depending on what you're doing. Maybe you only need the user name, or > maybe the script actually looks in john.pot as well and does something more elaborate.

That is very true. I was simply looking at as simplistic of a script as possible, but you are right. The script could do anything. It may simply update a total-num cracked per hour / day / month, or something else, where it does not even 'care' about the pass and or user name. Just knowledge that a new crack happened.

But as to OP, I really think this is a much simpler, solution, AND it does not have the bad side effects you get from blindly spawning at crack time.

<!-- gh-comment-id:184949743 --> @jfoug commented on GitHub (Feb 17, 2016): > > LogCrackedPasswords = N must be overridden in john-local.conf. > > No this is optional really, depending on what you're doing. Maybe you only need the user name, or > maybe the script actually looks in john.pot as well and does something more elaborate. That is very true. I was simply looking at as simplistic of a script as possible, but you are right. The script could do anything. It may simply update a total-num cracked per hour / day / month, or something else, where it does not even 'care' about the pass and or user name. Just knowledge that a new crack happened. But as to OP, I really think this is a much simpler, solution, AND it does not have the bad side effects you get from blindly spawning at crack time.
Author
Owner

@magnumripper commented on GitHub (Feb 17, 2016):

I don't think we even need a sample script. Let's forget all about this.

<!-- gh-comment-id:185051296 --> @magnumripper commented on GitHub (Feb 17, 2016): I don't think we even need a sample script. Let's forget all about this.
Author
Owner

@frank-dittrich commented on GitHub (Feb 17, 2016):

If you want to count passwords cracked per hour, you'd better sort -u the pot file, do avoid counting dupes (cracked by different processes) or even john --show (to handle LM format with the split passwords...

<!-- gh-comment-id:185056664 --> @frank-dittrich commented on GitHub (Feb 17, 2016): If you want to count passwords cracked per hour, you'd better sort -u the pot file, do avoid counting dupes (cracked by different processes) or even john --show (to handle LM format with the split passwords...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1378
No description provided.