Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 03 Mar 2014 10:05:35 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Reload pot file

On 2014-03-03 05:08, magnum wrote:
> A different approach - and maybe quicker unless the above is simpler
> than I imagine - would be to do it more like cracker.c does when
> cmp_exact() returns true. I'd need to process the "hash:plain" into
> binaries, salts, sources and plains as if it came from a running format
> after a crack loop. This might be simpler but I haven't thought it
> through yet.

Thinking out loud:

First I copy
crk_process_guess(struct db_salt, struct db_password, int index)
and modify it into a
crk_process_potword(struct db_salt, struct db_password, char *plain)

(or better have one function handle both cases)

Then,

for (each line of .pot file) {
      char *ciphertext = field[0];
      char *plain = field[1];
      if (fmt.methods.valid(ciphertext)) {
          pot_salt = fmt.get_salt(ciphertext);
          salt = crk_db->salts;
          do {
              if memcmp(pot_salt, salt->salt, fmt.salt_size)
              {
                  pw = salt->list;
                  do {
                      if (strcmp(pw->source, ciphertext)) {
                          if (crk_process_potword(salt, pw, plain))
                              goto next_line;
                          else {
                              if (!(crk_params.flags & FMT_NOT_EXACT))
                                  break;
                          }
                      }
                  } while ((pw = pw->next));
                  break;
              }
          } while ((salt = salt->next));
      }
next_line:
}

Maybe this would work. This seems simpler than the loader stuff I looked at.

magnum

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ