OneForAll icon indicating copy to clipboard operation
OneForAll copied to clipboard

网络环境检测网址失效

Open allanprince opened this issue 2 years ago • 1 comments

是否使用了最新代码Bug描述 网络环境检测网址失效导致无法启用子域收集模块 图片 图片

运行环境

  • 系统:Windows 10 x64
  • Python版本:3.9.6
  • OneForAll版本:0.4.5

如何复现 #!/usr/bin/env python3

coding=utf-8

""" Example """

from oneforall import OneForAll from common import utils

def oneforall(domain): test = OneForAll(target=domain) test.dns = True test.brute = True test.req = True test.takeover = True test.run() results = test.datas print(results)

if name == 'main': utils.get_net_env() #oneforall('freebuf.com')

报错文本 (ProtocolError('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)),)

预期结果 网络环境正常,仅国外的http://ip-api.com/json/无法访问

实际结果 提示网络环境异常

屏幕截图 见上方

日志上传 无需

其他补充 希望能够配置可选的国内ip解析,避免导致敏感时期无法正常工作的问题

allanprince avatar Aug 09 '22 07:08 allanprince

由于根目录\common\utils.py第500行下负责检测网络环境的check_net()函数中的http://ip-api.com/json/地址国内无法访问,导致网络环境检测失败,可以通过增加代理参数或者修改检测地址来修补,我暂时没找到合适的api,只增加了代理proxy = get_random_proxy(),rsp = session.get(url, headers=header, proxies=proxy, timeout=timeout, verify=verify) bug

PrfectDD avatar Aug 18 '22 02:08 PrfectDD