Commit 206a70c0 by fwkz

Fixing retrieving groups from tokenize()

parent 107678b3
...@@ -50,7 +50,7 @@ class Exploit(exploits.Exploit): ...@@ -50,7 +50,7 @@ class Exploit(exploits.Exploit):
] ]
for token in tokenize(tokens, response): for token in tokenize(tokens, response):
creds.append((token.typ, token.value)) creds.append((token.typ, token.value[-1]))
if creds: if creds:
print_success("Credentials found!") print_success("Credentials found!")
......
...@@ -276,7 +276,7 @@ def tokenize(token_specification, text): ...@@ -276,7 +276,7 @@ def tokenize(token_specification, text):
line_start = 0 line_start = 0
for mo in re.finditer(tok_regex, text): for mo in re.finditer(tok_regex, text):
kind = mo.lastgroup kind = mo.lastgroup
value = mo.group(kind) value = filter(lambda x: x is not None, mo.groups())
if kind == 'NEWLINE': if kind == 'NEWLINE':
line_start = mo.end() line_start = mo.end()
line_num += 1 line_num += 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment