Exemplo n.º 1
0
 def __init__(self):
     self.target_list = []
     self.server_db = db_name_conf()['server_db']
     self.asset_db = db_name_conf()['asset_db']
     self.processes_count = int(
         connectiondb(config_db).find_one()['port_thread'])
     self.asset_id = ''
     self.asset_name = ''
Exemplo n.º 2
0
# @Author  : jeffzhang
# @Time    : 2018/04/12
# @File    : subdomain_brute.py
# @Desc    : ""

import sched
import time
import dns.resolver
import multiprocessing
from datetime import datetime
from string import digits, ascii_lowercase
from random import sample
from InsectsAwake.views.lib.mongo_db import connectiondb, db_name_conf
from bson import ObjectId

domain_db = db_name_conf()['domain_db']
config_db = db_name_conf()['config_db']
subdomain_db = db_name_conf()['subdomain_db']
schedule = sched.scheduler(time.time, time.sleep)


class DomainsBrute:
    def __init__(self, target_domain, subdomain_dict, domain_id, domain_name):
        self.target_domain = target_domain
        self.subdomain_dict = subdomain_dict
        self.domain_id = domain_id
        self.domain_name = domain_name
        self.domain_list = []
        self.result = {}
        self.subdomain_db_name = subdomain_db
        self.random_subdomain = ''.join(sample(digits + ascii_lowercase,
Exemplo n.º 3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : jeffzhang
# @Time    : 2018/04/03
# @File    : vulnerability_plugin.py
# @Desc    : ""

import os
import re
import sys
from InsectsAwake.views.lib.mongo_db import connectiondb, db_name_conf
from flask import Flask

app = Flask(__name__)
plugin_db = db_name_conf()['plugin_db']


def get_plugin_re(plugin_filename):
    name_pattern = re.compile(r'name\s*=\s*[\'\"\[](.*)[\'\"\]]')
    author_pattern = re.compile(r'author\s*=\s*[\'\"\[](.*)[\'\"\]]')
    vuldate_pattern = re.compile(r'vulDate\s*=\s*[\'\"\[](.*)[\'\"\]]')
    appname_pattern = re.compile(r'appName\s*=\s*[\'\"\[](.*)[\'\"\]]')
    vultype_pattern = re.compile(r'vulType\s*=\s*[\'\"\[](.*)[\'\"\]]')
    appversion_pattern = re.compile(r'appVersion\s*=\s*[\'\"\[](.*)[\'\"\]]')
    plugin_data = open(plugin_filename, 'r').read()
    try:
        plugin_name = name_pattern.findall(plugin_data)
        plugin_author = author_pattern.findall(plugin_data)
        plugin_vuldate = vuldate_pattern.findall(plugin_data)
        plugin_appname = appname_pattern.findall(plugin_data)
        plugin_vultype = vultype_pattern.findall(plugin_data)
Exemplo n.º 4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : jeffzhang
# @Time    : 2018/04/03
# @File    : settings.py
# @Desc    : ""

import json
from flask import Blueprint, redirect, url_for, render_template, request, jsonify
from bson import ObjectId
from InsectsAwake.views.lib.mongo_db import db_management, connectiondb, db_name_conf
from InsectsAwake.views.authenticate import login_check

settings = Blueprint('settings', __name__)
config_db = db_name_conf()['config_db']


@settings.route('/scanner-setting')
@login_check
def scanner_settings():
    return redirect(url_for('dashboard.view_dashboard'))


@settings.route('/dev-tools', methods=['POST', 'GET'])
@login_check
def dev_tools():
    if request.method == 'POST':
        collections_name = request.form.get('collections_name')
        db_command = request.form.get('db_command')
        object_id = request.form.get('object_id')
        result_json = {}
def scanner():
    config_db = db_name_conf()['config_db']
    scanner_time = int(connectiondb(config_db).find_one()['scanner_time'])
    print('Scanner is start...')
    scanner_loop_execute(scanner_time)
# -*- coding: utf-8 -*-
# @Author  : jeffzhang
# @Time    : 2018/04/03
# @File    : pocsuite_scanner.py
# @Desc    : ""

import sched
import time
import datetime
from pocsuite.api.cannon import Cannon
from bson.objectid import ObjectId
import threading
from InsectsAwake.views.lib.mongo_db import connectiondb, db_name_conf

schedule = sched.scheduler(time.time, time.sleep)
config_db = db_name_conf()['config_db']
tasks_db = db_name_conf()['tasks_db']
vul_db = db_name_conf()['vul_db']
plugin_db = db_name_conf()['plugin_db']
scanner_thread = int(connectiondb(config_db).find_one()['scanner_thread'])


class PocsuiteScan:
    def __init__(self, inc_time):
        self.inc_time = inc_time
        self.target_list = ''
        self.target = ''
        self.plugin_list = ''
        self.task_name = ''
        self.task_id = ''
        self.task_status = ''
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : jeffzhang
# @Time    : 2018/04/11
# @File    : start.py
# @Desc    : ""

import os
import re
import sys
from bson import ObjectId
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parent_dir)
from InsectsAwake.views.lib.mongo_db import connectiondb, db_name_conf

asset_db = db_name_conf()['asset_db']
tasks_db = db_name_conf()['tasks_db']
vul_db = db_name_conf()['vul_db']
plugin_db = db_name_conf()['plugin_db']
config_db = db_name_conf()['config_db']
server_db = db_name_conf()['server_db']


def get_plugin_re(plugin_filename):
    name_pattern = re.compile(r'name\s*=\s*[\'\"\[](.*)[\'\"\]]')
    author_pattern = re.compile(r'author\s*=\s*[\'\"\[](.*)[\'\"\]]')
    vuldate_pattern = re.compile(r'vulDate\s*=\s*[\'\"\[](.*)[\'\"\]]')
    appname_pattern = re.compile(r'appName\s*=\s*[\'\"\[](.*)[\'\"\]]')
    vultype_pattern = re.compile(r'vulType\s*=\s*[\'\"\[](.*)[\'\"\]]')
    appversion_pattern = re.compile(r'appVersion\s*=\s*[\'\"\[](.*)[\'\"\]]')
    plugin_data = open(plugin_filename, 'r').read()