Skip to content

Commit

Permalink
Update pre2k.py
Browse files Browse the repository at this point in the history
Added samaccountname length check to unauth module
  • Loading branch information
garrettfoster13 committed Aug 31, 2022
1 parent d00b045 commit e93a36d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pre2k.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

from cProfile import run
from impacket.smbconnection import SMBConnection
from impacket.spnego import SPNEGO_NegTokenInit, TypesMech
from binascii import unhexlify
Expand Down Expand Up @@ -358,6 +356,7 @@ def fetch_computers(self, ldap_session):
for attr in attributes:
val = entry[attr].value
if len(val) >= 15:
#if account name is 15 chars or more pw is first 14
credentials = val + ":" + val.lower()[:-2]
else:
credentials = val + ":" + val.lower()[:-1]
Expand Down Expand Up @@ -403,7 +402,11 @@ def parse_input(inputfile, args):
with open (inputfile) as f:
y = f.read().split("\n")
for i in y:
credentials = i + ":" + i.lower()[:-1]
if len(i) >= 15:
# if accountname is 15 chars or more pw is first 14
credentials = i[:15] + ":" + i[:14]
else:
credentials = i + ":" + i.lower()[:-1]
creds.append(credentials)
pw_spray(creds, args)

Expand Down

0 comments on commit e93a36d

Please sign in to comment.