def has_handshake_pyrit(target, capfile):
 if (not program_exists('pyrit')):
  return False
 cmd = ['pyrit', '-r', capfile, 'analyze']
 proc = Popen(cmd, stdout=PIPE, stderr=DN)
 proc.wait()
 hit_essid = False
 for line in proc.communicate()[0].split('\n'):
  if ((line == '') or (line == None)):
   continue
  if (line.find('AccessPoint') != (-1)):
   hit_essid = ((line.find((("('" + target.ssid) + "')")) != (-1)) and (line.lower().find(target.bssid.lower()) != (-1)))
  elif (hit_essid and ((line.find(', good, ') != (-1)) or (line.find(', workable, ') != (-1)))):
   return True
 return False

def has_handshake_pyrit ( target , capfile ) : if ( not program_exists ( 'pyrit' ) ) : return False cmd = [ 'pyrit' , '-r' , capfile , 'analyze' ] proc = Popen ( cmd , stdout = PIPE , stderr = DN ) proc . wait ( ) hit_essid = False for line in proc . communicate ( ) [ 0 ] . split ( '\n' ) : if ( ( line == '' ) or ( line == None ) ) : continue if ( line . find ( 'AccessPoint' ) != ( - 1 ) ) : hit_essid = ( ( line . find ( ( ( "('" + target . ssid ) + "')" ) ) != ( - 1 ) ) and ( line . lower ( ) . find ( target . bssid . lower ( ) ) != ( - 1 ) ) ) elif ( hit_essid and ( ( line . find ( ', good, ' ) != ( - 1 ) ) or ( line . find ( ', workable, ' ) != ( - 1 ) ) ) ) : return True return False
uses pyrit to check for a handshake .