def enable_monitor_mode(iface):
 global RUN_CONFIG
 print (((GR + ' [+]') + W) + (' enabling monitor mode on %s...' % ((G + iface) + W))),
 stdout.flush()
 call(['airmon-ng', 'start', iface], stdout=DN, stderr=DN)
 print 'done'
 RUN_CONFIG.IFACE_TO_TAKE_DOWN = get_iface()
 if (RUN_CONFIG.TX_POWER > 0):
  print (((GR + ' [+]') + W) + (' setting Tx power to %s%s%s...' % (G, RUN_CONFIG.TX_POWER, W))),
  call(['iw', 'reg', 'set', 'BO'], stdout=OUTLOG, stderr=ERRLOG)
  call(['iwconfig', iface, 'txpower', RUN_CONFIG.TX_POWER], stdout=OUTLOG, stderr=ERRLOG)
  print 'done'
 return RUN_CONFIG.IFACE_TO_TAKE_DOWN

def enable_monitor_mode ( iface ) : global RUN_CONFIG print ( ( ( GR + ' [+]' ) + W ) + ( ' enabling monitor mode on %s...' % ( ( G + iface ) + W ) ) ) , stdout . flush ( ) call ( [ 'airmon-ng' , 'start' , iface ] , stdout = DN , stderr = DN ) print 'done' RUN_CONFIG . IFACE_TO_TAKE_DOWN = get_iface ( ) if ( RUN_CONFIG . TX_POWER > 0 ) : print ( ( ( GR + ' [+]' ) + W ) + ( ' setting Tx power to %s%s%s...' % ( G , RUN_CONFIG . TX_POWER , W ) ) ) , call ( [ 'iw' , 'reg' , 'set' , 'BO' ] , stdout = OUTLOG , stderr = ERRLOG ) call ( [ 'iwconfig' , iface , 'txpower' , RUN_CONFIG . TX_POWER ] , stdout = OUTLOG , stderr = ERRLOG ) print 'done' return RUN_CONFIG . IFACE_TO_TAKE_DOWN
uses airmon-ng to put a device into monitor mode .