(bssid, capfile)
return ''
Attempts to get ESSID from cap file using BSSID as reference.
        Returns '' if not found.
Attempts to get ESSID from cap file using BSSID as reference.
        Returns '' if not found.
Attempts to get ESSID from cap file using BSSID as reference . Returns if not found .
def get_essid_from_cap(bssid, capfile):
    """
        Attempts to get ESSID from cap file using BSSID as reference.
        Returns '' if not found.
    """
    if not program_exists('tshark'): return ''

    cmd = ['tshark',
           '-r', capfile,
           '-R', 'wlan.fc.type_subtype == 0x05 && wlan.sa == %s' % bssid,
           '-n']
    proc = Popen(cmd, stdout=PIPE, stderr=DN)
    proc.wait()
    for line in proc.communicate()[0].split('\n'):
        if line.find('SSID=') != -1:
            essid = line[line.find('SSID=')+5:]
            print GR+' [+]'+W+' guessed essid: %s' % (G+essid+W)
            return essid
    print R+' [!]'+O+' unable to guess essid!'+W
    return ''
def get_essid_from_cap ( bssid , capfile ) : if not program_exists ( 'tshark' ) : return '' cmd = [ 'tshark' , '-r' , capfile , '-R' , 'wlan.fc.type_subtype == 0x05 && wlan.sa == %s' % bssid , '-n' ] proc = Popen ( cmd , stdout = PIPE , stderr = DN ) proc . wait ( ) for line in proc . communicate ( ) [ 0 ] . split ( '\n' ) : if line . find ( 'SSID=' ) != - 1 : essid = line [ line . find ( 'SSID=' ) + 5 : ] print GR + ' [+]' + W + ' guessed essid: %s' % ( G + essid + W ) return essid print R + ' [!]' + O + ' unable to guess essid!' + W return ''