mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-10-28 19:55:52 +08:00
默认请求只探测80端口
This commit is contained in:
+2
-2
@@ -163,7 +163,7 @@ The OneForAll command line interface is based on [Fire](https://github.com/googl
|
|||||||
valid, invalid, and all subdomains, respectively.
|
valid, invalid, and all subdomains, respectively.
|
||||||
Parameter verify for True attempts to resolve and request the subdomain
|
Parameter verify for True attempts to resolve and request the subdomain
|
||||||
and tag the validity of the subdomain based on the result.
|
and tag the validity of the subdomain based on the result.
|
||||||
Parameter port have optional values 'small', 'medium', 'large', 'xlarge',
|
Parameter port have optional values 'default' 'small', 'medium', 'large',
|
||||||
See config.py configuration for details.
|
See config.py configuration for details.
|
||||||
Parameter format have optional values 'txt', 'rst', 'csv', 'tsv', 'json',
|
Parameter format have optional values 'txt', 'rst', 'csv', 'tsv', 'json',
|
||||||
'yaml', 'html', 'jira', 'xls', 'xlsx', 'dbf', 'latex', 'ods'.
|
'yaml', 'html', 'jira', 'xls', 'xlsx', 'dbf', 'latex', 'ods'.
|
||||||
@@ -181,7 +181,7 @@ The OneForAll command line interface is based on [Fire](https://github.com/googl
|
|||||||
--verify=VERIFY
|
--verify=VERIFY
|
||||||
Verify the validity of subdomains (default True)
|
Verify the validity of subdomains (default True)
|
||||||
--port=PORT
|
--port=PORT
|
||||||
Port range for request authentication (default medium)
|
Port range for request authentication (default 80 port)
|
||||||
--valid=VALID
|
--valid=VALID
|
||||||
Export validity of subdomains (default 1)
|
Export validity of subdomains (default 1)
|
||||||
--path=PATH
|
--path=PATH
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ OneForAll命令行界面基于[Fire](https://github.com/google/python-fire/)实
|
|||||||
Note:
|
Note:
|
||||||
参数valid可选值1,0,None分别表示导出有效,无效,全部子域
|
参数valid可选值1,0,None分别表示导出有效,无效,全部子域
|
||||||
参数verify为True会尝试解析和请求子域并根据结果给子域有效性打上标签
|
参数verify为True会尝试解析和请求子域并根据结果给子域有效性打上标签
|
||||||
参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置
|
参数port可选值有'default', 'small', 'medium', 'large' 详见config.py配置
|
||||||
参数format可选格式有'txt', 'rst', 'csv', 'tsv', 'json', 'yaml', 'html',
|
参数format可选格式有'txt', 'rst', 'csv', 'tsv', 'json', 'yaml', 'html',
|
||||||
'jira', 'xls', 'xlsx', 'dbf', 'latex', 'ods'
|
'jira', 'xls', 'xlsx', 'dbf', 'latex', 'ods'
|
||||||
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
|
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
|
||||||
@@ -174,7 +174,7 @@ OneForAll命令行界面基于[Fire](https://github.com/google/python-fire/)实
|
|||||||
--verify=VERIFY
|
--verify=VERIFY
|
||||||
验证子域有效性(默认True)
|
验证子域有效性(默认True)
|
||||||
--port=PORT
|
--port=PORT
|
||||||
请求验证的端口范围(默认medium)
|
请求验证的端口范围(默认只探测80端口)
|
||||||
--valid=VALID
|
--valid=VALID
|
||||||
导出子域的有效性(默认1)
|
导出子域的有效性(默认1)
|
||||||
--path=PATH
|
--path=PATH
|
||||||
|
|||||||
@@ -20,19 +20,25 @@ def get_limit_conn():
|
|||||||
|
|
||||||
|
|
||||||
def get_ports(port):
|
def get_ports(port):
|
||||||
logger.log('INFOR', f'正在获取请求端口范围')
|
logger.log('DEBUG', f'正在获取请求探测端口范围')
|
||||||
ports = set()
|
ports = set()
|
||||||
if isinstance(port, set):
|
if isinstance(port, set):
|
||||||
ports = port
|
ports = port
|
||||||
elif isinstance(port, str):
|
elif isinstance(port, list):
|
||||||
if port not in {'small', 'medium', 'large', 'xlarge'}:
|
ports = set(port)
|
||||||
logger.log('ERROR', f'不存在{port}等端口范围')
|
elif isinstance(port, tuple):
|
||||||
port = 'medium'
|
ports = set(port)
|
||||||
|
elif isinstance(port, int):
|
||||||
|
if 0 <= port <= 65535:
|
||||||
|
ports = {port}
|
||||||
|
elif port in {'default', 'small', 'medium', 'large'}:
|
||||||
|
logger.log('INFOR', f'探测{port}等端口范围')
|
||||||
ports = config.ports.get(port)
|
ports = config.ports.get(port)
|
||||||
logger.log('INFOR', f'使用{port}等端口范围')
|
if not ports: # 意外情况
|
||||||
if not ports: # 意外情况 ports_range为空使用使用中等端口范围
|
logger.log('ERROR', f'指定探测端口范围有误')
|
||||||
logger.log('ALERT', f'使用medium等端口范围')
|
ports = {80}
|
||||||
ports = config.ports.get('medium')
|
if ports == {80}:
|
||||||
|
logger.log('INFOR', f'探测默认端口范围')
|
||||||
return ports
|
return ports
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+23
-24
@@ -84,21 +84,21 @@ resolver_timeout = 5.0 # 解析超时时间
|
|||||||
resolver_lifetime = 30.0 # 解析存活时间
|
resolver_lifetime = 30.0 # 解析存活时间
|
||||||
limit_resolve_conn = 500 # 限制同一时间解析的数量(默认500)
|
limit_resolve_conn = 500 # 限制同一时间解析的数量(默认500)
|
||||||
|
|
||||||
# http探测设置
|
# 请求端口探测设置
|
||||||
small_ports = {80, 443}
|
default_ports = {80} # 默认使用
|
||||||
medium_ports = {80, 443, 8000, 8080, 8443} # 默认使用
|
small_ports = {80, 443, 8000, 8080, 8443}
|
||||||
large_ports = {80, 81, 443, 591, 2082, 2087, 2095, 2096, 3000, 8000, 8001,
|
medium_ports = {80, 81, 443, 591, 2082, 2087, 2095, 2096, 3000, 8000, 8001,
|
||||||
8008, 8080, 8083, 8443, 8834, 8888}
|
8008, 8080, 8083, 8443, 8834, 8888}
|
||||||
xlarge_ports = {80, 81, 300, 443, 591, 593, 832, 981, 1010, 1311, 2082,
|
large_ports = {80, 81, 300, 443, 591, 593, 832, 888, 981, 1010, 1311, 2082,
|
||||||
2087, 2095, 2096, 2480, 3000, 3128, 3333, 4243, 4567, 4711,
|
2087, 2095, 2096, 2480, 3000, 3128, 3333, 4243, 4567, 4711,
|
||||||
4712, 4993, 5000, 5104, 5108, 5800, 6543, 7000, 7396, 7474,
|
4712, 4993, 5000, 5104, 5108, 5800, 6543, 7000, 7396, 7474,
|
||||||
8000, 8001, 8008, 8014, 8042, 8069, 8080, 8081, 8088, 8090,
|
8000, 8001, 8008, 8014, 8042, 8069, 8080, 8081, 8088, 8090,
|
||||||
8091, 8016, 8118, 8123, 8172, 8222, 8243, 8280, 8281, 8333,
|
8091, 8016, 8118, 8123, 8172, 8222, 8243, 8280, 8281, 8333,
|
||||||
8443, 8500, 8834, 8880, 8888, 8983, 9000, 9043, 9060, 9080,
|
8443, 8500, 8834, 8880, 8888, 8983, 9000, 9043, 9060, 9080,
|
||||||
9090, 9091, 9200, 9443, 9800, 9981, 12443, 16080, 18091, 18092,
|
9090, 9091, 9200, 9443, 9800, 9981, 12443, 16080, 18091, 18092,
|
||||||
20720, 28017}
|
20720, 28017} # 可以在这里面添加端口
|
||||||
ports = {'small': small_ports, 'medium': medium_ports,
|
ports = {'default': default_ports, 'small': small_ports,
|
||||||
'large': large_ports, 'xlarge': xlarge_ports}
|
'medium': medium_ports, 'large': large_ports}
|
||||||
verify_ssl = False
|
verify_ssl = False
|
||||||
# aiohttp 支持 HTTP/HTTPS形式的代理
|
# aiohttp 支持 HTTP/HTTPS形式的代理
|
||||||
get_proxy = None # proxy="http://user:pass@some.proxy.com"
|
get_proxy = None # proxy="http://user:pass@some.proxy.com"
|
||||||
@@ -110,7 +110,6 @@ limit_open_conn = 0
|
|||||||
# 限制同一时间在同一个端点((host, port, is_ssl) 3者都一样的情况)打开的连接数
|
# 限制同一时间在同一个端点((host, port, is_ssl) 3者都一样的情况)打开的连接数
|
||||||
limit_per_host = 0 # 默认0表示不限制
|
limit_per_host = 0 # 默认0表示不限制
|
||||||
|
|
||||||
|
|
||||||
# 模块API配置
|
# 模块API配置
|
||||||
# Censys可以免费注册获取API:https://censys.io/api
|
# Censys可以免费注册获取API:https://censys.io/api
|
||||||
censys_api_id = ''
|
censys_api_id = ''
|
||||||
@@ -193,16 +192,16 @@ subdomains_common = {'i', 'w', 'm', 'en', 'us', 'zh', 'w3', 'app', 'bbs',
|
|||||||
# 日志配置
|
# 日志配置
|
||||||
# 终端日志输出格式
|
# 终端日志输出格式
|
||||||
stdout_fmt = '<cyan>{time:HH:mm:ss,SSS}</cyan> ' \
|
stdout_fmt = '<cyan>{time:HH:mm:ss,SSS}</cyan> ' \
|
||||||
'[<level>{level: <5}</level>] ' \
|
'[<level>{level: <5}</level>] ' \
|
||||||
'<blue>{module}</blue>:<cyan>{line}</cyan> - ' \
|
'<blue>{module}</blue>:<cyan>{line}</cyan> - ' \
|
||||||
'<level>{message}</level>'
|
'<level>{message}</level>'
|
||||||
# 日志文件记录格式
|
# 日志文件记录格式
|
||||||
logfile_fmt = '<light-green>{time:YYYY-MM-DD HH:mm:ss,SSS}</light-green> ' \
|
logfile_fmt = '<light-green>{time:YYYY-MM-DD HH:mm:ss,SSS}</light-green> ' \
|
||||||
'[<level>{level: <5}</level>] ' \
|
'[<level>{level: <5}</level>] ' \
|
||||||
'<cyan>{process.name}({process.id})</cyan>:' \
|
'<cyan>{process.name}({process.id})</cyan>:' \
|
||||||
'<cyan>{thread.name: <10}({thread.id: <5})</cyan> | ' \
|
'<cyan>{thread.name: <10}({thread.id: <5})</cyan> | ' \
|
||||||
'<blue>{module}</blue>.<blue>{function}</blue>:' \
|
'<blue>{module}</blue>.<blue>{function}</blue>:' \
|
||||||
'<blue>{line}</blue> - <level>{message}</level>'
|
'<blue>{line}</blue> - <level>{message}</level>'
|
||||||
|
|
||||||
log_path = result_save_path.joinpath('oneforall.log')
|
log_path = result_save_path.joinpath('oneforall.log')
|
||||||
|
|
||||||
|
|||||||
@@ -59,20 +59,20 @@ class OneForAll(object):
|
|||||||
Note:
|
Note:
|
||||||
参数valid可选值1,0,None分别表示导出有效,无效,全部子域
|
参数valid可选值1,0,None分别表示导出有效,无效,全部子域
|
||||||
参数verify为True会尝试解析和请求子域并根据结果给子域有效性打上标签
|
参数verify为True会尝试解析和请求子域并根据结果给子域有效性打上标签
|
||||||
参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置
|
参数port可选值有'default', 'small', 'medium', 'large', 详见config.py配置
|
||||||
参数format可选格式有'txt', 'rst', 'csv', 'tsv', 'json', 'yaml', 'html',
|
参数format可选格式有'txt', 'rst', 'csv', 'tsv', 'json', 'yaml', 'html',
|
||||||
'jira', 'xls', 'xlsx', 'dbf', 'latex', 'ods'
|
'jira', 'xls', 'xlsx', 'dbf', 'latex', 'ods'
|
||||||
|
|
||||||
:param str target: 单个域名或者每行一个域名的文件路径(必需参数)
|
:param str target: 单个域名或者每行一个域名的文件路径(必需参数)
|
||||||
:param bool brute: 使用爆破模块(默认False)
|
:param bool brute: 使用爆破模块(默认False)
|
||||||
:param bool verify: 验证子域有效性(默认True)
|
:param bool verify: 验证子域有效性(默认True)
|
||||||
:param str port: 请求验证的端口范围(默认medium)
|
:param str port: 请求验证子域的端口范围(默认只探测80端口)
|
||||||
:param int valid: 导出子域的有效性(默认1)
|
:param int valid: 导出子域的有效性(默认1)
|
||||||
:param str format: 导出格式(默认csv)
|
:param str format: 导出格式(默认csv)
|
||||||
:param bool show: 终端显示导出数据(默认False)
|
:param bool show: 终端显示导出数据(默认False)
|
||||||
"""
|
"""
|
||||||
def __init__(self, target, brute=None, verify=None, port='medium', valid=1,
|
def __init__(self, target, brute=None, verify=None, port='default',
|
||||||
format='csv', takeover=True, show=False):
|
valid=1, format='csv', takeover=True, show=False):
|
||||||
self.target = target
|
self.target = target
|
||||||
self.port = port
|
self.port = port
|
||||||
self.domains = set()
|
self.domains = set()
|
||||||
|
|||||||
Reference in New Issue
Block a user