Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 28 Feb 2013 00:57:23 +0100
From: magnum <john.magnum@...hmail.com>
To: john-users@...ts.openwall.com
Subject: Re: Fuzzing with regular expressions

On 27 Feb, 2013, at 20:47 , Jan Starke <jan.starke@...ofbed.org> wrote:

> Hi folks,
> 
> I'm currently working on a library to create values (e.g. passwords)
> based on regular expressions. One could use this tool together with
> john like this:
> 
> $ rexgen -i 'password[0-9]{2,4}' | john -pipe ....

I really like this idea but I'm concerned it might be too slow. Let's hope I am wrong.

A list of requirements would be nice. So far I know of cmake, log4cpp, libunistring and lua52.

After fetching your latest commits I have this problem on OSX:

[  5%] [FLEX][regexlexer] Building scanner with flex 2.5.35
[ 10%] [BISON][regexparser] Building parser with bison 2.3
parser/regex_parser.y:162.4: invalid character: `['
parser/regex_parser.y:162.7: invalid character: `]'
parser/regex_parser.y:165.29-30: $3 of `GroupRegex' has no declared type
parser/regex_parser.y:166.20: warning: stray `$'
parser/regex_parser.y:159.3-170.3: warning: unused value: $2
make[2]: *** [librexgen/parser.cpp] Error 1
make[1]: *** [librexgen/CMakeFiles/rexgen-0.1.0.dir/all] Error 2
make: *** [all] Error 2

The above looks like bison is too old [the OSX native one] so I tried latest Ubuntu Linux instead of digging into it. But then I got other problems:

[  5%] [FLEX][regexlexer] Building scanner with flex 2.5.35
[ 10%] [BISON][regexparser] Building parser with bison 2.5
[ 15%] Building CXX object librexgen/CMakeFiles/rexgen-0.1.0.dir/librexgen.cpp.o
/home/magnum/src/rexgen/src/librexgen/librexgen.cpp:46:2: warning: #warning this must be handled with normal syntax error reporting [-Wcpp]
In file included from /home/magnum/src/rexgen/src/librexgen/parser/rexgenparsercontext.h:35:0,
                 from /home/magnum/src/rexgen/src/librexgen/librexgen.cpp:28:
/home/magnum/src/rexgen/src/librexgen/regex/groupreference.h: In member function ‘virtual const char_type* GroupReference::getXmlTag() const’:
/home/magnum/src/rexgen/src/librexgen/regex/groupreference.h:42:1: warning: cast from type ‘const char32_t*’ to type ‘char_type* {aka unsigned int*}’ casts away qualifiers [-Wcast-qual]
[ 21%] Building CXX object librexgen/CMakeFiles/rexgen-0.1.0.dir/librexgen_lua.cpp.o
[ 26%] Building CXX object librexgen/CMakeFiles/rexgen-0.1.0.dir/debug.cpp.o
[ 31%] Building CXX object librexgen/CMakeFiles/rexgen-0.1.0.dir/regex/compoundregex.cpp.o
In file included from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.h:35:0,
                 from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:29:
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h: In member function ‘void IteratorPermuter<REGEX>::next()’:
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:138:9: error: capture of non-variable ‘Iterator::state’ 
In file included from /home/magnum/src/rexgen/src/librexgen/regex/regex.h:32:0,
                 from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.h:32,
                 from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:29:
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iterator.h:58:5: note: ‘Iterator::<anonymous enum> Iterator::state’ declared here
In file included from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.h:35:0,
                 from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:29:
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h: In lambda function:
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:138:71: error: ‘this’ was not captured for this lambda function
In file included from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:29:0:
/home/magnum/src/rexgen/src/librexgen/regex/compoundregex.h: In member function ‘virtual const char_type* CompoundRegex::getXmlTag() const’:
/home/magnum/src/rexgen/src/librexgen/regex/compoundregex.h:45:1: warning: cast from type ‘const char32_t*’ to type ‘char_type* {aka unsigned int*}’ casts away qualifiers [-Wcast-qual]
In file included from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:30:0:
/home/magnum/src/rexgen/src/librexgen/regex/terminalregex.h: In constructor ‘TerminalRegex::TerminalRegex()’:
/home/magnum/src/rexgen/src/librexgen/regex/terminalregex.h:9:1: warning: cast from type ‘const char32_t*’ to type ‘char_type* {aka unsigned int*}’ casts away qualifiers [-Wcast-qual]
/home/magnum/src/rexgen/src/librexgen/regex/terminalregex.h: In member function ‘virtual const char_type* TerminalRegex::getXmlTag() const’:
/home/magnum/src/rexgen/src/librexgen/regex/terminalregex.h:19:1: warning: cast from type ‘const char32_t*’ to type ‘char_type* {aka unsigned int*}’ casts away qualifiers [-Wcast-qual]
In file included from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:31:0:
/home/magnum/src/rexgen/src/librexgen/iterator/compoundregexiterator.h: In lambda function:
/home/magnum/src/rexgen/src/librexgen/iterator/compoundregexiterator.h:47:75: warning: deleting object of polymorphic class type ‘Iterator’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
/home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp: In destructor ‘virtual CompoundRegex::~CompoundRegex()’:
/home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:38:13: warning: deleting object of abstract class type ‘Regex’ which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]
In file included from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.h:35:0,
                 from /home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:29:
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h: In instantiation of ‘IteratorPermuter<REGEX>::initIterators() [with REGEX = Regex]::<lambda(Iterator*)>’:
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:173:49:   required from ‘struct IteratorPermuter<REGEX>::initIterators() [with REGEX = Regex]::<lambda(class Iterator*)>’
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:173:3:   required from ‘void IteratorPermuter<REGEX>::initIterators() [with REGEX = Regex]’
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:71:3: required from ‘IteratorPermuter<REGEX>::IteratorPermuter(int, const REGEX*, IteratorState*, unsigned int, unsigned int) [with REGEX = Regex]’
/home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:88:63:   required from here
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:173:64: warning: deleting object of polymorphic class type ‘Iterator’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h: In instantiation of ‘IteratorPermuter<REGEX>::initIterators() [with REGEX = CompoundRegex]::<lambda(Iterator*)>’:
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:173:49:   required from ‘struct IteratorPermuter<REGEX>::initIterators() [with REGEX = CompoundRegex]::<lambda(class Iterator*)>’
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:173:3:   required from ‘void IteratorPermuter<REGEX>::initIterators() [with REGEX = CompoundRegex]’
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:71:3: required from ‘IteratorPermuter<REGEX>::IteratorPermuter(int, const REGEX*, IteratorState*, unsigned int, unsigned int) [with REGEX = CompoundRegex]’
/home/magnum/src/rexgen/src/librexgen/regex/compoundregex.cpp:96:59:   required from here
/home/magnum/src/rexgen/src/librexgen/regex/../iterator/iteratorpermuter.h:173:64: warning: deleting object of polymorphic class type ‘Iterator’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
make[2]: *** [librexgen/CMakeFiles/rexgen-0.1.0.dir/regex/compoundregex.cpp.o] Error 1
make[1]: *** [librexgen/CMakeFiles/rexgen-0.1.0.dir/all] Error 2
make: *** [all] Error 2


Is this the result of me still missing something? On what platform are you developing this?

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.