v1s1t0r1sh3r3 / airgeddon

This is a multi-use bash script for Linux systems to audit wireless networks.
GNU General Public License v3.0
6.51k stars 1.18k forks source link

"There is a problem with the selected interface." error with MT7610U chipset #152

Closed ganjiste closed 6 years ago

ganjiste commented 6 years ago

What is your airgeddon version?

v.8.01

What is your Linux O.S. and which version?

Linux parrot 4.12.0-parrot6-amd64

Which is the chipset of your wireless card?

MediaTek MT7610U (TP-Link archer T2UH)

Describe the issue and the steps to reproduce it

Airgeddon start without issues, but after selecting my wireless card with 3: airgeddon1

I get this message: airgeddon2

Sorry if this is a known issue, I couldnt find any related thread.

v1s1t0r1sh3r3 commented 6 years ago

hhmmmm.... quite strange. This is the funcion which says that error:

function check_interface_mode() {

    debug_print

    current_iface_on_messages="${1}"
    if ! execute_iwconfig_fix "${1}"; then
        ifacemode="(Non wifi card)"
        return 0
    fi

    modemanaged=$(iwconfig "${1}" 2> /dev/null | grep Mode: | cut -d ':' -f 2 | cut -d ' ' -f 1)

    if [[ ${modemanaged} = "Managed" ]]; then
        ifacemode="Managed"
        return 0
    fi

    modemonitor=function check_interface_mode() {

    debug_print

    current_iface_on_messages="${1}"
    if ! execute_iwconfig_fix "${1}"; then
        ifacemode="(Non wifi card)"
        return 0
    fi

    modemanaged=$(iwconfig "${1}" 2> /dev/null | grep Mode: | cut -d ':' -f 2 | cut -d ' ' -f 1)

    if [[ ${modemanaged} = "Managed" ]]; then
        ifacemode="Managed"
        return 0
    fi

    modemonitor=$(iwconfig "${1}" 2> /dev/null | grep Mode: | awk '{print $4}' | cut -d ':' -f 2)

    if [[ ${modemonitor} = "Monitor" ]]; then
        ifacemode="Monitor"
        return 0
    fi

    language_strings "${language}" 23 "red"
    language_strings "${language}" 115 "read"
    exit_code=1
    exit_script_option
}

    if [[ ${modemonitor} = "Monitor" ]]; then
        ifacemode="Monitor"
        return 0
    fi

    language_strings "${language}" 23 "red"
    language_strings "${language}" 115 "read"
    exit_code=1
    exit_script_option
}

What is the output of your command ??? I mean this: $(iwconfig "${1}" 2> /dev/null | grep Mode: | awk '{print $4}' | cut -d ':' -f 2) <- you should substitute ${1} by your interface name "ra0"

And a last question... even with the error... if you after getting it exit the script pressing ctrl+c and press yes... is the interface in monitor mode? What I want to know is if even showing an error the mode is changed or not.

ganjiste commented 6 years ago

This is the output it gives me: iwconfig

After the error the script end itself so I dont even need to press Ctr-C to exit And after quiting the script the adapter is in auto mode. But I can put my adapter in monitor mode manually after.

If this helps this is the driver im using for my adapter: https://github.com/ulli-kroll/mt7610u

v1s1t0r1sh3r3 commented 6 years ago

Quite strange... in your case is taking the wrong column. It should take the "Monitor" or "Managed" word... but is taking the next column. Check this iwconfig output:

imagen

Sorry but I don't have that adapter, so we can't test. We are going to need your help to fix this. Let's start...

  1. What is your wireless_tools package version? To check it, launch iwconfig --version. It should be version 30 if you are using parrot security.
  2. Perform a iwconfig ra0 command in managed mode and put the entire output. A screenshot would be nice.
  3. Change the mode manually to monitor and perform the same operation. iwconfig <yourInterfaceName> in order to see the entire output of iwconfig command.

The command to get managed mode is: iwconfig "${1}" 2> /dev/null | grep Mode: | cut -d ':' -f 2 | cut -d ' ' -f 1 and the command to get monitor mode is iwconfig "${1}" 2> /dev/null | grep Mode: | awk '{print $4}' | cut -d ':' -f 2. They should get "Managed" and "Monitor" as a right result. It seems it is not working fine on your case, so we need the entire output of both modes to check and re-write the commands. We need an "universal" solution to get it working on all adapters.

Maybe we can improve the way to get the right word. Instead of taking column number we can do a regex or something similar. I'll wait your feedback. Thanks.

ganjiste commented 6 years ago

Thanks a lot for your help, here are the requested screenshots: iwconfig version: iwconfigversion my iwconfig for ra0: iwconfigra0

This is the output when I manually switch to monitor mode: monitormode

I tried to switch manually my adapter to managed mode and I got this: managedmode are managed mode and auto the same thing ?

ganjiste commented 6 years ago

Oh sorry I forgot those screenshots: othercommands

v1s1t0r1sh3r3 commented 6 years ago

Hello. "Auto" mode doesn't exist. It must be something custom of your driver. As you can see on the link below, there are only eight existing modes definded in 802.11 standard for wireless cards (managed, monitor, master, adhoc, repeater, mesh, Wi-Fi direct and TDLS).

https://en.wikipedia.org/wiki/Monitor_mode

So I can suggest to you to change your driver. Or maybe you can try to modify airgeddon to adjust the columns that your card is using... but that is a very rare customization that you'll loose on each airgeddon update, so you can disable the auto-update feature using the options menu to keep your customization.

On the given function above, you can try to adjust the column name on awk command awk '{print $x}' where x is the right column name. Launch the command to see the desired column. Then you should try to change "Managed" string to "Auto" on the conditionals... this could be very experimental because right now I can't tell you if you'll get more problems on other parts of the script.

Sorry but there is nothing we can do. We are not going to modify airgeddon to support a non-standard driver. We always look for the "universal" phormula.

ganjiste commented 6 years ago

Thank you I will look further into it, do you know where do I need to look in the driver files to modify the modes ?

v1s1t0r1sh3r3 commented 6 years ago

Sorry, I never modified a driver.