diff --git a/wifite/tools/airmon.py b/wifite/tools/airmon.py index 53283da..352bd0b 100755 --- a/wifite/tools/airmon.py +++ b/wifite/tools/airmon.py @@ -63,22 +63,18 @@ class Airmon(object): @staticmethod def start_baddriver(iface): #fix for bad drivers like the rtl8812AU os.system("ifconfig %s down; iwconfig %s mode monitor; ifconfig %s up" % (iface, iface, iface)) - #You cannot trust the output of the rtl8812AU - #it says that interface 10 is the monitor interface, it isn't. - #its actually just the same name, but lets not trust it anyway - for x in os.listdir("/sys/class/net/."): - with open("/sys/class/net/" + x + "/type", "r") as f: - if (int(f.read()) == Airmon.ARPHRD_IEEE80211_RADIOTAP): - return x + with open("/sys/class/net/" + iface + "/type", "r") as f: + if (int(f.read()) == Airmon.ARPHRD_IEEE80211_RADIOTAP): + return iface return None @staticmethod def stop_baddriver(iface): os.system("ifconfig %s down; iwconfig %s mode managed; ifconfig %s up" % (iface, iface, iface)) - with open("/sys/class/net/" + iface + "/type", "r") as f: - if (int(f.read()) == Airmon.ARPHRD_ETHER): - return iface + with open("/sys/class/net/" + iface + "/type", "r") as f: + if (int(f.read()) == Airmon.ARPHRD_ETHER): + return iface return None