예제 #1
0
파일: new_Monitor.py 프로젝트: poions/Orc
 def __init__(self):
     self.timeout = 2
     self.verify = True
     self.load_index_data = UseMongoData(load_mongodb_host,
                                         load_mongodb_port,
                                         load_mongodb_user,
                                         load_mongodb_pass)
예제 #2
0
파일: new_Monitor.py 프로젝트: poions/Orc
class checkDomainHttpResponse(object):
    def __init__(self):
        self.timeout = 2
        self.verify = True
        self.load_index_data = UseMongoData(load_mongodb_host,
                                            load_mongodb_port,
                                            load_mongodb_user,
                                            load_mongodb_pass)

    def _GET(self, domain):
        if 'http' not in domain:
            url = 'http://' + str(domain)
            try:
                load_response_data = requests.get(url=url,
                                                  headers={},
                                                  verify=self.verify,
                                                  timeout=self.timeout)
                domain_status = load_response_data.status_code
                load_response_data.encoding = 'utf-8'
                soup = BeautifulSoup(load_response_data.text, 'lxml')
                domain_title = soup.title.text
                self.load_index_data.client_mongodb_update_domainStatus(
                    domain, "online", domain_title, domain_status)
                print(json.dumps({"url": url, "status": "online"}))
            except Exception as e:
                self.load_index_data.client_mongodb_update_domainStatus(
                    domain, "offline", "", 0)
                print(url, e)
예제 #3
0
파일: new_Monitor.py 프로젝트: poions/Orc
def load_url_data():
    load_index_data = UseMongoData(load_mongodb_host, load_mongodb_port,
                                   load_mongodb_user, load_mongodb_pass)
    domain_data = [
        i['subdomains']
        for i in load_index_data.client_mongodb_load_domain_index()
    ]
    return domain_data
예제 #4
0
class MonitorSubdomains(object):
    def __init__(self):
        self.load_index_data = UseMongoData(load_mongodb_host,load_mongodb_port,load_mongodb_user,load_mongodb_pass) 
 
    def riskiq_scan(self):
        for domain in self.load_index_data.client_mongodb_load_domain_all():
            for i in do(domain['domain']):
                if self.load_index_data.client_mongodb_find_Subdomains(i) == None:
                    self.load_index_data.client_mongodb_insert_Subdomains(i,"riskiq")
                else:
                    self.load_index_data.client_mongodb_update_Subdomains(i)
예제 #5
0
파일: utils.py 프로젝트: poions/Orc
#-*-coding:utf-8-*-
import os,sys
#import ConfigParser       #python2.7使用此方法
import configparser
from UseMongoDBManager import UseMongoData

def load_conf_setting(tname,cname):
    #cf = ConfigParser.ConfigParser()    #python2.7使用此方法
    cf = configparser.ConfigParser()
    cf.read(os.path.abspath(os.path.abspath('.')+"/conf/setting.conf"))
    load_conf_data = str(cf.get(tname, cname))
    return load_conf_data



load_mongodb_host = load_conf_setting("mongodb_client","mongodb_hosts")
load_mongodb_port = load_conf_setting("mongodb_client","mongodb_port")
load_mongodb_user = load_conf_setting("mongodb_client","mongodb_username")
load_mongodb_pass = load_conf_setting("mongodb_client","mongodb_password")
load_index_data = UseMongoData(load_mongodb_host,load_mongodb_port,load_mongodb_user,load_mongodb_pass)


#use_domain_data_index = load_index_data.client_mongodb_load_domain_all()   调用方法例子
예제 #6
0
 def __init__(self):
     self.load_index_data = UseMongoData(load_mongodb_host,load_mongodb_port,load_mongodb_user,load_mongodb_pass)