Ejemplo n.º 1
0
def export_worker(collection_num, shard):
    import export
    export.main((None, collection_num,
                 join(
                     PROJECT_PATH,
                     'data',
                     'export',
                     '{}-{}'.format(collection_num, shard))))
Ejemplo n.º 2
0
 def exploit():
     if module == "":
         print colors.RD + "No module selected, please try again.\n" + colors.NRM
         menu_actions['main_menu']()
     else:
         try:
             if module in ['Hidden SSID']:
                 d = queries()
                 d.db_connect(workspace)
                 Discover_Hidden_SSID.main(workspace)
             if module in ['AP Hunter']:
                 d = queries()
                 d.db_connect(workspace)
                 AP_Hunter.main(workspace)
             if module in ['Exporter']:
                 d = queries()
                 d.db_connect(workspace)
                 export.main(workspace, list1['Path'], name)
             if module in ['Evil Twin']:
                 if list1['SSID'] and list1['Channel'] and list1[
                         'Interface'] and list1['Type']:
                     if list1['Type'] == "GTC":
                         args = ' -s "' + list1['SSID'] + '" -c ' + list1[
                             'Channel'] + ' -a \'Evil Twin\' -w ' + list1[
                                 'WPA'] + ' -i ' + list1[
                                     'Interface'] + ' -g ' + list1[
                                         'Type'] + ' -d ' + workspace + ''
                     else:
                         args = ' -s "' + list1['SSID'] + '" -c ' + list1[
                             'Channel'] + ' -a \'Evil Twin\' -w ' + list1[
                                 'WPA'] + ' -i ' + list1[
                                     'Interface'] + ' -d ' + workspace + ''
                     os.system('python module/hostapd.py' + args + '')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Captive Portal']:
                 if list1['SSID'] and list1['Channel'] and list1[
                         'Interface']:
                     args = ' -s "' + list1['SSID'] + '" -c ' + list1[
                         'Channel'] + ' -a \'Captive Portal\' -i ' + list1[
                             'Interface'] + ' -d ' + workspace + ''
                     os.system('python module/hostapd.py' + args + '')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Auto EAP']:
                 if list1['SSID'] and list1['Key_Management'] and list1[
                         'Encryption'] and list1['Password'] and list1[
                             'Interface']:
                     if not list1['Username_File']:
                         args = ' -s "' + list1['SSID'] + '" -K ' + list1[
                             'Key_Management'] + ' -E ' + list1[
                                 'Encryption'] + ' -W ' + workspace + ' -p ' + list1[
                                     'Password'] + ' -i ' + list1[
                                         'Interface']
                     else:
                         args = ' -s "' + list1['SSID'] + '" -K ' + list1[
                             'Key_Management'] + ' -E ' + list1[
                                 'Encryption'] + ' -U ' + list1[
                                     'Username_File'] + ' -p ' + list1[
                                         'Password'] + ' -i ' + list1[
                                             'Interface'] + ' -W ' + workspace + ''
                     os.system('cd module/Auto_EAP/ && python Auto_EAP.py' +
                               args + '&& cd ../../')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Certificate Generator']:
                 if list1['Country'] and list1['StateProvince'] and list1[
                         'City'] and list1['Client'] and list1[
                             'Email'] and list1['CommonName'] and list1[
                                 'ServerCommonName']:
                     args = ' -c ' + list1['Country'] + ' -s ' + list1[
                         'StateProvince'] + ' -l ' + list1[
                             'City'] + ' -o "' + list1[
                                 'Client'] + '" -e ' + list1[
                                     'Email'] + ' -n ' + list1[
                                         'CommonName'] + ' -r ' + list1[
                                             'ServerCommonName']
                     os.system('python module/hostapd-wpe/certs/cert.py ' +
                               args + '')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Auto PSK']:
                 if list1['SSID'] and list1['PasswordFile'] and list1[
                         'Interface']:
                     args = ' -s "' + list1[
                         'SSID'] + '" -W ' + workspace + ' -P ' + list1[
                             'PasswordFile'] + ' -i ' + list1['Interface']
                     os.system('cd module/Auto_EAP/ && python Auto_PSK.py' +
                               args + '&& cd ../../')
                 else:
                     print "Error: Invalid or Missing Arguements"
         except KeyboardInterrupt:
             pass
     choice()
     exec_menu(choice)
     return
Ejemplo n.º 3
0
          'cluster \t... group similar faces into clusters\n'
          'train \t\t... train face recognition using faces in folders\n'
          'show \t\t... show face recognition results\n'
          'export \t\t... export face recognition results\n')


if __name__ == "__main__":

    if len(sys.argv) == 1:
        print_help()
        exit()

    task = sys.argv[1]
    sys.argv.pop(1)

    if task == '--help' or task == 'help' or task == '-h':
        print_help()
    elif task == 'detect':
        detect.main()
    elif task == 'predict':
        predict.main()
    elif task == 'cluster':
        cluster.main()
    elif task == 'train':
        train.main()
    elif task == 'show':
        show.main()
    elif task == 'export':
        export.main()
    else:
        print_help()
Ejemplo n.º 4
0
    def exploit():
        if module == "":
            print colors.RD + "No module selected, please try again.\n" + colors.NRM
            menu_actions['main_menu']()
            global p  ###?what isthis?
        else:
            try:
                if module in ['Hidden SSID']:
                    d = queries()
                    d.db_connect(workspace)
                    Discover_Hidden_SSID.main(workspace)

                if module in ['Exporter']:
                    d = queries()
                    d.db_connect(workspace)
                    export.main(workspace, list1['Path'], name)
                if module in ['Evil Twin']:
                    if list1['SSID'] and list1['Channel'] and list1[
                            'Interface']:
                        args = ' -s ' + list1['SSID'] + ' -c ' + list1[
                            'Channel'] + ' -a \'Evil Twin\' -w ' + list1[
                                'WPA'] + ' -i ' + list1[
                                    'Interface'] + ' -d ' + workspace + ''
                        os.system('python module/hostapd.py' + args + '')
                    else:
                        print "Error: Invalid or Missing Arguements"
                if module in ['Captive Portal']:
                    if list1['SSID'] and list1['Channel'] and list1[
                            'Interface']:
                        args = ' -s ' + list1['SSID'] + ' -c ' + list1[
                            'Channel'] + ' -a \'Captive Portal\' -i ' + list1[
                                'Interface'] + ' -d ' + workspace + ''
                        os.system('python module/hostapd.py' + args + '')
                    else:
                        print "Error: Invalid or Missing Arguements"
                if module in ['Auto EAP']:
                    if list1['SSID'] and list1['Key_Management'] and list1[
                            'Encryption'] and list1['Password'] and list1[
                                'Interface']:
                        if not list1['Username_File']:
                            args = ' -s ' + list1['SSID'] + ' -K ' + list1[
                                'Key_Management'] + ' -E ' + list1[
                                    'Encryption'] + ' -W ' + workspace + ' -p ' + list1[
                                        'Password'] + ' -i ' + list1[
                                            'Interface']
                        else:
                            args = ' -s ' + list1['SSID'] + ' -K ' + list1[
                                'Key_Management'] + ' -E ' + list1[
                                    'Encryption'] + ' -U ' + list1[
                                        'Username_File'] + ' -p ' + list1[
                                            'Password'] + ' -i ' + list1[
                                                'Interface'] + ' -W ' + workspace + ''
                        os.system('cd module/Auto_EAP/ && python Auto_EAP.py' +
                                  args + '&& cd ../../')
                    else:
                        print "Error: Invalid or Missing Arguements"
            except KeyboardInterrupt:
                pass
        choice()
        exec_menu(choice)
        return
Ejemplo n.º 5
0
 def exploit():
     if module == "":
         print colors.RD + "No module selected, please try again.\n" + colors.NRM
         menu_actions['main_menu']()
     else:
         try:
             if module in ['Hidden SSID']:
                 d = queries()
                 d.db_connect(workspace)
                 Discover_Hidden_SSID.main(workspace)
             if module in ['AP Hunter']:
                 d = queries()
                 d.db_connect(workspace)
                 AP_Hunter.main(workspace)
             if module in ['Exporter']:
                 d = queries()
                 d.db_connect(workspace)
                 export.main(workspace, list1['Path'], name)
             if module in ['Evil Twin']:
                 if list1['SSID'] and list1['Channel'] and list1[
                         'Interface'] and list1['Type']:
                     if list1['Type'] == "GTC":
                         args = ' -s "' + list1['SSID'] + '" -c ' + list1[
                             'Channel'] + ' -a \'Evil Twin\' -w ' + list1[
                                 'WPA'] + ' -i ' + list1[
                                     'Interface'] + ' -g ' + list1[
                                         'Type'] + ' -d ' + workspace + ''
                     else:
                         args = ' -s "' + list1['SSID'] + '" -c ' + list1[
                             'Channel'] + ' -a \'Evil Twin\' -w ' + list1[
                                 'WPA'] + ' -i ' + list1[
                                     'Interface'] + ' -d ' + workspace + ''
                     os.system('python module/hostapd.py' + args + '')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Captive Portal']:
                 if list1['SSID'] and list1['Channel'] and list1[
                         'Interface']:
                     args = ' -s "' + list1['SSID'] + '" -c ' + list1[
                         'Channel'] + ' -a \'Captive Portal\' -i ' + list1[
                             'Interface'] + ' -d ' + workspace + ''
                     os.system('python module/hostapd.py' + args + '')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Auto EAP']:
                 if list1['SSID'] and list1['Key_Management'] and list1[
                         'Encryption'] and list1['Password'] and list1[
                             'Interface']:
                     if not list1['Username_File']:
                         args = ' -s "' + list1['SSID'] + '" -K ' + list1[
                             'Key_Management'] + ' -E ' + list1[
                                 'Encryption'] + ' -W ' + workspace + ' -p ' + list1[
                                     'Password'] + ' -i ' + list1[
                                         'Interface']
                     else:
                         print list1['Password']
                         args = ' -s "' + list1['SSID'] + '" -K ' + list1[
                             'Key_Management'] + ' -E ' + list1[
                                 'Encryption'] + ' -U ' + list1[
                                     'Username_File'] + ' -p \'' + list1[
                                         'Password'] + '\' -i ' + list1[
                                             'Interface'] + ' -W ' + workspace + ''
                         print args
                     os.system('cd module/Auto_EAP/ && python Auto_EAP.py' +
                               args + '&& cd ../../')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Certificate Generator']:
                 if list1['Country'] and list1['StateProvince'] and list1[
                         'City'] and list1['Client'] and list1[
                             'Email'] and list1['CommonName'] and list1[
                                 'ServerCommonName']:
                     args = ' -c ' + list1['Country'] + ' -s ' + list1[
                         'StateProvince'] + ' -l ' + list1[
                             'City'] + ' -o "' + list1[
                                 'Client'] + '" -e ' + list1[
                                     'Email'] + ' -n ' + list1[
                                         'CommonName'] + ' -r ' + list1[
                                             'ServerCommonName']
                     os.system('python module/hostapd-wpe/certs/cert.py ' +
                               args + '')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Auto PSK']:
                 if list1['SSID'] and list1['PasswordFile'] and list1[
                         'Interface']:
                     args = ' -s "' + list1[
                         'SSID'] + '" -W ' + workspace + ' -P \'' + list1[
                             'PasswordFile'] + '\' -i ' + list1['Interface']
                     os.system('cd module/Auto_EAP/ && python Auto_PSK.py' +
                               args + '&& cd ../../')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Handshaker']:
                 if list1['Format']:
                     if list1['SSID']:
                         ssid_args = ' -s ' + list1['SSID']
                     else:
                         ssid_args = ""
                     if list1['Path']:
                         path_args = ' -p ' + list1['Path']
                     else:
                         path_args = ""
                     if list1['InputFile']:
                         IF_args = ' -I ' + list1['InputFile']
                     else:
                         IF_args = ""
                     args = ' -w ' + workspace + ' -f ' + list1[
                         'Format'] + ssid_args + path_args + IF_args
                     os.system(
                         'cd module/Handshaker/ && python Handshaker.py' +
                         args + '&& cd ../../')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['MAC Changer']:
                 if list1['MAC'] and list1['Interface']:
                     args = ' -I ' + list1['Interface'] + ' -M ' + list1[
                         'MAC']
                     os.system('cd module/ && python MAC_Changer.py' +
                               args + '&& cd ../../')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Proof Packet']:
                 if workspace == "default":
                     print "Error: Invalid or Missing Arguements"
                     return
                 else:
                     args = ' -W ' + str(workspace)
                 if list1['SSID']:
                     args = args + ' -S ' + list1['SSID']
                 else:
                     print "Error: Invalid or Missing Arguements"
                     return
                 if list1['Path']:
                     args = args + ' -P ' + list1['Path']
                     os.system('cd module/ && python proof_packet.py' +
                               args + '&& cd ../../')
                 else:
                     os.system('cd module/ && python proof_packet.py' +
                               args + '&& cd ../../')
             if module in ['Probe Packet']:
                 args = ' -i ' + list1['Interface'] + ' -d ' + list1[
                     'Delay'] + ' -c ' + list1['Count']
                 if list1['MAC']:
                     args = args + ' -m ' + list1['MAC']
                 else:
                     print "Error: Invalid or Missing Arguements"
                     return
                 if list1['SSID']:
                     args = args + ' -s ' + list1['SSID']
                     os.system('cd module/ && python Probe_Packet.py' +
                               args + '&& cd ../../')
                 elif list1['SSID File']:
                     args = args + ' -f ' + list1['InputFile']
                     os.system('cd module/ && python Probe_Packet.py' +
                               args + '&& cd ../../')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Wigle Search SSID']:
                 args = ''
                 if list1['APIName'] and list1['APIToken'] and list1['SSID']:
                     args = ' ' + list1['APIName'] + ' ' + list1[
                         'APIToken'] + ' ' + list1['SSID']
                     os.system('cd module/ && python wigleSearchESSID.py' +
                               args + '&& cd ../../')
                 else:
                     print "Error: Invalid or Missing Arguements"
             if module in ['Wigle Search MAC']:
                 args = ''
                 if list1['APIName'] and list1['APIToken'] and list1['MAC']:
                     args = ' ' + list1['APIName'] + ' ' + list1[
                         'APIToken'] + ' ' + list1['MAC']
                     os.system('cd module/ && python wigleSearchBSSID.py' +
                               args + '&& cd ../../')
                 else:
                     print "Error: Invalid or Missing Arguements"
         except KeyboardInterrupt:
             pass
     choice()
     exec_menu(choice)
     return