Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 18 Jun 2015 00:26:48 +0200
From: Marek Wrzosek <marek.wrzosek@...il.com>
To: john-users@...ts.openwall.com
Subject: Re: The newest librexgen with fixed "missing character
 from AlternativeIterator" available

Hi

I've just pulled and built bleeding-jumbo with rexgen. I've not observed
any sign of memory leak and there is no sign of missing that "missing
characters" bug but...
There is difference between two commands:
$ echo pass|./john --stdin --stdout --regex=case="(?i:y|n)\0(?i:y|n)"

and

$ echo pass|./john --stdin --stdout --regex=alpha="(?i:y|n)\0(?i:y|n)"

Just using option "alpha" with or without alphabet will cause that any
text after \0 will be copied one place to early. I'm glad that there is
a debug print buf, because buf is "pass" but passwords are e.g. "npasn".
If someone will use any alphabet e.g. case or leet than this bug is
causing this e.g.

$ echo pass|./john --stdin --stdout --regex=alpha:leet="(?i:y|n)\0(?i:y|n)"
Using default input encoding: UTF-8
buf=p[a4@][s$5][s$5]
error: syntax error, unexpected T_BEGIN_GROUP, expecting T_END_CLASS
Error, invalid regex expression.  John exiting now  base_word=pass
Regex= (?i:y|n)p[a4@][s$5][s$5(?i:y|n)

Furthermore alpha:case without case option is doing nothing.

$ echo pass|./john --stdin --stdout --regex=alpha:case="(?i:y|n)\0(?i:y|n)"
Using default input encoding: UTF-8
buf=pass
pass
1p 0:00:00:00 0.00% 5.555p/s pass

$ echo pass|./john --stdin --stdout
--regex=case=alpha:case="(?i:y|n)\0(?i:y|n)"
Using default input encoding: UTF-8
buf=[pP][aA][sS][sS]
error: syntax error, unexpected T_BEGIN_GROUP, expecting T_END_CLASS
Error, invalid regex expression.  John exiting now  base_word=pass
Regex= (?i:y|n)[pP][aA][sS][sS(?i:y|n)

Of course there is workaround if you know what character should be at
the end of buf and add it as the first character after \0 e.g.

$ echo pa|./john --stdin --stdout --regex=case=alpha:case="(?i:y)\0](?i:n)"
Using default input encoding: UTF-8
buf=[pP][aA]
ypan
Ypan
yPan
YPan
ypAn
YpAn
yPAn
YPAn
ypaN
YpaN
yPaN
YPaN
ypAN
YpAN
yPAN
YPAN
16p 0:00:00:00 0.00% 94.11p/s YPAN

Maybe this will help to find this off-by-one error.

Best Regards

W dniu 17.06.2015 o 23:00, Jan Starke pisze:
> Dear all,
> 
> I needed to change how librexgen is being used, sorry. I created a pull
> request in magnums repo, that fixes this in JtR.
> 
> Regards, Jan
> 
> 2015-06-17 19:01 GMT+02:00 Marek Wrzosek <marek.wrzosek@...il.com>:
> 
>> W dniu 17.06.2015 o 18:39, magnum pisze:
>>> On 2015-06-17 17:36, Marek Wrzosek wrote:
>>>> Hi
>>>>
>>>> I've just pulled the newest version of rexgen and the missing character
>>>> bug is fixed but I can't build john with this version of librexgen.
>>>> I've got this error message:
>>>>
>>>> regex.c: In function ‘do_regex_crack_as_rules’:
>>>> regex.c:107:2: error: unknown type name ‘c_iterator_ptr’
>>>> regex.c:107:24: warning: initialization makes integer from pointer
>>>> without a cast [enabled by default]
>>>> regex.c:162:2: warning: implicit declaration of function
>>>> ‘c_regex_iterator_cb’ [-Wimplicit-function-declaration]
>>>> regex.c:167:2: warning: implicit declaration of function
>>>> ‘c_iterator_next’ [-Wimplicit-function-declaration]
>>>> regex.c:168:3: warning: implicit declaration of function
>>>> ‘c_iterator_value’ [-Wimplicit-function-declaration]
>>>> regex.c:174:5: warning: implicit declaration of function
>>>> ‘c_iterator_delete’ [-Wimplicit-function-declaration]
>>>> regex.c: In function ‘do_regex_crack’:
>>>> regex.c:186:2: error: unknown type name ‘c_iterator_ptr’
>>>> regex.c:186:24: warning: initialization makes integer from pointer
>>>> without a cast [enabled by default]
>>>> make[1]: *** [regex.o] Błąd 1
>>>> make: *** [default] Błąd 2
>>>>
>>>> I don't know if this is librexgen fault or something changed in john
>>>> lately.
>>>
>>> I'm not aware of any change in JtR that would affect this. If Jan
>>> changed the library interface again, I hope he'll post a patch for Jumbo.
>>>
>>> magnum
>>>
>>>
>>
>> Thanks for fast reply. Could you write a comment on issue #12 of
>> teeshop's github?
>>
>> Best Regards
>> --
>> Marek Wrzosek
>> marek.wrzosek@...il.com
>>
> 

-- 
Marek Wrzosek
marek.wrzosek@...il.com

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.