Esempio n. 1
0
 def __init__(self, type, tnum, que=None, targets=None, filename=None):
     sys.path.append('exploits/server')
     sys.path.append('exploits/website')
     self.type = type
     self.tnum = int(tnum)
     self.que = que
     self.targets = targets
     self.filename = filename
     self.lock = threading.Lock()
     self.console_width = getTerminalSize()[0] - 2
Esempio n. 2
0
 def __init__(self, types, tnum, que=None, targets=None, filename=None):
     if types == 'website':
         sys.path.append('exploits/website')
     else:
         sys.path.append('exploits/server')
     self.type = type
     self.tnum = int(tnum)
     self.que = que
     self.targets = targets
     self.filename = filename
     self.lock = threading.Lock()
     self.console_width = getTerminalSize()[0] - 2
     self.maxpross = que.qsize() * len(targets)
     self.pross = 0
     self.tq = Queue.Queue()
     socket.setdefaulttimeout(5)
Esempio n. 3
0
 def __init__(self,types,tnum,que=None,targets=None,filename=None):  
     if types =='website':
         sys.path.append('exploits/website')
     else:
         sys.path.append('exploits/server')
     self.type=type
     self.tnum = int(tnum)
     self.que = que 
     self.targets = targets
     self.filename = filename
     self.lock = threading.Lock()
     self.console_width = getTerminalSize()[0] - 2
     self.maxpross = que.qsize() * len(targets)
     self.pross = 0
     self.tq = Queue.Queue()
     socket.setdefaulttimeout(5)
Esempio n. 4
0
 def __init__(self,
              thread=10,
              systempath=os.path.dirname(os.path.abspath(__file__))):
     # 线程数
     self.thread = thread
     # 系统目录
     self.system_path = systempath
     # 日志存放目录
     self.logpath = systempath + "/log/log.txt"
     # 文件目录和解压目录
     self.tmppath = systempath + "/tmp/"
     # 日志存储
     self.outfile = open(self.logpath, 'w')
     # 多线程框架
     self.thread_count = 0
     self.scan_count = self.found_count = 0
     self.lock = threading.Lock()
     self.console_width = getTerminalSize()[0] - 2
     self.msg_queue = Queue.Queue()
     self.STOP_ME = False
     threading.Thread(target=self._print_msg).start()
     self._init_queue()
Esempio n. 5
0
 def __init__(self, domain, num=100, full=False, loop=None):
     self.__check_domain(domain)
     self.domain = domain
     self.project_directory = os.path.abspath(os.path.dirname(__file__))
     self.loop = loop if loop is not None else asyncio.get_event_loop()
     self.console_width = getTerminalSize()[0] - 2
     self.queue = asyncio.Queue(loop=self.loop)
     self.found_count = 0
     self.scan_count = 0
     self.num = num
     self.full = full
     self.start_time = time.time()
     dns_servers = self.load_dns_servers()
     self.resolver = aiodns.DNSResolver(timeout=0.1,
                                        nameservers=dns_servers,
                                        loop=self.loop)
     self.ip_dict = {}
     self.found_subs = set()
     self.__load_next_sub()
     self.__load_subnames()
     self.output = open(
         self.domain + '_' +
         time.strftime('%y%m%d_%H%M%S', time.localtime()) + '.txt', 'w')
Esempio n. 6
0
# coding:utf-8
# common functions
import sys
import os
from gevent.pool import Pool
import dns.resolver
from consle_width import getTerminalSize
console_width = getTerminalSize()[0] - 2


def is_intranet(ip):
    ret = ip.split('.')
    if len(ret) != 4:
        return True
    if ret[0] == '10':
        return True
    if ret[0] == '172' and 16 <= int(ret[1]) <= 32:
        return True
    if ret[0] == '192' and ret[1] == '168':
        return True
    return False


def print_msg(msg=None, left_align=True, line_feed=False):
    if left_align:
        sys.stdout.write('\r' + msg + ' ' * (console_width - len(msg)))
    else:
        sys.stdout.write('\r' + ' ' * (console_width - len(msg)) + msg)
    if line_feed:
        sys.stdout.write('\n')
    sys.stdout.flush()