Example #1
0
def init_engine():
    # init control parameter
    th.result = []
    th.thread_mode = True if conf.engine_mode == "multi_threaded" else False
    th.tasks = conf.task_queue
    th.tasks_num = conf.task_queue.qsize()
    th.output_path = conf.output_path
    th.scan_count = th.found_count = 0
    th.is_continue = True
    th.console_width = getTerminalSize()[0] - 2

    # set concurrent number
    if th.tasks.qsize() < conf.concurrent_num:
        th.concurrent_count = th.concurrent_num = th.tasks.qsize()
    else:
        th.concurrent_count = th.concurrent_num = conf.concurrent_num

    # set process bar
    widgets = [
        '[',
        progressbar.SimpleProgress(), ']', '[',
        progressbar.Timer(), ']'
    ]
    global pbar
    pbar = progressbar.ProgressBar(redirect_stdout=True, widgets=widgets)

    th.start_time = time.time()
Example #2
0
def initEngine():
    # init control parameter
    th.result = []
    th.thread_num = conf.thread_num
    th.target = conf.target
    #是否继续扫描标志位
    th.is_continue = True
    #控制台宽度
    th.console_width = getTerminalSize()[0] - 2
    #记录开始时间
    th.start_time = time.time()
    msg = '[+] Set the number of thread: %d' % th.thread_num
    outputscreen.success(msg)
Example #3
0
def initEngine():
    th.thread_mode = True if conf.ENGINE is ENGINE_MODE_STATUS.THREAD else False
    th.f_flag = conf.FILE_OUTPUT
    th.s_flag = conf.SCREEN_OUTPUT
    th.output = conf.OUTPUT_FILE_PATH
    th.thread_count = th.threads_num = th.THREADS_NUM
    th.single_mode = conf.SINGLE_MODE
    th.scan_count = th.found_count = 0
    th.console_width = getTerminalSize()[0] - 2
    th.is_continue = True
    th.found_single = False
    th.start_time = time.time()
    setThreadLock()
    msg = 'Set the number of concurrent: %d' % th.threads_num
    logger.success(msg)
Example #4
0
def initEngine():
    # init control parameter
    th.result = []
    th.thread_count = th.thread_num = conf.thread_num
    th.module_name = conf.module_name
    th.module_path = conf.module_path
    th.module_obj = conf.module_obj
    th.target = conf.target
    th.no_output = conf.no_output
    th.output_path = conf.output_path
    th.scan_count = th.found_count = 0
    th.is_continue = True
    th.console_width = getTerminalSize()[0] - 2
    th.start_time = time.time()
    setThreadLock()
    msg = '[+] Set the number of thread: %d' % th.thread_num
    outputscreen.success(msg)
Example #5
0
def init_engine():
    # init control parameter
    th.result = []
    th.thread_mode = True if conf.engine_mode == "multi_threaded" else False
    th.tasks = conf.task_queue
    th.tasks_num = conf.task_queue.qsize()
    th.output_path = conf.output_path
    th.scan_count = th.found_count = 0
    th.is_continue = True
    th.console_width = getTerminalSize()[0] - 2

    # set concurrent number
    if th.tasks.qsize() < conf.concurrent_num:
        th.concurrent_count = th.concurrent_num = th.tasks.qsize()
    else:
        th.concurrent_count = th.concurrent_num = conf.concurrent_num

    th.start_time = time.time()
Example #6
0
def initEngine():
    th.thread_mode = True if conf.ENGINE is ENGINE_MODE_STATUS.THREAD else False
    #多线程模式conf.ENGINE=9
    th.module_name = conf.MODULE_NAME  #脚本名
    th.s_flag = True
    th.thread_count = th.threads_num = th.THREADS_NUM  #线程数
    th.scan_count = th.found_count = 0  #扫描数和发现数置0
    th.console_width = getTerminalSize()[0] - 2  #命令行窗口宽度减2
    th.is_continue = True
    th.start_time = time.time()  #开始计时
    setThreadLock()
    '''
    print "#########以下是th字典##########"
    print th
    '''
    msg = 'The number of %s: %d' % ('threads'
                                    if conf.ENGINE is ENGINE_MODE_STATUS.THREAD
                                    else 'concurrent', th.threads_num)
    logger.info(msg)
Example #7
0
def initEngine():
    # load module
    load_module()
    # init control parameter
    th.result = []
    th.thread_mode = True if conf.engine_mode == "multi_threaded" else False
    th.target = conf.target
    th.output_path = conf.output_path
    th.scan_count = th.found_count = 0
    th.is_continue = True
    th.console_width = getTerminalSize()[0] - 2
    # set concurrent number
    if th.thread_mode:
        th.concurrent_count = th.concurrent_num = conf.thread_num
    else:
        if th.target.qsize() < 150:
            th.concurrent_count = th.concurrent_num = th.target.qsize()
        else:
            th.concurrent_count = th.concurrent_num = 150
    th.start_time = time.time()