
Originally Posted by
PrairieFire
Noted as possible fix rt8180, start-kismet-ng still fails on madwifi, hostap, iwlwifi, ipwraw,......
Hi thank u for the test i totally rewrited the script and now it works with madwifi,hostap,iwlwifi, ipwraw,rt73,rt8180 etc.
I personally tested with following cards:
ubiquiti src300
alfa AWUS036H
proxim ORiNOCO gold 8470-WD
logilink WL0025
netgear WG511T
intel 3945/4965
So, to substitute the /usr/local/bin/start-kismet-ng simply copy and paste the following code in a new file ad substitute the old /usr/local/bin/start-kismet-ng scripts with the new one.
If there are some cards that not work tell me asap.
Code:
#!/bin/bash
# This has been combined out of own start-kismet scripts and airmon-ng stuff
IFACE=""
KISMET=/usr/local/etc/kismet.conf
CH=$3; [ x$3 = "x" ] && CH=10
DEVCOUNT=0;
# Some global variable to keep structure clean inside script
which iwpriv > /dev/null 2> /dev/null ||
{ echo Wireless tools not found ; exit ; }
function startStdIface() {
iwconfig $1 mode monitor 2> /dev/null >/dev/null
iwconfig $1 channel $2 2> /dev/null >/dev/null
iwconfig $1 key off 2> /dev/null >/dev/null
ifconfig $1 up
echo -n " (monitor mode enabled)"
}
function stopStdIface() {
ifconfig $1 down 2> /dev/null >/dev/null
iwconfig $1 mode Managed 2> /dev/null >/dev/null
ifconfig $1 down 2> /dev/null >/dev/null
echo -n " (monitor mode disabled)"
}
# Here begins the main program and detection routine
for iface in `ifconfig -a 2>/dev/null | egrep HWaddr | cut -b 1-7`
do
if [ -e "/proc/sys/dev/$iface/fftxqmin" ]
then
ifconfig $iface up
#echo -e -n "$iface\t\tAtheros\t\tmadwifi-ng"
A_WLAN_MENU="$A_WLAN_MENU $iface,madwifi_ab $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
done
sleep 1s
for iface in `iwconfig 2>/dev/null | egrep '(RT73|unassociated|IEEE|ESSID|802\.11)' | cut -b 1-7 | grep -v -w wifi`
do
if [ x"`iwpriv $iface 2>/dev/null | grep force_reset`" != "x" ]
then
#echo -e -n "$iface\t\tHermesI\t\torinoco"
A_WLAN_MENU="$A_WLAN_MENU $iface,orinoco $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep set_crc_check`" != "x" ]
then
#echo -e -n "$iface\t\tCentrino b\tipw2100"
A_WLAN_MENU="$A_WLAN_MENU $iface,ipw2100 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep sw_reset`" != "x" ]
then
#echo -e -n "$iface\t\tCentrino b/g\tipw2200"
A_WLAN_MENU="$A_WLAN_MENU $iface,ipw2200 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep get_param | grep -v set_crc_check`" != "x" ]
then
# echo -e -n "$iface\t\tCentrino b/g\tipw3945"
A_WLAN_MENU="$A_WLAN_MENU $iface,ipw3945 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep ipwraw-ng | grep -v set_crc_check`" != "x" ]
then
# echo -e -n "$iface\t\tCentrino b/g\tipw3945"
A_WLAN_MENU="$A_WLAN_MENU $iface,ipw3945 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
echo
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep inact_auth`" != "x" ]
then
#echo -e -n "$iface\t\tAtheros\t\tmadwifi"
A_WLAN_MENU="$A_WLAN_MENU $iface,madwifi_ag $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep getPolicy`" != "x" ]
then
#echo -e -n "$iface\t\tPrismGT\t\tprism54"
A_WLAN_MENU="$A_WLAN_MENU $iface,prism54g $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep antsel_rx`" != "x" ]
then
#echo -e -n "$iface\t\tPrism2\t\tHostAP"
A_WLAN_MENU="$A_WLAN_MENU $iface,hostap $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`wlancfg show $iface 2>/dev/null | grep p2CnfWEPFlags`" != "x" ]
then
echo -e -n "$iface\t\tPrism2\t\twlan-ng"
A_WLAN_MENU="$A_WLAN_MENU $iface,wlanng $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
CHECK_RT73=`iwconfig 2>/dev/null| grep RT73| awk '{ print $2 }'`
if [ -n "${CHECK_RT73}" ]
then
if [ $CHECK_RT73 != "RT73" ]
then
if [ x"`iwpriv $iface 2>/dev/null | grep bbp`" != "x" ]
then
echo -e -n "$iface\t\tRalink b/g\trt2500"
A_WLAN_MENU="$A_WLAN_MENU $iface,rt2500 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
fi
fi
if [ x"`iwpriv $iface 2>/dev/null | grep wpapsk`" != "x" ] && [ x"`iwpriv $iface 2>/dev/null | grep get_RaAP_Cfg`" = "x" ]
then
echo -e -n "$iface\t\tRalink USB\trt2570"
A_WLAN_MENU="$A_WLAN_MENU $iface,rt2570 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep debugtx`" != "x" ]
then
echo -e -n "$iface\t\tRTL8180\t\tr8180"
A_WLAN_MENU="$A_WLAN_MENU $iface,rt8180 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep badcrc`" != "x" ]
then
echo -e -n "$iface\t\tRTL8187\t\tr8187"
A_WLAN_MENU="$A_WLAN_MENU $iface,rt8180 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep dbg_flag`" != "x" ]
then
echo -e -n "$iface\t\tZyDAS\t\tzd1211"
A_WLAN_MENU="$A_WLAN_MENU $iface,zd1211 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep GetAcx1`" != "x" ]
then
echo -e -n "$iface\t\tTI\t\tacx111"
A_WLAN_MENU="$A_WLAN_MENU $iface,acx100 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep write_sprom`" != "x" ]
then
echo -e -n "$iface\t\tBroadcom\t\tbcm43xx"
A_WLAN_MENU="$A_WLAN_MENU $iface,bcm43xx $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep set_announcedpkt`" != "x" ]
then
echo -e -n "$iface\t\tPrismGT\t\tislsm"
A_WLAN_MENU="$A_WLAN_MENU $iface,prism54g $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep set_announcedpkt`" != "x" ]
then
echo -e -n "$iface\t\tAtmel\t\tat76c503a"
A_WLAN_MENU="$A_WLAN_MENU $iface,atmel_usb $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwpriv $iface 2>/dev/null | grep get_RaAP_Cfg`" != "x" ]
then
if [ x"`iwconfig $iface | grep ESSID | awk -F\ '{ print $2}' | grep -i rt61`" != "x" ]
then
echo -e -n "$iface\t\tRalink b/g rt61"
A_WLAN_MENU="$A_WLAN_MENU $iface,rt2500 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
if [ x"`iwconfig $iface | egrep '(ESSID|RT73)' | awk -F\ '{ print $2}' | grep -i rt73`" != "x" ]
then
echo -e -n "$iface\t\tRalink USB rt73"
A_WLAN_MENU="$A_WLAN_MENU $iface,rt73 $iface"
DEVCOUNT=$[$DEVCOUNT+1];
continue
fi
fi
if [ x"`iwpriv $iface 2>/dev/null | grep ndis_reset`" != "x" ]
then
echo -e -n "$iface\t\tUnknown\t\tndiswrapper"
if [ x$2 = x$iface ]
then
echo -e " (MONITOR MODE NOT SUPPORTED)"
fi
echo
continue
fi
echo -e "$iface\t\tUnknown\t\tUnknown (MONITOR MODE NOT SUPPORTED)"
done
# this one is displaying the dialog and get the value out of it
if [ $DEVCOUNT -eq 0 ]
then
echo
echo Sorry i could not identify any wlan interfaced
echo i will exit now
echo
exit
elif [ $DEVCOUNT -gt 1 ]
then
A_ASKINTERFACE=`kdialog --caption "Select network device" --title "" --menu "There is more than one network adapter available, please choose which one to use" $A_WLAN_MENU 2>&1`
if [ -z $A_ASKINTERFACE ]
then
echo
echo Sorry you did not select anyhting, i exit now
echo
exit
else
iface=`echo $A_ASKINTERFACE | cut -d "," -f 1`
fi
fi
cp -f /usr/local/etc/kismet.conf.backtrack /usr/local/etc/kismet.conf
cp -f /usr/local/etc/kismet.conf.backtrack /usr/local/etc/kismet.conf~
eval "/usr/local/sbin/airmon-ng start $iface"
sleep 2
if [ $DEVCOUNT -gt 1 ]
then
DRP_DEVICE_NAME=`echo ${A_ASKINTERFACE}|cut -d, -f1`
DRP_DRIVER_NAME=`echo ${A_ASKINTERFACE} | cut -d , -f2| awk -F' ' '{print $1}'`
konsole -e kismet -c $DRP_DRIVER_NAME,$DRP_DEVICE_NAME,$DRP_DRIVER_NAME
else
DRP_DEVICE_NAME=`echo ${A_WLAN_MENU}|cut -d, -f1`
DRP_DRIVER_NAME=`echo ${A_WLAN_MENU} | cut -d , -f2| awk -F' ' '{print $1}'`
konsole -e kismet -c $DRP_DRIVER_NAME,$DRP_DEVICE_NAME,$DRP_DRIVER_NAME
fi