fluxion/scripts/diagnostics.sh

90 lines
2.1 KiB
Bash
Raw Normal View History

2017-08-20 19:51:10 -06:00
#!/bin/bash
2018-01-25 13:29:04 -07:00
clear
declare -r HEADER_SIZE="####"
# Diagnostic script
if [ -d "lib" ];then
source lib/InterfaceUtils.sh
elif [ -d "../lib" ];then
source ../lib/InterfaceUtils.sh
else
2018-01-25 13:29:04 -07:00
echo -e "\033[31mError lib folder not found\033[0m"
2017-12-31 09:02:12 -07:00
exit 1
fi
2017-12-31 09:02:12 -07:00
if [ ! "$1" ]; then
2018-01-25 13:29:04 -07:00
echo "Usage ./scripts/diagnostics [wireless_interface]"
2017-12-31 09:02:12 -07:00
exit 1
2017-08-20 19:51:10 -06:00
fi
2018-01-25 13:29:04 -07:00
echo "$HEADER_SIZE FLUXION Info"
if [ -f "fluxion" ];then
declare -r FLUXIONInfo=($(grep -oE "FLUXION(Version|Revision)=[0-9]+" fluxion))
else
declare -r FLUXIONInfo=($(grep -oE "FLUXION(Version|Revision)=[0-9]+" ../fluxion))
2017-12-31 23:56:55 -07:00
fi
2017-08-20 19:51:10 -06:00
echo "FLUXION V${FLUXIONInfo[0]/*=/}.${FLUXIONInfo[1]/*=/}"
echo -ne "\n\n"
2018-01-25 13:29:04 -07:00
echo "$HEADER_SIZE BASH Info "
2017-08-20 19:51:10 -06:00
bash --version
2018-01-25 13:29:04 -07:00
echo "**Path:** $(ls -L $(which bash))"
2017-08-20 19:51:10 -06:00
echo -ne "\n\n"
2018-01-25 13:29:04 -07:00
echo "$HEADER_SIZE Interface ($1) Info "
if interface_physical "$1";then
echo "**Device**: $InterfacePhysical"
else
echo "**Device:** Unknown"
fi
if interface_driver "$1";then
echo "**Driver:** $InterfaceDriver"
else
echo "**Driver:** Unsupported"
2017-08-20 19:51:10 -06:00
fi
2018-01-25 13:29:04 -07:00
if interface_chipset "$1";then
echo "**Chipset:** $InterfaceChipset"
else
echo "**Chipset:** Unknown"
2017-08-20 19:51:10 -06:00
fi
2018-01-25 13:29:04 -07:00
if iw list | grep monitor | head -n 1 | tail -n 1 &>/dev/null;then
echo "**Master Modes** Yes"
else
echo "**Master Modes** No"
2017-08-20 19:51:10 -06:00
fi
2018-01-25 13:29:04 -07:00
echo -n "**Injection Test:** "
aireplay-ng --test "$1" | grep -oE "Injection is working!|No Answer..." || echo -e "\033[31mFailed\033[0m"
2017-08-20 19:51:10 -06:00
echo -ne "\n\n"
2018-01-25 13:29:04 -07:00
echo "$HEADER_SIZE XTerm Infos"
echo "**Version:** $(xterm -version)"
echo "**Path:** $(ls -L $(which xterm))"
2017-08-27 14:06:01 -06:00
echo -n "Test: "
2017-12-31 09:02:12 -07:00
if xterm -hold -fg "#FFFFFF" -bg "#000000" -title "XServer/XTerm Test" -e "echo \"XServer/XTerm test: close window to continue...\"" &>/dev/null; then echo "XServer/XTerm success!"
2018-01-25 13:29:04 -07:00
else
echo -e "\033[31m XServer/XTerm failure!\033[0m"
2017-08-27 14:06:01 -06:00
fi
2017-08-20 19:51:10 -06:00
echo -ne "\n\n"
2018-01-25 13:29:04 -07:00
echo "$HEADER_SIZE HostAPD Info"
2017-08-20 19:51:10 -06:00
hostapd -v
2017-12-31 09:02:12 -07:00
echo "Path: $(ls -L $(which hostapd))"
2017-08-20 19:51:10 -06:00
echo -ne "\n\n"
2018-01-25 13:29:04 -07:00
echo "$HEADER_SIZE Aircrack-ng Info"
2017-08-20 19:51:10 -06:00
aircrack-ng -H | head -n 4
2018-01-25 13:29:04 -07:00
echo -ne "\n"
2017-08-20 19:51:10 -06:00
2018-01-25 13:29:04 -07:00
echo "$HEADER_SIZE System Info"
if [ -r "/proc/version" ]; then
echo "**Chipset:** $(cat /proc/version)"
else
echo "**Chipset:** $(uname -r)"
2017-08-20 19:51:10 -06:00
fi