mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
修改默认导出格式为xls,添加txt,rst,jira格式输出。
This commit is contained in:
@@ -144,8 +144,8 @@ class AIOBrute(Module):
|
|||||||
当你的环境不受以上因素影响,当前爆破速度较慢,那么强烈建议根据字典大小调整大小:
|
当你的环境不受以上因素影响,当前爆破速度较慢,那么强烈建议根据字典大小调整大小:
|
||||||
十万字典建议设置为5000,百万字典设置为50000
|
十万字典建议设置为5000,百万字典设置为50000
|
||||||
参数valid可选值1,0,None,分别表示导出有效,无效,全部子域
|
参数valid可选值1,0,None,分别表示导出有效,无效,全部子域
|
||||||
参数format可选格式:'csv', 'tsv', 'json', 'yaml', 'html', 'xls', 'xlsx',
|
参数format可选格式有'txt', 'rst', 'csv', 'tsv', 'json', 'yaml', 'html',
|
||||||
'dbf', 'latex', 'ods'
|
'jira', 'xls', 'xlsx', 'dbf', 'latex', 'ods'
|
||||||
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
|
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
|
||||||
|
|
||||||
:param str target: 单个域名或者每行一个域名的文件路径
|
:param str target: 单个域名或者每行一个域名的文件路径
|
||||||
@@ -160,14 +160,14 @@ class AIOBrute(Module):
|
|||||||
:param str rule: fuzz模式使用的正则规则(默认使用config.py配置)
|
:param str rule: fuzz模式使用的正则规则(默认使用config.py配置)
|
||||||
:param bool export: 是否导出爆破结果(默认True)
|
:param bool export: 是否导出爆破结果(默认True)
|
||||||
:param int valid: 导出子域的有效性(默认None)
|
:param int valid: 导出子域的有效性(默认None)
|
||||||
:param str format: 导出格式(默认xlsx)
|
:param str format: 导出格式(默认xls)
|
||||||
:param str path: 导出路径(默认None)
|
:param str path: 导出路径(默认None)
|
||||||
:param bool show: 终端显示导出数据(默认False)
|
:param bool show: 终端显示导出数据(默认False)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, target, process=None, coroutine=64, wordlist=None,
|
def __init__(self, target, process=None, coroutine=64, wordlist=None,
|
||||||
segment=500, recursive=False, depth=2, namelist=None,
|
segment=500, recursive=False, depth=2, namelist=None,
|
||||||
fuzz=False, rule=None, export=True, valid=None, format='xlsx',
|
fuzz=False, rule=None, export=True, valid=None, format='xls',
|
||||||
path=None, show=False):
|
path=None, show=False):
|
||||||
Module.__init__(self)
|
Module.__init__(self)
|
||||||
self.domains = set()
|
self.domains = set()
|
||||||
|
|||||||
+12
-9
@@ -15,7 +15,7 @@ from common.database import Database
|
|||||||
from config import logger
|
from config import logger
|
||||||
|
|
||||||
|
|
||||||
def export(table, db=None, valid=None, dpath=None, format='xlsx', show=False):
|
def export(table, db=None, valid=None, dpath=None, format='xls', show=False):
|
||||||
"""
|
"""
|
||||||
OneForAll数据库导出模块
|
OneForAll数据库导出模块
|
||||||
|
|
||||||
@@ -25,19 +25,19 @@ def export(table, db=None, valid=None, dpath=None, format='xlsx', show=False):
|
|||||||
|
|
||||||
Note:
|
Note:
|
||||||
参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置
|
参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置
|
||||||
参数format可选格式有'csv', 'tsv', 'json', 'yaml', 'html', 'xls', 'xlsx',
|
参数format可选格式有'txt', 'rst', 'csv', 'tsv', 'json', 'yaml', 'html',
|
||||||
'dbf', 'latex', 'ods'
|
'jira', 'xls', 'xlsx', 'dbf', 'latex', 'ods'
|
||||||
参数dir为None默认使用OneForAll结果目录
|
参数dir为None默认使用OneForAll结果目录
|
||||||
|
|
||||||
:param str table: 要导出的表
|
:param str table: 要导出的表
|
||||||
:param str db: 要导出的数据库路径(默认为results/result.sqlite3)
|
:param str db: 要导出的数据库路径(默认为results/result.sqlite3)
|
||||||
:param int valid: 导出子域的有效性(默认None)
|
:param int valid: 导出子域的有效性(默认None)
|
||||||
:param str format: 导出格式(默认xlsx)
|
:param str format: 导出格式(默认xls)
|
||||||
:param str dpath: 导出目录(默认None)
|
:param str dpath: 导出目录(默认None)
|
||||||
:param bool show: 终端显示导出数据(默认False)
|
:param bool show: 终端显示导出数据(默认False)
|
||||||
"""
|
"""
|
||||||
formats = ['csv', 'tsv', 'json', 'yaml', 'html',
|
formats = ['txt', 'rst', 'csv', 'tsv', 'json', 'yaml', 'html',
|
||||||
'latex', 'xls', 'xlsx', 'dbf', 'ods']
|
'jira', 'xls', 'xlsx', 'dbf', 'latex', 'ods']
|
||||||
if format not in formats:
|
if format not in formats:
|
||||||
logger.log('FATAL', f'不支持{format}格式导出')
|
logger.log('FATAL', f'不支持{format}格式导出')
|
||||||
return
|
return
|
||||||
@@ -61,12 +61,14 @@ def export(table, db=None, valid=None, dpath=None, format='xlsx', show=False):
|
|||||||
rows = database.get_data(table) # 意外情况导出全部子域
|
rows = database.get_data(table) # 意外情况导出全部子域
|
||||||
if show:
|
if show:
|
||||||
print(rows.dataset)
|
print(rows.dataset)
|
||||||
logger.log('INFOR', f'正在将数据库中{table}表导出')
|
if format == 'txt':
|
||||||
data = rows.export(format)
|
data = str(rows.dataset)
|
||||||
|
else:
|
||||||
|
data = rows.export(format)
|
||||||
database.close()
|
database.close()
|
||||||
fpath = dpath.joinpath(f'{table}.{format}')
|
fpath = dpath.joinpath(f'{table}.{format}')
|
||||||
try:
|
try:
|
||||||
with open(fpath, 'w') as file:
|
with open(fpath, 'w', encoding="utf-8", newline='') as file:
|
||||||
file.write(data)
|
file.write(data)
|
||||||
logger.log('INFOR', '成功完成导出')
|
logger.log('INFOR', '成功完成导出')
|
||||||
logger.log('INFOR', fpath)
|
logger.log('INFOR', fpath)
|
||||||
@@ -81,3 +83,4 @@ def export(table, db=None, valid=None, dpath=None, format='xlsx', show=False):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
fire.Fire(export)
|
fire.Fire(export)
|
||||||
|
# export('example_com_last', format='txt')
|
||||||
|
|||||||
@@ -58,19 +58,19 @@ class OneForAll(object):
|
|||||||
参数valid可选值1,0,None分别表示导出有效,无效,全部子域
|
参数valid可选值1,0,None分别表示导出有效,无效,全部子域
|
||||||
参数verify为True会尝试解析和请求子域并根据结果给子域有效性打上标签
|
参数verify为True会尝试解析和请求子域并根据结果给子域有效性打上标签
|
||||||
参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置
|
参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置
|
||||||
参数format可选格式有'csv', 'tsv', 'json', 'yaml', 'html', 'xls', 'xlsx',
|
参数format可选格式有'txt', 'rst', 'csv', 'tsv', 'json', 'yaml', 'html',
|
||||||
'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: 请求验证的端口范围(默认medium)
|
||||||
:param int valid: 导出子域的有效性(默认1)
|
:param int valid: 导出子域的有效性(默认1)
|
||||||
:param str format: 导出格式(默认xlsx)
|
:param str format: 导出格式(默认xls)
|
||||||
: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='medium', valid=1,
|
||||||
format='xlsx', show=False):
|
format='xls', 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