Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 17 Mar 2013 15:19:17 +0100
From: magnum <>
Subject: Re: All *2john programs should use basename of filename when put as “login” field

On 17 Mar, 2013, at 6:43 , Lukas Odzioba <> wrote:

> magnum:
> I revieved our *2john files from src dir:

Excellent, I think we have neglected them.

> Before we start fixing them I would like to hear what is the proper
> way of handling basename to be portable.
> I tried to implement what you sketched earlier in gpg2john - please
> take a look at it.
> General function should also take list of extensions that will be
> stripped, OR strip everything after last dot OR does not stip
> extensions.
> I would like to have this function defined somewhere and included in
> other files to avoid stupid code duplication, so we need a proper
> place for it.

As far as I know there are two problems:
1. Some versions of basename() modify the original string, some do not. This is only a problem if we want to keep the original full name as well.
2. Some versions of basename() may return NULL on error. This problem might be more or less academic for this use.

The current gpg2john code handles both cases. A generic version in misc.c or maybe in path.c is a good idea. Supporting an arbitrary list of extensions to strip would be powerful of course.

> -----fix needed
> mozilla2john
> keyring2john
> ssh2john
> keychain2john
> pfx2john
> putty2john
> pwsafe2john
> -----fixed
> gpg2john - is this portable?
> zip2john - not portable?
> rar2john - not portable?
> dmg2john - not portable???

The last three are probably OK too, but not perfect. I suppose a NULL return from basename() is as rare as one from malloc().

> ----- I'm not sure
> office2john
> vncpcap2john

I think both are OK. Office2john does basename (in python), vncpcap2john seems to use an actual login id.

> -----does not print file names at all (is it ok?)
> kwallet2john
> truecrypt_volume2john

I think both should be fixed. kwallet2john seems to output bare hashes without a login field, and I think TC outputs a fixed string - a basename of filename would be better.

> -----not applicable?
> wpapcap2john
> uaf2john
> racf2john
> hccap2john
> keepass2john

I think keepass2john should be fixed. It currently puts full pathname in login field.


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.