(channel=None)
return get_monitor_adapter()
Enable monitor mode on the wireless adapter
       CHANNEL is the channel to monitor on.
Enable monitor mode on the wireless adapter
       CHANNEL is the channel to monitor on.
Enable monitor mode on the wireless adapter CHANNEL is the channel to monitor on .
def enable_monitor(channel=None):
    """Enable monitor mode on the wireless adapter
       CHANNEL is the channel to monitor on.
    """
    tmp = init_app('iwconfig', True)
    iface = None
    for line in tmp.split('\n'):
        if line.startswith('wlan'):
            try:
                iface = line.split(' ')[0]
                if channel is None:
                    tmp = getoutput('airmon-ng start {0}'.format(iface))
                else:
                    tmp = getoutput('airmon-ng start {0} {1}'
                                    .format(iface, channel))
                debug("started \'%s\' in monitor mode" % iface)
            except Exception, j:
                Error("Error enabling monitor mode: %s" % j)
            break
    return get_monitor_adapter()
def enable_monitor ( channel = None ) : tmp = init_app ( 'iwconfig' , True ) iface = None for line in tmp . split ( '\n' ) : if line . startswith ( 'wlan' ) : try : iface = line . split ( ' ' ) [ 0 ] if channel is None : tmp = getoutput ( 'airmon-ng start {0}' . format ( iface ) ) else : tmp = getoutput ( 'airmon-ng start {0} {1}' . format ( iface , channel ) ) debug ( "started \'%s\' in monitor mode" % iface ) except Exception , j : Error ( "Error enabling monitor mode: %s" % j ) break return get_monitor_adapter ( )