Skip to content

Commit ee0d4d0

Browse files
author
Taylor Pennington
committed
Fixes parsing issue with multi-line values
1 parent bde3ce2 commit ee0d4d0

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

enum4linux-ng.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,16 +1853,25 @@ def get_details_from_rid(self, rid, name):
18531853
user_info = match.group(1)
18541854
user_info = user_info.replace("\t", "")
18551855

1856+
regexMatch = r'^\t[A-Za-z][A-Za-z\s_\.0-9]*(:|\[[0-9\.]+\]\.\.\.)(\t|\s)?'
1857+
18561858
for line in filter(None, user_info.split('\n')):
1857-
if ':' in line:
1858-
(key, value) = line.split(":", 1)
1859-
key = key.rstrip()
1860-
# Skip user and full name, we have this information already
1859+
if re.match(regexMatch, line):
1860+
if ":" in line:
1861+
key, value = line.split(":", 1)
1862+
if "..." in line:
1863+
key, value = line.split("...", 1)
1864+
18611865
if "User Name" in key or "Full Name" in key:
18621866
continue
1867+
key = key.strip()
1868+
value = value.strip()
18631869
details[key] = value
18641870
else:
1865-
details[line] = ""
1871+
if key not in details:
1872+
details[key] = line
1873+
else:
1874+
details[key] += "\n" + line
18661875

18671876
if "acb_info" in details and valid_hex(details["acb_info"]):
18681877
for key in ACB_DICT:

0 commit comments

Comments
 (0)