Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: usr/local/bin/start-kismet-ng Bug Fixed!!

  1. #1
    Junior Member drpepperONE's Avatar
    Join Date
    Nov 2007
    Posts
    51

    Thumbs up usr/local/bin/start-kismet-ng Bug Fixed!!

    Hy guyz !!

    I fixed the bugged /usr/local/bin/start-kismet-ng script that it could be start kismet.

    The probelm was that the script uses a wrong order of capturesource variable for kismet.
    I changed the order and the right sintax with coma.

    I also changed a bug name about ksmet driver supported for rt8180 because the script uses the wrong name r8180.

    I tested the new fixed script with atheros, ralink, realtek chipset wifi-cards and it works.

    So what todo??

    U must add the following code at the end of the script:

    find lines :

    eval "/usr/local/sbin/airmon-ng start $iface"
    sleep 2


    and add following code:

    Code:
    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}'`
    
            if [ $DRP_DRIVER_NAME = "r8180" ]
    
                    then
    
                            DRP_DRIVER_NAME=rt8180
    
                    fi
            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}'`
    
    if [ $DRP_DRIVER_NAME = "r8180" ]
    
            then
                    #
                    #
                    DRP_DRIVER_NAME=rt8180
    
            fi
    
    konsole -e kismet -c $DRP_DRIVER_NAME,$DRP_DEVICE_NAME,$DRP_DRIVER_NAME
    fi
    Remove the "konsole -e kismet" final line in the original script.

    I wish that it could be help someone.!!

    Byezzzzzz by drpepperONE.
    Use your Brain, don't be slave!!!!

  2. #2
    Senior Member PrairieFire's Avatar
    Join Date
    Apr 2007
    Posts
    705

    Default

    Tested and could be considered a partial fix. Failure to append correct source=driver,interface,name to /usr/local/etc/kismet.conf still exists though.
    Μολὼν λαβέ - Great spirits encounter heavy opposition from mediocre minds.

  3. #3
    Junior Member drpepperONE's Avatar
    Join Date
    Nov 2007
    Posts
    51

    Default

    Quote Originally Posted by PrairieFire View Post
    Tested and could be considered a partial fix. Failure to append correct source=driver,interface,name to /usr/local/etc/kismet.conf still exists though.
    Hi...the goal of the start-kismet-ng script is to launch kismet without configure kismet.conf.
    Infact I changed for this reason.
    So I had share my work with your wonderful community!!

    Your are THE BEST!!!!!!
    Use your Brain, don't be slave!!!!

  4. #4
    Developer
    Join Date
    Mar 2007
    Posts
    6,124

    Default

    Although I appreciate the input to bt3 and by no means want to discourage you I don't consider this a fix. In my opinion the correct protocol for kismet is to edit the .conf file with your interface and then start kismet from the command line like this.
    bt~#kismet
    and it will start right up. I personally edit my kde menu to reflect that and not the script however if this helps some people I'm glad.

  5. #5
    Junior Member drpepperONE's Avatar
    Join Date
    Nov 2007
    Posts
    51

    Default

    Quote Originally Posted by pureh@te View Post
    Although I appreciate the input to bt3 and by no means want to discourage you I don't consider this a fix. In my opinion the correct protocol for kismet is to edit the .conf file with your interface and then start kismet from the command line like this.
    bt~#kismet
    and it will start right up. I personally edit my kde menu to reflect that and not the script however if this helps some people I'm glad.
    Hi pureh@te, I changed and fixed the start-kismet-ng script because it's the default script item that its' launched by BT3 beta official default menu.

    The aim of the start-kismet-ng script is to auto-configure kismet for the most popular wirless chipset cards.

    I agree with u, that for some special and particural wireless cards, we must configure the kismet.conf.


    In the previus BT2 final i used always the default menu used to start kismet that have the same script (start-kismet-ng) and it always worked fine with differets cards.


    So I think that what I did it's only a little workaround
    Use your Brain, don't be slave!!!!

  6. #6
    Senior Member PrairieFire's Avatar
    Join Date
    Apr 2007
    Posts
    705

    Default

    Noted as possible fix rt8180, start-kismet-ng still fails on madwifi, hostap, iwlwifi, ipwraw,......
    Μολὼν λαβέ - Great spirits encounter heavy opposition from mediocre minds.

  7. #7
    Junior Member drpepperONE's Avatar
    Join Date
    Nov 2007
    Posts
    51

    Default

    Quote Originally Posted by PrairieFire View Post
    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
    Use your Brain, don't be slave!!!!

  8. #8
    Developer
    Join Date
    Mar 2007
    Posts
    6,124

    Default

    Will test this out later unless PrairieFire see's it first then maybe he will

  9. #9
    Just burned his ISO
    Join Date
    Dec 2007
    Posts
    9

    Default

    thank you. it works

  10. #10
    Senior Member
    Join Date
    Jan 2006
    Posts
    1,334

    Default

    Nice one - I'll give it a try too.....

    I always liked the auto-config feature - saves a lot of time/hassle when changing cards alot

    EDIT:

    Works with eeepc built-in Atheros and Alfa AWUS036H RTL 8187

    When I put the revised script onto a "normal" laptop (pc-card slot) in a while, I'll test with most other chipsets too

    Nice one drpepperONE

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •