def get_wps_aps(self):
    """
    Enumerates any WPS-active APs
    Goes to get_reaver_info
    """

    print INFO + "Enumerating WPS-active APs..."
    cmd = 'airodump-ng -c 1-11 --wps %s' %(c.IFACE_MON)
    if CHANNEL != '':
      cmd = 'airodump-ng -c %d --wps %s' %(CHANNEL, c.IFACE_MON)
    output = engine.run(cmd, shell = True, timeout = AIRODUMP_TIME, airodump = True)
    ap_list = engine.parse_airodump(output)
    last = len(ap_list)-1
    
    if ap_list == []:
      print
      print ALERT + "No WPS-active APs were found."
      print
      if not FOREVER:
	engine.exit_clean()
    else:
      for_fill = ap_list                                                #\
      essids = []                                                       #|
      for line in for_fill:                                             #|- Formats the list
	line = line.split('|')                                          #|
	essids.append(line[5])                                          #|
      fill = len(max(essids))                                           #/
      print INFO + "The following WPS-active APs were found:"
      for line in ap_list:
	line = line.split('|')
	fill_line = fill - len(line[5])
	print '\t' + INPUT + str(line[5]) + ' '*fill_line + ' || ' + line[0] + ' || Channel: ' + line[1] + ' || RSSI: ' + line[2] + ' || WPS: ' + line[4]
      while True:
	try:
	  if len(ap_list) != 1 and PROMPT_APS: 
	    choice = raw_input("%sIndex of the AP or press ENTER to choose all of them: " %INPUT)
	    if choice == '':
	      break
	    else:
	      choice = int(choice)
	      temp = []
	      temp.append(ap_list[choice])
	      ap_list = temp
	      break
	  else:
	    break
	except __HOLE__:
	  print
	  engine.exit_clean()
	  break
	except (ValueError, IndexError):
	  print ALERT + "Number between 0 and %d" %last
      if path.isfile('pyxiewpsdata.txt'):
	match = []
	wpspin = []
	with open('pyxiewpsdata.txt') as f:
	  already_found_pins = f.readlines()
	if len(already_found_pins) > 1:
	  already_found_pins.reverse()  # reverts the list so it takes the newest pin
	  for target in ap_list: # if any pin were changed by the AP administrator
	    for line in already_found_pins[1:]:
	      if target.split('|')[5] == line.strip():
		match.append(target)
		wpspin.append(already_found_pins[already_found_pins.index(line)-1].strip())
	  for i in set(match):
	    print OPTION + "The %s pin was already found!" %i.split('|')[5]
	    print '\t'+ INPUT + wpspin[match.index(i)]
	    if not OVERRIDE:
	      print INFO + "Will attack again as requested."
	      print
	    else:
	      print INFO + "Skiped forever."
	      ap_list.remove(i) # Removed from the AP list
	      blacklist.append(i[:17])
	      print
      for line in ap_list: # main for-loop
	line = line.split('|')
	self.get_reaver_info(line[0],line[1],line[5])
	print SEPARATOR
      if not FOREVER:
	engine.exit_clean()
dataset/ETHPy150Open jgilhutton/pyxiewps_WPShack-Python/pyxiewps-EN.py/Attack.get_wps_aps