Date: Fri, 23 Sep 2011 05:37:56 +0200 From: magnum <rawsmooth@...dband.net> To: john-dev@...ts.openwall.com Subject: Re: user-defined character class samples On 2011-09-23 03:24, Solar Designer wrote: > On Wed, Sep 21, 2011 at 10:57:33PM +0200, magnum wrote: >> Dang, now I remember I should have revised that sample, it's not doing >> what it was supposed to. > > I guess you're referring to this one? - > > # This silly example rule use the user-defined character class > # example ?1 above. It will prepend any hex-string of at least > # 4 digits within a candidate with 0x as well as with \x like > # this: > # 'hello' -> rejected > # 'alibaba' -> 'ali0xbaba' and 'ali\xbaba' > [List.Rules:Example] > %4?1vap2Aa"[\\0]x" > > If so, that's not what I meant, although we should have removed it (feel > free to submit a patch such that we don't forget). Yes, that rule only does the right thing when the hex-digits are consecutive. %N?C is "reject the word unless it contains at least N characters of class C" but I did the mistake of assuming "...at least N consecutive...". By the way, such a command might be useful. > These examples are correct, right? - > > # This is a couple of example classes: > # ?0 matches (one version of) base64 characters > # ?1 matches hex digits > # ?2 matches the TAB character (never try to use \x00!) > [UserClasses] > 0 = [a-zA-Z0-9/.] > 1 = [0-9a-fA-F] > 2 = \x09 > > Hmm, did you implement the \x09 thing? I am not sure. Yes, they are correct and \x09 works fine. This works in ranges too, eg [\x80-\xff]. But the \x thing only works in that very section: I'm still pondering how to implement something similar for rules in a clever way. magnum
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.