Skip to content
Snippets Groups Projects
Commit 9dd17582 authored by ulif's avatar ulif
Browse files

Strip numbers from wordlists.

Many wordlists have format "NNNNNN<tab>some-term". We try to
detect lines of this format and will parse them to get the term
(removing numbers and whitespaces).
parent d9f918aa
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,9 @@ def get_signed_wordlist(file_descriptor):
break
if line.startswith('- '):
line = line[2:]
match = RE_NUMBERED_WORDLIST_ENTRY.match(line)
if match:
line = match.groups()[0]
if not line:
continue
result += [line, ]
......
......@@ -67,8 +67,8 @@ class Test_GetSignedWordList(object):
with open(wlist_path, 'r') as fd:
result = get_signed_wordlist(fd)
assert len(result) == 7776
assert "11111\ta" == result[0]
assert "66666\t@" == result[-1]
assert "a" == result[0]
assert "@" == result[-1]
class TestWordlistModule(object):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment