2018-05-02 12:50:31 -06:00
#!/usr/bin/env bash
2017-08-20 19:51:10 -06:00
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
2017-12-05 20:12:23 -07:00
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
2017-12-05 20:12:23 -07:00
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 "
2018-04-05 01:14:29 -06:00
if [ -f "fluxion.sh" ] ; then
declare -r FLUXIONInfo = ( $( grep -oE "FLUXION(Version|Revision)=[0-9]+" fluxion.sh) )
2018-01-25 13:29:04 -07:00
else
2018-04-05 01:14:29 -06:00
declare -r FLUXIONInfo = ( $( grep -oE "FLUXION(Version|Revision)=[0-9]+" ../fluxion.sh) )
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-05-02 19:47:36 -06:00
echo " $HEADER_SIZE Pyrit Info "
scapyver = $( python2 -c "import scapy; print(scapy.VERSION)" )
pyrit | head -n 3
echo " **Scapy Version:** ${ scapyver } "
if [ [ " $scapyver " != 2.3.? ] ] ; then
echo -e "\033[31mWarning: Pyrit has been reported to be incompatible with scapy version 2.4.0. Consult the wiki for further information. This should not affect you, if you don't choose to use pyrit in the script.\033[0m"
fi
echo -ne "\n"
# System info
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