airmon.sh
上传用户:fubang
上传日期:2009-06-18
资源大小:2071k
文件大小:9k
- #!/bin/sh
- KISMET=/etc/kismet/kismet.conf
- CH=$3; [ x$3 = "x" ] && CH=10
- echo -e "nusage: $0 <start|stop> <interface> [channel]n"
- echo -e "InterfacetChipsetttDrivern"
- for iface in `iwconfig 2>/dev/null | egrep '(IEEE|ESSID)' | cut -b 1-7`
- do
- if [ x"`echo $iface | cut -b 1-4`" = "xwifi" ]
- then
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep force_reset`" != "x" ]
- then
- echo -e -n "$ifacettHermesIttorinoco"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=orinoco,$iface,HermesI" >>$KISMET
- iwconfig $iface mode Monitor channel $CH &>/dev/null
- iwpriv $iface monitor 1 $CH &>/dev/null
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwpriv $iface monitor 0 &>/dev/null
- iwconfig $iface mode Managed &>/dev/null
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep get_power`" != "x" ]
- then
- echo -e -n "$ifacettCentrino btipw2100"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=ipw2100,$iface,Centrino_b" >>$KISMET
- iwconfig $iface mode Monitor channel $CH
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwconfig $iface mode Managed
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep sw_reset`" != "x" ]
- then
- echo -e -n "$ifacettCentrino b/gtipw2200"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=ipw2200,$iface,Centrino_g" >>$KISMET
- iwconfig $iface mode Monitor channel $CH
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwconfig $iface mode Managed
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep inact_auth`" != "x" ]
- then
- echo -e -n "$ifacettAtherosttmadwifi"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=madwifi_g,$iface,Atheros" >>$KISMET
- iwconfig $iface mode Monitor channel $CH
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwconfig $iface mode Managed
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep extrates`" != "x" ]
- then
- echo -e -n "$ifacettPrismGTttprism54"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=prism54g,$iface,Prism54" >>$KISMET
- ifconfig $iface up
- iwconfig $iface mode Monitor channel $CH
- iwpriv $iface set_prismhdr 1 &>/dev/null
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwconfig $iface mode Managed
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep antsel_rx`" != "x" ]
- then
- echo -e -n "$ifacettPrism2ttHostAP"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=hostap,$iface,Prism2" >>$KISMET
- iwconfig $iface mode Monitor channel $CH
- iwpriv $iface monitor_type 1 &>/dev/null
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwconfig $iface mode Managed
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`wlancfg show $iface 2>/dev/null | grep p2CnfWEPFlags`" != "x" ]
- then
- echo -e -n "$ifacettPrism2ttwlan-ng"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=wlanng,$iface,Prism2" >>$KISMET
- wlanctl-ng $iface lnxreq_ifstate ifstate=enable >/dev/null
- wlanctl-ng $iface lnxreq_wlansniff enable=true channel=$CH
- prismheader=true wlanheader=false
- stripfcs=true keepwepflags=true >/dev/null
- echo p2CnfWEPFlags=0,4,7 | wlancfg set $iface
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- wlanctl-ng $iface lnxreq_wlansniff enable=false >/dev/null
- wlanctl-ng $iface lnxreq_ifstate ifstate=disable >/dev/null
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep bbp`" != "x" ]
- then
- echo -e -n "$ifacettRalink b/gtrt2500"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=rt2500,$iface,Ralink_g" >>$KISMET
- iwconfig $iface mode Monitor channel $CH
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwconfig $iface mode Managed
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep wpapsk`" != "x" ]
- then
- echo -e -n "$ifacettRalink USBtrt2570"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=rt2500,$iface,Ralink_g" >>$KISMET
- iwconfig $iface mode Monitor channel $CH
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwconfig $iface mode Managed
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep debugtx`" != "x" ]
- then
- echo -e -n "$ifacettRTL8180ttr8180"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=rt8180,$iface,Realtek" >>$KISMET
- iwconfig $iface mode Monitor channel $CH
- iwpriv $iface prismhdr 1 &>/dev/null
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwconfig $iface mode Managed
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep dbg_flag`" != "x" ]
- then
- echo -e -n "$ifacettZyDASttzd1211"
- if [ x$1 = "xstart" ] && [ x$2 = x$iface ]
- then
- cp $KISMET~ $KISMET 2>/dev/null &&
- echo "source=wlanng_legacy,$iface,ZyDAS" >>$KISMET
- iwconfig $iface mode Monitor channel $CH
- ifconfig $iface up
- echo -n " (monitor mode enabled)"
- fi
- if [ x$1 = "xstop" ] && [ x$2 = x$iface ]
- then
- ifconfig $iface down
- iwconfig $iface mode Managed
- echo -n " (monitor mode disabled)"
- fi
- echo
- continue
- fi
- if [ x"`iwpriv $iface 2>/dev/null | grep power_profile`" != "x" ]
- then
- echo -e -n "$ifacettUnknownttndiswrapper"
- if [ x$2 = x$iface ]
- then
- echo -n " (MONITOR MODE NOT SUPPORTED)"
- fi
- echo
- continue
- fi
- echo "$ifacettUnknownttUnknown (MONITOR MODE NOT SUPPORTED)"
- done
- echo