1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-27 19:04:15 +01:00

Added try-except for processing grep output

Ensured that errors were handled properly during password enumeration.
This commit is contained in:
Caleb Stewart 2020-09-01 21:59:24 -04:00
parent e76a741add
commit 57809be2ee

View File

@ -69,8 +69,18 @@ def enumerate() -> Generator[FactData, None, None]:
continue continue
if len(line) < 3: if len(line) < 3:
continue continue
# Grab the page
path = line[0] path = line[0]
lineno = int(line[1])
try:
# Grab the line number
lineno = int(line[1])
except ValueError:
# Malformed line from grep, ignore it.
continue
# Grab the content
content = ":".join(line[2:]) content = ":".join(line[2:])
password = None password = None