mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-07-07 13:32:18 -07:00
added better error handeling, fixed nfqeueue error should work with any version > 4.1
This commit is contained in:
parent
f51a458733
commit
8b9d499033
3 changed files with 16 additions and 4 deletions
|
@ -65,9 +65,17 @@ class Spoof(Plugin):
|
|||
if not self.manualiptables:
|
||||
os.system('iptables -F && iptables -X && iptables -t nat -F && iptables -t nat -X')
|
||||
|
||||
if self.arp:
|
||||
try:
|
||||
self.mac = get_if_hwaddr(self.interface)
|
||||
except Exception, e:
|
||||
sys.exit('[-] Error retrieving interfaces MAC address: %s' % e)
|
||||
|
||||
if self.arp:
|
||||
if not self.gateway:
|
||||
sys.exit("[-] --arp argument requires --gateway")
|
||||
|
||||
self.routermac = getmacbyip(self.gateway)
|
||||
|
||||
print "[*] ARP Spoofing enabled"
|
||||
if self.arpmode == 'req':
|
||||
pkt = self.build_arp_req()
|
||||
|
@ -77,8 +85,11 @@ class Spoof(Plugin):
|
|||
thread_args = (pkt, self.interface, self.debug,)
|
||||
|
||||
elif self.icmp:
|
||||
self.mac = get_if_hwaddr(self.interface)
|
||||
if not self.gateway:
|
||||
sys.exit("[-] --icmp argument requires --gateway")
|
||||
|
||||
self.routermac = getmacbyip(self.gateway)
|
||||
|
||||
print "[*] ICMP Redirection enabled"
|
||||
pkt = self.build_icmp()
|
||||
thread_target = self.send_packets
|
||||
|
@ -249,7 +260,7 @@ class Spoof(Plugin):
|
|||
except Exception:
|
||||
logging.debug("Error resolving " + domain)
|
||||
|
||||
def nfqueue_callback(self, i, payload):
|
||||
def nfqueue_callback(self, payload, *kargs):
|
||||
data = payload.get_data()
|
||||
pkt = IP(data)
|
||||
if not pkt.haslayer(DNSQR):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue