コード例 #1
0
def run_request(domain, data, port):
    """
    HTTP request entrance

    :param  str domain: domain to be requested
    :param  list data: subdomains data to be requested
    :param  any port: range of ports to be requested
    :return list: result
    """
    logger.log('INFOR', f'Start requesting subdomains of {domain}')
    data = utils.set_id_none(data)
    ports = get_port_seq(port)
    req_data, req_urls = gen_req_data(data, ports)
    bulk_request(domain, req_data)
    count = utils.count_alive(domain)
    logger.log('INFOR', f'Found that {domain} has {count} alive subdomains')
コード例 #2
0
def run_request(domain, data, port):
    """
    HTTP request entrance

    :param  str domain: domain to be requested
    :param  list data: subdomains data to be requested
    :param  any port: range of ports to be requested
    :return list: result
    """
    logger.log('INFOR', f'Start requesting subdomains of {domain}')
    loop = set_loop()
    data = utils.set_id_none(data)
    request_coroutine = bulk_request(data, port)
    data = loop.run_until_complete(request_coroutine)
    loop.run_until_complete(asyncio.sleep(0.25))
    count = utils.count_alive(data)
    logger.log('INFOR', f'Found that {domain} has {count} alive subdomains')
    return data
コード例 #3
0
ファイル: request.py プロジェクト: yutianqaq/OneForAll
def run_request(domain, data, port):
    """
    调用子域请求入口函数

    :param str domain: 待请求的主域
    :param list data: 待请求的子域数据
    :param str port: 待请求的端口范围
    :return: 请求后得到的结果列表
    :rtype: list
    """
    loop = asyncio.get_event_loop()
    asyncio.set_event_loop(loop)
    data = utils.set_id_none(data)
    request_coroutine = bulk_request(data, port)
    data = loop.run_until_complete(request_coroutine)
    # 在关闭事件循环前加入一小段延迟让底层连接得到关闭的缓冲时间
    loop.run_until_complete(asyncio.sleep(0.25))
    count = utils.count_alive(data)
    logger.log('INFOR', f'经验证{domain}存活子域{count}个')
    return data
コード例 #4
0
def run_request(domain, data, port):
    """
    HTTP request entrance

    :param  str domain: domain to be requested
    :param  list data: subdomains data to be requested
    :param  str port: range of ports to be requested
    :return list: result
    """
    logger.log('INFOR', f'Start subdomain request module')
    set_loop_policy()
    loop = asyncio.get_event_loop()
    asyncio.set_event_loop(loop)
    data = utils.set_id_none(data)
    request_coroutine = bulk_request(data, port)
    data = loop.run_until_complete(request_coroutine)
    # 在关闭事件循环前加入一小段延迟让底层连接得到关闭的缓冲时间
    loop.run_until_complete(asyncio.sleep(0.25))
    count = utils.count_alive(data)
    logger.log('INFOR',
               f'Request module found {domain} have {count} alive subdomains')
    return data