added monitoring script

This commit is contained in:
Max Fiedler 2025-02-16 13:48:29 +01:00
parent 06e9460aab
commit 99c7f4af32
2 changed files with 42 additions and 5 deletions

36
mon Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Check if script is run as root
if [[ $EUID -ne 0 ]]; then
echo "[!] This script must be run as root!" >&2
exit 1
fi
# List network interfaces and their capabilities
echo "[+] Available network interfaces:"
iw dev | awk '/Interface/ {iface=$2; print "- Interface: " iface} /type/ {print " Current Mode: "$2}';
# Prompt user for the network card
while true; do
read -r -p "[?] Enter the interface to use for monitoring with airodump-ng (default: wlan1): " iface
iface=${iface:-wlan1}
if ip link show "$iface" &>/dev/null; then
break
else
echo "[!] Interface $iface does not exist. Please enter a valid interface."
fi
done
# Set up the interface
echo "[+] Preparing $iface for monitor mode..."
nmcli device set "$iface" managed no
ip link set "$iface" down
iw dev "$iface" set type monitor
ip link set "$iface" up
# Start monitoring
if ! airodump-ng -w wpa "$iface"; then
echo "[!] Failed to start airodump-ng. Exiting."
exit 1
fi

11
wpe
View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Check if script is run as root
if [[ $EUID -ne 0 ]]; then
@ -22,10 +22,10 @@ fi
fi
# List network interfaces and their capabilities
echo "[+] Available network interfaces and capabilities:"
iw dev | awk '/Interface/ {iface=$2; print "- Interface: " iface} /type/ {print " Current Mode: "$2}';
echo "[+] Supported modes for each interface:";
iw list | awk '/Wiphy/ {wiphy=$2} /Supported interface modes:/ {getline; while ($1 ~ /^[ ]/) {print " " wiphy " supports: " $1; getline}}';
echo "[+] Available network interfaces:"
iw dev | awk '/Interface/ {iface=$2; print "- Interface: " iface} /type/ {print " Current Mode: "$2}';
# echo "[+] Supported modes for each interface:";
# iw list | awk '/Wiphy/ {wiphy=$2} /Supported interface modes:/ {getline; while ($1 ~ /^[ ]/) {print " " wiphy " supports: " $1; getline}}';
# Prompt user for the network card
while true; do
@ -60,6 +60,7 @@ else
config_file="/etc/hostapd-wpe/hostapd-wpe.conf"
fi
# Launch hostapd-wpe
if ! hostapd-wpe -k "$config_file"; then
echo "[!] Failed to start hostapd-wpe. Exiting."
exit 1