Exemple #1
0
    def do_scan_create(self, audit_config):
        """
        Implementation of: /scan/create

        :param audit_config: Audit configuration.
        :type audit_config: dict(str -> \\*)
        """

        # Load the audit configuration from the dictionary.
        o_audit_config = AuditConfig()
        o_audit_config.from_dictionary(audit_config)

        # Create the new audit.
        start_audit(o_audit_config)
Exemple #2
0
def validate(audit):
    audit = AuditConfig()
    audit.from_dictionary({
        "audit_name": audit,
        "audit_db": "sqlite://%s.db" % audit,
    })
    disk = AuditDB(audit)
    try:

        # Make sure all objects completed all stages.
        for stage in sorted(PluginManager.STAGES.values()):
            assert disk.get_pending_data(stage) == set()

    finally:
        disk.close()
Exemple #3
0
def test():

    config = OrchestratorConfig()
    config.from_dictionary({
        "plugins_folder":
        path.abspath(path.join(here, "plugin_tests")),
        "ui_mode":
        "test",
    })

    audit = AuditConfig()
    audit.from_dictionary({
        "targets": [
            "http://www.example.com/folder/subfolder/index.html",
        ],
        "reports": [
            "-",
        ],
        "audit_db":
        "sqlite://",
    })
    ##audit.plugin_load_overrides = [(True, "recon/test")]  # XXX DEBUG shorter run

    try:
        print "Launching GoLismero..."
        print
        t1 = time.time()
        code = run(config, audit)
        t2 = time.time()
        print
        print "GoLismero ran for %f seconds" % (t2 - t1)
        print
        assert code == 0

        print "Validating the audit database..."
        print
        validate(audit.audit_name)

    finally:
        print "Cleaning up..."
        print
        try:
            os.unlink("%s.db" % audit.audit_name)
        except Exception:
            pass
    print "Done!"
Exemple #4
0
def validate(audit):
    audit = AuditConfig()
    audit.from_dictionary({
        "audit_name": audit,
        "audit_db": "sqlite://%s.db" % audit,
    })
    disk = AuditDB(audit)
    try:

        # Make sure all objects completed all stages.
        for stage in sorted(PluginManager.STAGES.values()):
            assert disk.get_pending_data(stage) == set()



    finally:
        disk.close()
Exemple #5
0
def test():

    config = OrchestratorConfig()
    config.from_dictionary({
        "plugins_folder": path.abspath(path.join(here, "plugin_tests")),
        "ui_mode": "test",
    })

    audit = AuditConfig()
    audit.from_dictionary({
        "targets": ["http://www.example.com/folder/subfolder/index.html",],
        "reports": ["-",],
        "audit_db": "",
    })
    ##audit.plugin_load_overrides = [(True, "recon/test")]  # XXX DEBUG shorter run

    try:
        print "Launching GoLismero..."
        print
        t1 = time.time()
        code = run(config, audit)
        t2 = time.time()
        print
        print "GoLismero ran for %f seconds" % (t2 - t1)
        print
        assert code == 0

        print "Validating the audit database..."
        print
        validate(audit)

    finally:
        print "Cleaning up..."
        print
        try:
            os.unlink("%s.db" % audit.audit_name)
        except Exception:
            pass
    print "Done!"