Exemple #1
0
 def __init__(self,
              host=GlobalConf().mysqlconf['host'],
              port=GlobalConf().mysqlconf['port'],
              user=GlobalConf().mysqlconf['username'],
              password=GlobalConf().mysqlconf['password']):
     self.host = host
     self.port = port
     self.user = user
     self.password = password
     self.conn = None
     self.cursor = None
Exemple #2
0
 def run(self):
     cmd = [
         os.path.join(GlobalConf().progpath['location'],
                      'Endless_Sword/xray/xray'), 'webscan', '--listen',
         '127.0.0.1:7777', '--html-output', 'report.html'
     ]
     out, err = subprocess.Popen(cmd,
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE).communicate()
Exemple #3
0
    def apicheck(self):
        success = True
        cprint('[*]执行api模块检查..', 'blue')
        try:
            ceye_conf = GlobalConf().ceye
            if len(ceye_conf['url']) > 0:
                cprint('[+]ceye接口已配置', 'green')
            else:
                cprint('[-]ceye接口未配置', 'red')

            chromuim_conf = GlobalConf().chromuim
            if len(chromuim_conf['path']) > 0:
                cprint('[+]chromuim路径已配置', 'green')
            else:
                cprint('[-]chromuim路径未配置', 'red')

            redirect_conf = GlobalConf().redirect
            if len(redirect_conf['url']) > 0 and len(redirect_conf['key']) > 0:
                cprint('[+]重定向接口已配置', 'green')
            else:
                cprint('[-]重定向接口未配置', 'red')

            logpath = GlobalConf().progpath
            if len(logpath['location']) > 0:
                cprint('[+]日志存储路径已配置', 'green')
            else:
                cprint('[-]日志存储路径未配置', 'red')

            my = GlobalConf().mysqlconf
            if len(my['host']) > 0 and my['port'] > 0 and len(
                    my['username']) > 0 and len(my['password']) > 0:
                cprint('[+]MySQL数据库已配置', 'green')
            else:
                cprint('[-]MySQL数据库未配置', 'red')
        except Exception as e:
            print(e)
            success = False
        return success
Exemple #4
0
    def iplocation(self):
        try:
            if self.isIp():
                IP = self.extractIp()
            else:
                IP = self.domain2ip()
            dbpath = os.path.join(GlobalConf().progpath['location'],
                                  'Heaven_Hell/GeoLite2-City.mmdb')
            reader = ipdb.Reader(dbpath)
            locate = reader.city(IP)
            return locate

        except:
            return dict()
Exemple #5
0
 def interOrouter(self):
     useProxy = GlobalConf().high_hide_agent
     proxies = {
         'http': 'http://{0}:{1}'.format(useProxy['url'], useProxy['port'])
     }
     try:
         req = requests.get(self.url,
                            proxies=proxies,
                            verify=False,
                            timeout=20)
         #回收req object
         del req
         return True
     except:
         return False
Exemple #6
0
 def run(self):
     crackpasswords = list()
     crackdict = os.path.join(GlobalConf().progpath['location'],
                              'Endless_Sword/crackdict/webpath.dic')
     with open(crackdict) as f:
         for line in f.readlines():
             line = line.strip()
             crackpasswords.append(line)
     pool = Pool(30)
     if self.check404():
         threads = [
             pool.spawn(self.sendrequestshead, item)
             for item in crackpasswords
         ]
         gevent.joinall(threads)
     else:
         threads = [
             pool.spawn(self.sendrequestsget, item)
             for item in crackpasswords
         ]
         gevent.joinall(threads)
Exemple #7
0
 def setpath(self):
     logpath = os.path.join(GlobalConf().progpath['location'],
                            'Backtracking/log')
     if not os.path.exists(logpath):
         os.makedirs(logpath)
     return logpath