修改为标准的DocString格式

This commit is contained in:
shmilylty
2019-08-03 16:39:57 +08:00
parent 197712f1d1
commit e9553d1332
3 changed files with 52 additions and 38 deletions
+17 -8
View File
@@ -1,4 +1,13 @@
#!/usr/bin/python3
# coding=utf-8 # coding=utf-8
"""
OneForAll多进程多协程异步子域爆破模块
:copyright: Copyright (c) 2019, Jing Ling. All rights reserved.
:license: GNU General Public License v3.0, see LICENSE for more details.
"""
import os import os
import time import time
import queue import queue
@@ -121,7 +130,14 @@ def gen_brute_domains(domain, path):
class AIOBrute(Module): class AIOBrute(Module):
""" """
多进程多协程异步子域爆破 OneForAll多进程多协程异步子域爆破模块
Example
python aiobrute.py --target example.com run
python aiobrute.py --target ./domains.txt run
python aiobrute.py --target example.com --processes 4 --coroutine 64 --wordlist data/subdomains.txt run
python aiobrute.py --target example.com --recursive True --depth 2 --namelist data/next_subdomains.txt run
python aiobrute.py --target www.{fuzz}.example.com --fuzz True --rule [a-z][0-9] run
:param str target: 单个域名或者每行一个域名的文件路径 :param str target: 单个域名或者每行一个域名的文件路径
:param int processes: 爆破的进程数(默认CPU核心数) :param int processes: 爆破的进程数(默认CPU核心数)
@@ -132,13 +148,6 @@ class AIOBrute(Module):
:param str namelist: 指定递归爆破所使用的字典路径(默认使用config.py配置) :param str namelist: 指定递归爆破所使用的字典路径(默认使用config.py配置)
:param bool fuzz: 是否使用fuzz模式进行爆破(默认禁用,开启必须指定fuzz正则规则) :param bool fuzz: 是否使用fuzz模式进行爆破(默认禁用,开启必须指定fuzz正则规则)
:param str rule: fuzz模式使用的正则规则(默认使用config.py配置) :param str rule: fuzz模式使用的正则规则(默认使用config.py配置)
Example
python aiobrute.py --target example.com run
python aiobrute.py --target ./domains.txt run
python aiobrute.py --target example.com --processes 4 --coroutine 64 --wordlist data/subdomains.txt run
python aiobrute.py --target example.com --recursive True --depth 2 --namelist data/next_subdomains.txt run
python aiobrute.py --target www.{fuzz}.example.com --fuzz True --rule [a-z][0-9] run
""" """
def __init__(self, target, processes=None, coroutine=64, wordlist=None, def __init__(self, target, processes=None, coroutine=64, wordlist=None,
+18 -10
View File
@@ -1,5 +1,13 @@
#!/usr/bin/python3
# coding=utf-8 # coding=utf-8
"""
OneForAll数据库导出模块
:copyright: Copyright (c) 2019, Jing Ling. All rights reserved.
:license: GNU General Public License v3.0, see LICENSE for more details.
"""
import fire import fire
from common import database from common import database
from config import logger from config import logger
@@ -7,7 +15,16 @@ from config import logger
def export(table, db=None, valid=None, path=None, format='xlsx', output=False): def export(table, db=None, valid=None, path=None, format='xlsx', output=False):
""" """
将数据库导出为指定格式文件 OneForAll数据库导出模块
Example:
python dbexport.py --db result.db --table name --format csv --output False
python dbexport.py --db result.db --table name --format csv --path= ./result.csv
Note:
参数valid可选值1,0,None,分别表示导出有效,无效,全部子域
参数format可选格式:'csv','tsv','json','yaml','html','xls','xlsx','dbf','latex','ods'
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
:param str table: 要导出的表 :param str table: 要导出的表
:param str db: 要导出的数据库路径(默认为results/result.sqlite3 :param str db: 要导出的数据库路径(默认为results/result.sqlite3
@@ -15,15 +32,6 @@ def export(table, db=None, valid=None, path=None, format='xlsx', output=False):
:param str format: 导出格式(默认xlsx :param str format: 导出格式(默认xlsx
:param str path: 导出路径(默认None) :param str path: 导出路径(默认None)
:param bool output: 是否将导出数据输出到终端(默认False) :param bool output: 是否将导出数据输出到终端(默认False)
Note:
参数valid可选值1,0,None,分别表示导出有效,无效,全部子域
参数format可选格式:'csv','tsv','json','yaml','html','xls','xlsx','dbf','latex','ods'
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
Example:
python dbexport.py --db result.db --table name --format csv --output False
python dbexport.py --db result.db --table name --format csv --path= ./result.csv
""" """
db_conn = database.connect_db(db) db_conn = database.connect_db(db)
if valid is None: if valid is None:
+17 -20
View File
@@ -2,7 +2,10 @@
# coding=utf-8 # coding=utf-8
""" """
OneForAll是一款强大的子域收集神器 OneForAll是一款功能强大的子域收集工具
:copyright: Copyright (c) 2019, Jing Ling. All rights reserved.
:license: GNU General Public License v3.0, see LICENSE for more details.
""" """
import asyncio import asyncio
@@ -14,20 +17,25 @@ from collect import Collect
from aiobrute import AIOBrute from aiobrute import AIOBrute
from common import utils, database, resolve, request from common import utils, database, resolve, request
__author__ = 'Jing Ling, Black Star'
__contact__ = 'admin@hackfun.org'
__copyright__ = 'Copyright (c) 2019, Jing Ling. All rights reserved.'
__license__ = 'GNU General Public License v3.0'
__version__ = '0.0.1'
class OneForAll(object): class OneForAll(object):
""" """
OneForAll是一款强大的子域收集神器 OneForAll是一款功能强大的子域收集工具
Version: 0.0.1 Version: 0.0.2
Project: https://github.com/shmilylty/OneForAll/ Project: https://github.com/shmilylty/OneForAll/
Example:
python oneforall.py --target example.com run
python oneforall.py --target example.com --brute True --port medium valid 1 run
python oneforall.py --target ./domains.txt --format csv --path= ./result.csv --output True run
Note:
参数valid可选值有1,0,None,分别表示导出有效,无效,全部子域
参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置
参数format可选格式有'csv','tsv','json','yaml','html','xls','xlsx','dbf','latex','ods'
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
:param str target: 单个域名或者每行一个域名的文件路径 :param str target: 单个域名或者每行一个域名的文件路径
:param bool brute: 是否使用爆破模块(默认禁用) :param bool brute: 是否使用爆破模块(默认禁用)
:param str port: HTTP请求验证的端口范围(默认medium) :param str port: HTTP请求验证的端口范围(默认medium)
@@ -35,17 +43,6 @@ class OneForAll(object):
:param str format: 导出格式(默认xlsx :param str format: 导出格式(默认xlsx
:param str path: 导出路径(默认None) :param str path: 导出路径(默认None)
:param bool output: 是否将导出数据输出到终端(默认False) :param bool output: 是否将导出数据输出到终端(默认False)
Note:
参数valid可选值有1,0,None,分别表示导出有效,无效,全部子域
参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置
参数format可选格式有'csv','tsv','json','yaml','html','xls','xlsx','dbf','latex','ods'
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
Example:
python oneforall.py --target example.com run
python oneforall.py --target example.com --brute True --port medium valid 1 run
python oneforall.py --target ./domains.txt --format csv --path= ./result.csv --output True run
""" """
def __init__(self, target, brute=False, port='medium', valid=1, path=None, format='xlsx', output=False): def __init__(self, target, brute=False, port='medium', valid=1, path=None, format='xlsx', output=False):
self.target = target self.target = target