(capfile)
Uses Tshark or Pyrit to strip all non-handshake packets from a .cap file
        File in location 'capfile' is overwritten!
Uses Tshark or Pyrit to strip all non-handshake packets from a .cap file
        File in location 'capfile' is overwritten!
Uses Tshark or Pyrit to strip all non - handshake packets from a . cap file File in location capfile is overwritten!
def strip_handshake(capfile):
    """
        Uses Tshark or Pyrit to strip all non-handshake packets from a .cap file
        File in location 'capfile' is overwritten!
    """
    output_file = capfile
    if program_exists('pyrit'):
        cmd = ['pyrit',
             '-r', capfile,
             '-o', output_file,
             'strip']
        call(cmd,stdout=DN, stderr=DN)
        
    elif program_exists('tshark'):
        # strip results with tshark
        cmd = ['tshark',
               '-r', capfile,      # input file
               '-R', 'eapol || wlan_mgt.tag.interpretation', # filter
               '-w', capfile + '.temp'] # output file
        proc_strip = call(cmd, stdout=DN, stderr=DN)
        
        rename(capfile + '.temp', output_file)
        
    else:
        print R+" [!]"+O+" unable to strip .cap file: neither pyrit nor tshark were found"+W
def strip_handshake ( capfile ) : output_file = capfile if program_exists ( 'pyrit' ) : cmd = [ 'pyrit' , '-r' , capfile , '-o' , output_file , 'strip' ] call ( cmd , stdout = DN , stderr = DN ) elif program_exists ( 'tshark' ) : # strip results with tshark cmd = [ 'tshark' , '-r' , capfile , # input file '-R' , 'eapol || wlan_mgt.tag.interpretation' , # filter '-w' , capfile + '.temp' ] # output file proc_strip = call ( cmd , stdout = DN , stderr = DN ) rename ( capfile + '.temp' , output_file ) else : print R + " [!]" + O + " unable to strip .cap file: neither pyrit nor tshark were found" + W