From 7110238fb2e3a79f1e73cf4c027267767f8ab14b Mon Sep 17 00:00:00 2001 From: byt3bl33d3r Date: Sat, 6 Jun 2015 19:26:23 +0200 Subject: [PATCH] This adds in error handling to avoid the 'Interrupted system call' error described in #109 *Note: this doesn't actually fix the problem --- core/protocols/arp/ARPpoisoner.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/protocols/arp/ARPpoisoner.py b/core/protocols/arp/ARPpoisoner.py index 4e4ee55..668ce48 100644 --- a/core/protocols/arp/ARPpoisoner.py +++ b/core/protocols/arp/ARPpoisoner.py @@ -93,8 +93,9 @@ class ARPpoisoner(): sleep(0.3) send(ARP(pdst=self.gatewayip, psrc=targetip, hwdst=self.gatewaymac, op="is-at", ), iface=self.interface, verbose=self.debug) - except Exception, e: - mitmf_logger.error("[ARPpoisoner] Exception occurred while poisoning {}: {}".format(targetip, e)) + except Exception as e: + if "Interrupted system call" not in e: + mitmf_logger.error("[ARPpoisoner] Exception occurred while poisoning {}: {}".format(targetip, e)) pass sleep(self.interval) @@ -119,10 +120,11 @@ class ARPpoisoner(): sleep(0.3) send(ARP(pdst=self.gatewayip, psrc=targetip, hwdst=self.gatewaymac, op="who-has"), iface=self.interface, verbose=self.debug) - except Exception, e: - mitmf_logger.error("[ARPpoisoner] Exception occurred while poisoning {}: {}".format(targetip, e)) + except Exception as e: + if "Interrupted system call" not in e: + mitmf_logger.error("[ARPpoisoner] Exception occurred while poisoning {}: {}".format(targetip, e)) pass - + sleep(self.interval) def restoreNet(self, count): @@ -145,6 +147,7 @@ class ARPpoisoner(): sleep(0.3) send(ARP(op="is-at", pdst=targetip, psrc=self.gatewayip, hwdst="ff:ff:ff:ff:ff:ff", hwsrc=self.gatewaymac), iface=self.interface, count=count, verbose=self.debug) - except Exception, e: - mitmf_logger.error("[ARPpoisoner] Exception occurred while restoring connection {}: {}".format(targetip, e)) + except Exception as e: + if "Interrupted system call" not in e: + mitmf_logger.error("[ARPpoisoner] Exception occurred while poisoning {}: {}".format(targetip, e)) pass