Skip to content

Commit a5d239d

Browse files
committed
Switch to enumerate()
1 parent cb411bb commit a5d239d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

enum4linux-ng.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,13 +2232,13 @@ def rid_cycle(self, sid, rid_ranges, batch_size):
22322232
result = SambaRpcclient(['lookupsids', target_sids], self.target, self.creds).run(log='RID Cycling', error_filter=False)
22332233

22342234
split_result = result.retmsg.splitlines()
2235-
for line in range(len(split_result)):
2235+
for rid_offset, line in enumerate(split_result):
22362236
# Example: S-1-5-80-3139157870-2983391045-3678747466-658725712-1004 *unknown*\*unknown* (8)
2237-
match = re.search(r"(S-\d+-\d+-\d+-[\d-]+\s+(.*)\s+[^\)]+\))", split_result[line])
2237+
match = re.search(r"(S-\d+-\d+-\d+-[\d-]+\s+(.*)\s+[^\)]+\))", line)
22382238
if match:
22392239
sid_and_user = match.group(1)
22402240
entry = match.group(2)
2241-
rid = rid_base + line
2241+
rid = rid_base + rid_offset
22422242

22432243
# Samba servers sometimes claim to have user accounts
22442244
# with the same name as the UID/RID. We don't report these.

0 commit comments

Comments
 (0)