Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Console Log #8

Open
mathsoft-dev opened this issue May 13, 2015 · 11 comments
Open

Updating Console Log #8

mathsoft-dev opened this issue May 13, 2015 · 11 comments
Assignees
Labels
Milestone

Comments

@mathsoft-dev
Copy link
Collaborator

  1. Johnny seems to update only console log when attack ends. For example, sometimes I get the 4 hashes loaded message only when I pause attack.
  2. Maybe status button could be interesting, or automatic status(but we still have the problem we can't use stdin to send an input) every X minute.

On the same note, I've seen a TODO
void MainWindow::readJohnShow()
{
// TODO: Read John's output while it runs. Do not wait before it
// finishes.

@AlekseyCherepanov
Copy link
Member

On Wed, May 13, 2015 at 12:41:08PM -0700, math07 wrote:

  1. Johnny seems to update only console log when attack ends. For example, sometimes I get the 4 hashes loaded message only when I pause attack.

It may be due to output buffering. (John prints but we don't get it
till it is flushed on the end of work.)

  1. Maybe status button could be interesting, or automatic status(sigup) every X minute.

You may try the following option
--progress-every=N emit a status line every N seconds
--crack-status emit a status line whenever a password is cracked

It may help partly: older output will be just pushed out by newer
output more often but with lag too (so the last status line won't be
seen at the moment it is printed).

On the same note, I've seen a TODO
void MainWindow::readJohnShow()
{
// TODO: Read John's output while it runs. Do not wait before it
// finishes.

The function above reads the output of john --show that is expected
to finish rather quickly (immediately). The continuous reading would
be good when the output is very big to process it not storing memory
fully.

Thanks!

Regards,
Aleksey Cherepanov

@shinnok
Copy link
Member

shinnok commented May 14, 2015

There's several things to be done here:

  1. Subclass m_showJohnProcess from JohnProcess too.
    2j. Add --progress-every settings option, enable by default with sensible default. This will override how we update the status bar.
    3j. Always pass --crack-status. This will override the current m_showTimer.
  2. Verify if JtR flushes output stdout when writing status&progress lines(both flush() and '\n' should properly flush a std buffer).
  3. If 4. is not confirmed, ask john-dev if we can get an unbuffered option to JtR(man setbuf(stdout, NULL)). Maybe no-tty option could be unbuffered on stdout by default?

@mathsoft-dev
Copy link
Collaborator Author

Do you guys mind if "--progress-every=N and --crack-status" isn't available in john-core, it's only available in jumbo ?

@shinnok
Copy link
Member

shinnok commented May 25, 2015

@Math07 I don't see how it could be different.

@mathsoft-dev
Copy link
Collaborator Author

Shinnok said:
2j. Add --progress-every settings option, enable by default with sensible default. This will override how we update the status bar.
3j. Always pass --crack-status. This will override the current m_showTimer.

What I meant is : do you think it's a great idea to have two differents logics in the code to update the progress bar and the status(timer) one specific to john-core and another code specific to jumbo ? Also, given the fact that the bug would still appears in john code.

@shinnok
Copy link
Member

shinnok commented May 25, 2015

For core, we need answers for points 4 and 5.
For jumbo, the crack-status and --progress-every will eventually override the timer option since it is a better method.
We are talking about two different things here:

  1. The inability to get status from core john stdout. This relates to showing statistics, reading cracked passwords and updating Console Log.
  2. Jumbo presents improved options for us to get statistics and status lines. However we'll still be hit by the inability to read stdout properly.
    In these two contexts:
    a) Updating console log properly;
    b) Getting info from a running JtR instance;

It might be best to split these into separate issues and tasks respectively. Also to start the appropriate discussions on john-dev.

@mathsoft-dev
Copy link
Collaborator Author

All right, I understand thanks. Let's concentrate on case a) for this issue. I'll make another issue for case b)
You are right guys, it's related to the buffering of john. For example, for the X hashes loaded message), there is this line in john.c with \n, but it doesn't seems to flush the buffer. If I add fflush(stdout); after this line, Johnny will get it and print X hashes loaded at the right time. I guess this happens with other important strings in JtR. I'll start a thread about this on the mailling list.
printf("Loaded %s (%s%s%s [%s])\n",
john_loaded_counts(),
database.format->params.label,
database.format->params.format_name[0] ? ", " : "",
database.format->params.format_name,
database.format->params.algorithm_name);

@shinnok
Copy link
Member

shinnok commented May 28, 2015

@Math07 I got caught up in some general improvements today following up on your TODOS PR integration, thus I won't get to write the CoreHandler stub until tomorrow. If you get some spare time left can you please create the separate issue for b) and also try and write a followup to the e-mail discussion on john-dev? Take the time to sink into the issues described, since they are quite important for now and the future, so it's important that you have a grasp of it.

If you have questions or doubts, include them in the e-mail.

@shinnok shinnok added the Issue label Jun 1, 2015
@shinnok shinnok added this to the 2.1 milestone Jun 30, 2015
@shinnok shinnok modified the milestones: 2.2, 2.1 Jul 24, 2015
@shinnok
Copy link
Member

shinnok commented Aug 13, 2015

--progress-every option would be useful for updating the Statistics pane.

@shinnok
Copy link
Member

shinnok commented Aug 13, 2015

@Math07 do we have a resolution for sending keys to a running JtR instance? (john core especially)

@shinnok shinnok modified the milestones: 2.3, 2.2 Aug 13, 2015
@mathsoft-dev
Copy link
Collaborator Author

do we have a resolution for sending keys to a running JtR instance? (john core especially)

No, I don't think so. The write to process didn't work last time I tried it. I remember seeing in the code comment and in the mailling list that this was a concern Aleksey had back in the days and that's why he had to rely on john --show and timer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants