def has_handshake_cowpatty(target, capfile, nonstrict=True):
 if (not program_exists('cowpatty')):
  return False
 cmd = ['cowpatty', '-r', capfile, '-s', target.ssid, '-c']
 if nonstrict:
  cmd.append('-2')
 proc = Popen(cmd, stdout=PIPE, stderr=DN)
 proc.wait()
 response = proc.communicate()[0]
 if (response.find('incomplete four-way handshake exchange') != (-1)):
  return False
 elif (response.find('Unsupported or unrecognized pcap file.') != (-1)):
  return False
 elif (response.find('Unable to open capture file: Success') != (-1)):
  return False
 return True

def has_handshake_cowpatty ( target , capfile , nonstrict = True ) : if ( not program_exists ( 'cowpatty' ) ) : return False cmd = [ 'cowpatty' , '-r' , capfile , '-s' , target . ssid , '-c' ] if nonstrict : cmd . append ( '-2' ) proc = Popen ( cmd , stdout = PIPE , stderr = DN ) proc . wait ( ) response = proc . communicate ( ) [ 0 ] if ( response . find ( 'incomplete four-way handshake exchange' ) != ( - 1 ) ) : return False elif ( response . find ( 'Unsupported or unrecognized pcap file.' ) != ( - 1 ) ) : return False elif ( response . find ( 'Unable to open capture file: Success' ) != ( - 1 ) ) : return False return True
uses cowpatty to check for a handshake .