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'):
  cmd = ['tshark', '-r', capfile, '-R', 'eapol || wlan_mgt.tag.interpretation', '-w', (capfile + '.temp')]
  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' ) : cmd = [ 'tshark' , '-r' , capfile , '-R' , 'eapol || wlan_mgt.tag.interpretation' , '-w' , ( capfile + '.temp' ) ] 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 )
uses tshark or pyrit to strip all non-handshake packets from a .