Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240919130632.GA6597@openwall.com>
Date: Thu, 19 Sep 2024 15:06:32 +0200
From: Solar Designer <solar@...nwall.com>
To: john-users@...ts.openwall.com
Subject: Re: rule for password with control characters

On Wed, Sep 18, 2024 at 02:07:41PM -0700, jeff wrote:
> That is 90% of what I need. Based on your advice I made these rules:
> [List.Rules:rep_control_1]
> # Trivial
> o[0-9A-Z][\x7f\x80\x01-\x1f]
> 
> [List.Rules:ins_control_1]
> # Trivial
> i[0-9A-Z][\x7f\x80\x01-\x1f]

This is up to you, but I recommend that you (eventually) use (base your
changes on) the optimized rather than the trivial versions of these
rules.  The trivial ones will attempt to change characters even beyond
the input password's length, which is a waste of time.

> This will work when the input word character is 0-9 A-Z, but not with
> other characters.

No, you misunderstand this.  When used right after the "o" and "i"
commands, these characters indicate position codes rather than literal
characters.  doc/RULES says:

```
Numeric constants may be specified and variables referred to with the
following characters:

0...9   for 0...9
A...Z   for 10...35
```

> I am finding passwords of the form <tab>word and word<cr> ,
> where <tab> is the tab character and <cr> is a carriage-return character.

For these, it sounds like you need to perform two insertions at once.
You can achieve this by modifying the "i2" ruleset, or by invoking a
revision of the "i1" ruleset (such as your "ins_control_1") twice e.g.
like this: "--rules=ins_control_1 --rules-stack=ins_control_1".  Or you
could write a more specialized rule for just prefixing and suffixing.

> What I need are two rules that will do the following.
> I am using numbers just as placeholders, and ^ as a control character.
> If the dictionary word is 1234
> For replace_ccontrol I need to generate
> ^234
> 1^34
> 12^4
> 123^
> 
> and for insert_control I need to generate
> ^1234
> 1^234
> 12^34
> 123^4
> 1234^
> 
> Is there a way to do that?

Your rules already do that (and also waste time on trying to replace and
insert way beyond the password's length).

Alexander

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.