added better error handeling, fixed nfqeueue error should work with any version > 4.1

This commit is contained in:
byt3bl33d3r 2014-11-12 09:56:33 +01:00
parent f51a458733
commit 8b9d499033
3 changed files with 16 additions and 4 deletions

View file

@ -28,6 +28,7 @@ if __name__ == "__main__":
slogopts.add_argument("-p", "--post", action="store_true",help="Log only SSL POSTs. (default)")
slogopts.add_argument("-s", "--ssl", action="store_true", help="Log all SSL traffic to and from server.")
slogopts.add_argument("-a", "--all", action="store_true", help="Log all SSL and HTTP traffic to and from server.")
#slogopts.add_argument("-c", "--clients", action='store_true', default=False, help='Log each clients data in a seperate file')
sgroup.add_argument("-l", "--listen", type=int, metavar="port", default=10000, help="Port to listen on (default 10000)")
sgroup.add_argument("-f", "--favicon", action="store_true", help="Substitute a lock favicon on secure requests.")
sgroup.add_argument("-k", "--killsessions", action="store_true", help="Kill sessions in progress.")

View file

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