Fixing whitespace (tabs) on 'baddriver' methods
This commit is contained in:
@@ -62,21 +62,21 @@ class Airmon(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def start_baddriver(iface): #fix for bad drivers like the rtl8812AU
|
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))
|
os.system("ifconfig %s down; iwconfig %s mode monitor; ifconfig %s up" % (iface, iface, iface))
|
||||||
with open("/sys/class/net/" + iface + "/type", "r") as f:
|
with open("/sys/class/net/" + iface + "/type", "r") as f:
|
||||||
if (int(f.read()) == Airmon.ARPHRD_IEEE80211_RADIOTAP):
|
if (int(f.read()) == Airmon.ARPHRD_IEEE80211_RADIOTAP):
|
||||||
return iface
|
return iface
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def stop_baddriver(iface):
|
def stop_baddriver(iface):
|
||||||
os.system("ifconfig %s down; iwconfig %s mode managed; ifconfig %s up" % (iface, iface, 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:
|
with open("/sys/class/net/" + iface + "/type", "r") as f:
|
||||||
if (int(f.read()) == Airmon.ARPHRD_ETHER):
|
if (int(f.read()) == Airmon.ARPHRD_ETHER):
|
||||||
return iface
|
return iface
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def start(iface):
|
def start(iface):
|
||||||
@@ -113,9 +113,10 @@ class Airmon(object):
|
|||||||
|
|
||||||
if mon_iface is None:
|
if mon_iface is None:
|
||||||
# Airmon did not enable monitor mode on an interface
|
# Airmon did not enable monitor mode on an interface
|
||||||
mon_iface = Airmon.start_baddriver(iface)
|
mon_iface = Airmon.start_baddriver(iface)
|
||||||
if mon_iface is None:
|
|
||||||
Color.pl("{R}failed{W}")
|
if mon_iface is None:
|
||||||
|
Color.pl("{R}failed{W}")
|
||||||
|
|
||||||
mon_ifaces = Airmon.get_interfaces_in_monitor_mode()
|
mon_ifaces = Airmon.get_interfaces_in_monitor_mode()
|
||||||
|
|
||||||
@@ -159,7 +160,7 @@ class Airmon(object):
|
|||||||
break
|
break
|
||||||
|
|
||||||
if not mon_iface:
|
if not mon_iface:
|
||||||
mon_iface = Airmon.stop_baddriver(iface)
|
mon_iface = Airmon.stop_baddriver(iface)
|
||||||
|
|
||||||
if mon_iface:
|
if mon_iface:
|
||||||
Color.pl('{R}disabled %s{W}' % mon_iface)
|
Color.pl('{R}disabled %s{W}' % mon_iface)
|
||||||
|
|||||||
Reference in New Issue
Block a user