Jump to content

neotrix

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by neotrix

  1. The -rW version was a modification to the original -r1 script made to get it to run within OpenWRT. Looking at the differences between -r1 and -rW I don't see anything there that would account for it not being able to find the interface.

    There was however also a -r2 version posted by repzeroworld which is almost twice as long. Maybe it works better in pointing out what the actual problem might be?

    See this post by repzeroworld for the -r2 version of the script.

    Edit:

    Looked closer at the actual script and the -r2 won't change anything since the check performed is identical.

    The command the script uses to verify the interface is this:

    read -p "Which wireless interface you will be using? e.g wlan1, wlan2 etc": WLAN;
    EXISTENCE_OF_WLAN=`airmon-ng|grep ''"$WLAN"|cut -f1`;
    while [   -z "$WLAN" -o "$EXISTENCE_OF_WLAN" != "$WLAN" ]; do
        echo -e "\e[31m\e[1mYou input a wireless interface that doesn't exist!\e[0m";
        echo ;
        read -p "Which wireless interface you will be using? e.g wlan1, wlan2 etc": WLAN;
        EXISTENCE_OF_WLAN=`airmon-ng|grep ''"$WLAN"|cut -f1`;
    done

    And as a quick aside, this would've been a cleaner version of that code:

    while true
    do      read -p "Which wireless interface you will be using? e.g wlan1, wlan2 etc": WLAN
    
            EXISTENCE_OF_WLAN=`airmon-ng|grep ''"$WLAN"|cut -f1`
    
            if [  -z "$WLAN" -o "$EXISTENCE_OF_WLAN" != "$WLAN" ]
            then    echo -e "\e[31m\e[1mYou input a wireless interface that doesn't exist!\e[0m"
            else    break
            fi
    done

    As you can see, the core check performed here is that the "EXISTENCE_OF_WLAN" variable needs to end up being identical to the value in "WLAN" which is the input you provided.

    EXISTENCE_OF_WLAN gets it value from this command:

    airmon-ng|grep ''"$WLAN"|cut -f1

    Where, again, $WLAN is the interface name you entered.

    The first part is just invoking airmon-ng without parameters. I don't have it installed here, but according to the documentation here it simply outputs a list of wireless interfaces it knows about. Take a good look at the output for that usage example - there are a number of columns, the first being "PHY" and the second being "Interface". This output is passed on to the grep program which filters out all lines that don't contain the interface you provided, so if you provided an existing interface you should get just that one line with several columns, the first being the PHY and the second the interface.

    This single line is then provided to the cut program with a parameter of "-f1" meaning to eliminate everything but the first field. That first field is the PHY and even in the example output it's never identical to the interface. So the problem you're having is that the script isolates the wrong field to compare against.

    The fix is simple - replace "cut -f1" with "cut -f2".

    The cause of this is either that new Kali has a newer airmon-ng which suddenly adds a PHY field to its output which it never did before, or your kernel now supports the PHY interface of devices (it can be config'd out) and airmon-ng dutifully reports it, which is something the script doesn't expect.

    Perfect explanation, thank you very much, it worked.

    thanks

  2. hi masters :)

    sorry to dig this topic, but the script can't recognize my wifi device in mon mode or normal mode, killed all services that can be problematic, no success

    iwconfig:
    eth0 no wireless extensions.
    wlan0 IEEE 802.11bgn Mode:Monitor Frequency:2.447 GHz Tx-Power=20 dBm
    Retry short limit:7 RTS thr:off Fragment thr:off
    Power Management:off
    lo no wireless extensions.
    after script run:
    *****************************************************
    * Welcome: I need to verify your wireless interface *
    ******************************************************
    Which wireless interface you will be using? e.g wlan1, wlan2 etc:wlan0
    You input a wireless interface that doesn't exist!
    any clue?
×
×
  • Create New...