コード例 #1
0
ファイル: run.py プロジェクト: beejhuff/TestREx
    if (options.mapped_port):
        settings.mapped_port_in = options.mapped_port

    if (options.verbose):
        settings.report_verbosity = "DEBUG"
    else:
        settings.report_verbosity = "INFO"

    if (options.results_filename):
        settings.results_filename = options.results_filename

    if (options.image):
        options.image = os.path.join(settings.configurations_path, options.image)
        if (options.exploit):
            ex.run(options.image, options.exploit)
        elif(options.manual_config):
            ex.run_manual(options.image)
        else:
            if (options.batch_config):
                settings.spoiled_mode = False if (options.image == None) else options.spoiled
                ex.run_batch_single(options.image)
            else:
                print("\nWARNING: Please select a running mode.")
                parser.print_help()
    else:
        if (options.batch_config):
            ex.run_batch()
        else:
            print("\nWARNING: Please select a running mode.")
            parser.print_help()
コード例 #2
0
ファイル: bugbox-run-all.py プロジェクト: beejhuff/TestREx
    for file in bugbox_exploits:
        if file.find(".pyc"):
            bugbox_exploits.remove(file)
    
    bugbox_exploits = [settings.exploits_path+"bugbox/"+filename for filename in bugbox_exploits]

    ex = ExecutionEngine()

    for exploit_path in bugbox_exploits:

        exploit_file = open(exploit_path)

        target = ""

        for line in exploit_file.readlines():
            if (line.find("'Target'") != -1):
                target = line.split("\"")[-2]
            if (line.find("'Plugin'") != -1):
                target +="_"+line.split("\"")[-2]
                
        target = target.replace(" ", "_").replace(".","_").lower()

        configuration = settings.configurations_path+target+"__ubuntu-apache-mysql"

        print("RUNNNG BUGBOX EXPLOIT")
        print("configuration: " + configuration)
        print("bugbox_exploit: " + exploit_path)

        ex.run(configuration, exploit_path, settings.report_path)

        print("EXPLOIT FINISHED")