Пример #1
0
 def __init__(self, asset_id):
     self.asset_id = asset_id
     self.result_tmp = []
     self.result = []
     self.port_list = connectiondb(config_db).find_one({"config_name": config_name})['port_list']
     self.processes = connectiondb(config_db).find_one({"config_name": config_name})['discovery_thread']
     self.asset_name = connectiondb(asset_db).find_one({"_id": self.asset_id})['asset_name']
     self.host_list = parse_target(connectiondb(asset_db).find_one({"_id": self.asset_id})['asset_host'])
Пример #2
0
 def __init__(self, task_id):
     self.task_id = task_id
     self.tasks_db_cursor = connectiondb(tasks_db).find_one({"_id": self.task_id})
     self.target_list = parse_target(self.tasks_db_cursor['scan_target'])
     self.plugin_id_list = self.tasks_db_cursor['plugin_id']
     self.result_tmp = []
     self.result = []
     self.processes = connectiondb(config_db).find_one({"config_name": config_name})['poc_thread']
Пример #3
0
 def __init__(self, target_list, username_list, password_list, task_id,
              task_name, plugin):
     self.target_list = parse_target(target_list)
     self.username_list = username_list
     self.password_list = password_list
     self.plugin = plugin
     self.result = ""
     self.task_id = task_id
     self.task_name = task_name
     self.week_count = 0
Пример #4
0
 def __init__(self, task_id):
     self.task_id = task_id
     self.tasks_db_cursor = connectiondb(tasks_db).find_one(
         {"_id": self.task_id})
     self.target_list = parse_target(self.tasks_db_cursor['scan_target'])
     self.plugin_id_list = self.tasks_db_cursor['plugin_id']
     self.result_tmp = []
     self.result = []
     self.processes = connectiondb(config_db).find_one(
         {"config_name": config_name})['poc_thread']
Пример #5
0
 def __init__(self, asset_id):
     self.asset_id = asset_id
     self.result_tmp = []
     self.result = []
     self.port_list = connectiondb(config_db).find_one(
         {"config_name": config_name})['port_list']
     self.processes = connectiondb(config_db).find_one(
         {"config_name": config_name})['discovery_thread']
     self.asset_name = connectiondb(asset_db).find_one(
         {"_id": self.asset_id})['asset_name']
     self.host_list = parse_target(
         connectiondb(asset_db).find_one({"_id":
                                          self.asset_id})['asset_host'])
Пример #6
0
 def __init__(self, task_id):
     self.task_id = task_id
     self.db_cursor = connectiondb(auth_db).find_one({"_id": self.task_id})
     self.processes = connectiondb(config_db).find_one({"config_name": config_name})['auth_tester_thread']
     self.task_name = self.db_cursor['task_name']
     self.username_list = self.db_cursor['username']
     self.password_list = self.db_cursor['password']
     self.target_list = parse_target(self.db_cursor['target'])
     self.online_target = []
     self.service_list = self.db_cursor['service']
     self.args = self.db_cursor['args']
     self.result_pool = []
     self.result = []
     self.week_count = 0
Пример #7
0
 def __init__(self, task_id):
     self.task_id = task_id
     self.db_cursor = connectiondb(auth_db).find_one({"_id": self.task_id})
     self.processes = connectiondb(config_db).find_one(
         {"config_name": config_name})['auth_tester_thread']
     self.task_name = self.db_cursor['task_name']
     self.username_list = self.db_cursor['username']
     self.password_list = self.db_cursor['password']
     self.target_list = parse_target(self.db_cursor['target'])
     self.online_target = []
     self.service_list = self.db_cursor['service']
     self.args = self.db_cursor['args']
     self.result_pool = []
     self.result = []
     self.week_count = 0
Пример #8
0
def acunetix_view():
    # scanner view
    if request.method == "GET":
        acunetix_task = connectiondb(acunetix_db).find()
        return render_template('acunetix-scanner.html', acunetix_task=acunetix_task)
    else:
        if request.form.get('source') == "new_scan":
            target_id = []
            task_name = request.form.get('task_name')
            target_list = request.form.get('target_addr').split("\n")
            scan_type = request.form.get('scan_type')
            description_val = request.form.get('description_val')
            for target in parse_target(target_list):
                target_id.append(AcunetixScanner().start_task(target, description_val, scan_type)['target_id'])
            task_data = {
                "task_name": task_name,
                "target_list": target_list,
                "scan_type": scan_type,
                "description": description_val,
                "status": "",
                "target_id": target_id,
                "date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
            }
            connectiondb(acunetix_db).insert(task_data)
            # print(new_scan)
            return "success"
        elif request.form.get('source') == "delete_task":
            task_id = request.form.get('delete')
            target_id = connectiondb(acunetix_db).find_one({"_id": ObjectId(task_id)})['target_id']
            if connectiondb(acunetix_db).remove({"_id": ObjectId(task_id)}):
                for t_id in target_id:
                    AcunetixScanner().delete_target(t_id)
                return "success"
            else:
                return "warning"
        elif request.form.get('source') == "download_report":
            task_id = request.form.get('task_id')
            target_id = connectiondb(acunetix_db).find_one({"_id": ObjectId(task_id)})['target_id']
            task_name = connectiondb(acunetix_db).find_one({"_id": ObjectId(task_id)})['task_name']
            report_url = AcunetixScanner().reports(target_id, 'targets', task_name)
            if report_url:
                return jsonify({"html_url": report_url[0], "pdf_url": report_url[1]})
            else:
                return "warning"