进一步完善文档

This commit is contained in:
shmilylty
2019-08-04 05:15:18 +08:00
parent 6a49ee22ab
commit ed0a1ef9cd
2 changed files with 440 additions and 129 deletions
+133 -129
View File
@@ -1,12 +1,10 @@
## OneForAll # OneForAll
README: 简体中文 | [English](./README.en.md) 👊**OneForAll是一款功能强大的子域收集工具** 📝[English Document](./README.en.md)
**OneForAll是一款强大的子域收集神器**
![](./images/All_Might.jpg) ![](./images/All_Might.jpg)
## 项目简介 ## ## 🎉项目简介
在渗透测试中信息收集的重要性不言而喻,子域收集是信息收集中必不可少且非常重要的一环,目前网上也开源了许多子域收集的工具,但是总是存在以下部分问题: 在渗透测试中信息收集的重要性不言而喻,子域收集是信息收集中必不可少且非常重要的一环,目前网上也开源了许多子域收集的工具,但是总是存在以下部分问题:
@@ -17,48 +15,46 @@ README: 简体中文 | [English](./README.en.md)
* **效率问题**,没有利用多进程,多线程以及异步协程技术,速度较慢。 * **效率问题**,没有利用多进程,多线程以及异步协程技术,速度较慢。
为了解决以上痛点,此项目应用而生,OneForAll一词是来自我喜欢的一部日漫《[我的英雄学院](https://manhua.fzdm.com/131/)》,它是一种通过一代代的传承不断变强的潜力无穷的顶级个性,目前[番剧](https://www.bilibili.com/bangumi/media/md7452/)也更新到了第三季了,欢迎大佬们入坑。正如其名,我希望OneForAll是一款集百家之长,功能强大的全面快速子域收集终极神器。 为了解决以上痛点,此项目应用而生,OneForAll一词是来自我喜欢的一部日漫《[我的英雄学院](https://manhua.fzdm.com/131/)》,它是一种通过一代代的传承不断变强的潜力无穷的顶级个性,目前[番剧](https://www.bilibili.com/bangumi/media/md7452/)也更新到了第三季了,欢迎大佬们入坑😄。正如其名,我希望OneForAll是一款集百家之长,功能强大的全面快速子域收集终极神器🔨
目前OneForAll还在开发中,肯定有不少问题和需要改进的地方,欢迎大佬们提交[Issue](https://github.com/shmilylty/OneForAll/issues)和[PR](https://github.com/shmilylty/OneForAll/pulls),用着还行给个小星星吧,目前有一个专门用于OneForAll交流和反馈QQ群:`ODI0NDE0MjQ0`,也可以给我发邮件[admin@hackfun.org]。 目前OneForAll还在开发中,肯定有不少问题和需要改进的地方,欢迎大佬们提交[Issues](https://github.com/shmilylty/OneForAll/issues)和[PR](https://github.com/shmilylty/OneForAll/pulls),用着还行给个小星星吧,目前有一个专门用于OneForAll交流和反馈QQ群👋`824414244`,也可以给我发邮件📧[admin@hackfun.org]。
## 功能特性 ## 👍功能特性
* **收集能力强大**,详细模块请阅读[搜索模块说明](./docs/collection_modules.md)。 * **收集能力强大**,详细模块请阅读[搜索模块说明](./docs/collection_modules.md)。
1. 利用证书透明度收集子域(目前有6个模块:`censys_api``certdb_api``certspotter``crtsh``entrust``google` 1. 利用证书透明度收集子域(目前有6个模块:`censys_api``certdb_api``certspotter``crtsh``entrust``google`
2. 常规检查收集子域(目前有4个模块:域传送漏洞利用`axfr`,检查跨域策略文件`cdx`,检查HTTPS证书`cert`,检查内容安全策略`csp`,后续会添加检查NSEC记录,NSEC记录等模块) 2. 常规检查收集子域(目前有4个模块:域传送漏洞利用`axfr`,检查跨域策略文件`cdx`,检查HTTPS证书`cert`,检查内容安全策略`csp`,后续会添加检查NSEC记录,NSEC记录等模块)
3. 利用网上爬虫档案收集子域(目前有2个模块:`archivecrawl``commoncrawl`,此模块还在调试,该模块还有待添加和完善) 3. 利用网上爬虫档案收集子域(目前有2个模块:`archivecrawl``commoncrawl`,此模块还在调试,该模块还有待添加和完善)
4. 利用DNS数据集收集子域(目前有16个模块:`binaryedge_api`, `circl_api`, `hackertarget`, `riddler`, `bufferover`, `dnsdb`, `ipv4info`, `robtex`, `chinaz`, `dnsdb_api`, `netcraft`, `securitytrails_api`, `chinaz_api`, `dnsdumpster`, `ptrarchive`, `sitedossier` 4. 利用DNS数据集收集子域(目前有16个模块:`binaryedge_api`, `circl_api`, `hackertarget`, `riddler`, `bufferover`, `dnsdb`, `ipv4info`, `robtex`, `chinaz`, `dnsdb_api`, `netcraft`, `securitytrails_api`, `chinaz_api`, `dnsdumpster`, `ptrarchive`, `sitedossier`
5. 利用DNS查询收集子域(目前有1个模块:通过枚举常见的SRV记录并做查询来收集子域`srv`,该模块还有待添加和完善) 5. 利用DNS查询收集子域(目前有1个模块:通过枚举常见的SRV记录并做查询来收集子域`srv`,该模块还有待添加和完善)
6. 利用威胁情报平台数据收集子域(目前有5个模块:`riskiq``threatbook``threatminer``virustotal``virustotal_api`该模块还有待添加和完善) 6. 利用威胁情报平台数据收集子域(目前有5个模块:`riskiq``threatbook``threatminer``virustotal``virustotal_api`该模块还有待添加和完善)
7. 利用搜索引擎发现子域(目前有15个模块:`ask`, `bing_api`, `fofa`, `shodan_api`, `yahoo`, `baidu`, `duckduckgo`, `google`, `so`, `yandex`, `bing`, `exalead`, `google_api`, `sogou`, `zoomeye_api`),在搜索模块中除特殊搜索引擎,通用的搜索引擎都支持自动排除搜索,全量搜索,递归搜索。 7. 利用搜索引擎发现子域(目前有15个模块:`ask`, `bing_api`, `fofa`, `shodan_api`, `yahoo`, `baidu`, `duckduckgo`, `google`, `so`, `yandex`, `bing`, `exalead`, `google_api`, `sogou`, `zoomeye_api`),在搜索模块中除特殊搜索引擎,通用的搜索引擎都支持自动排除搜索,全量搜索,递归搜索。
* **处理功能强大**,发现的子域结果支持自动去除,自动DNS解析,HTTP请求探测,自动移除无效子域,拓展子域的Banner信息,最终支持的导出格式有`csv`, `tsv`, `json`, `yaml`, `html`, `xls`, `xlsx`, `dbf`, `latex`, `ods` * **处理功能强大**,发现的子域结果支持自动去除,自动DNS解析,HTTP请求探测,自动移除无效子域,拓展子域的Banner信息,最终支持的导出格式有`csv`, `tsv`, `json`, `yaml`, `html`, `xls`, `xlsx`, `dbf`, `latex`, `ods`
* **速度极速**[收集模块](./oneforall/collect.py)使用多线程调用,[爆破模块](./oneforall/aiobrute.py)使用异步多进程多协程,DNS解析和HTTP请求使用异步多协程。 * **速度极速**[收集模块](./oneforall/collect.py)使用多线程调用,[爆破模块](./oneforall/aiobrute.py)使用异步多进程多协程,DNS解析和HTTP请求使用异步多协程。
## **上手指南** ## 🚀上手指南
由于该项目处于开发中,会不断进行更新迭代,下载时最好克隆本项目。 由于该项目**处于开发中**,会不断进行更新迭代,下载使用最好**克隆**最新项目。
**安装要求** **🐍安装要求**
1. Python 3.6-3.7 1. Python 3.6-3.7
**安装步骤** **安装步骤**
1. 下载 1. 下载
```bash ```bash
git clone https://github.com/shmilylty/OneForAll.git git clone https://github.com/shmilylty/OneForAll.git
``` ```
或者到[Releases](https://github.com/shmilylty/OneForAll/releases)手动下载。 或者到[Releases](https://github.com/shmilylty/OneForAll/releases)手动下载。
@@ -69,7 +65,7 @@ README: 简体中文 | [English](./README.en.md)
```bash ```bash
pip3 install pipenv pip3 install pipenv
cd OneForAll cd OneForAll/oneforall
pipenv install python 3.7.4 pipenv install python 3.7.4
pipenv run python oneforall.py --help pipenv run python oneforall.py --help
``` ```
@@ -77,165 +73,173 @@ README: 简体中文 | [English](./README.en.md)
* 使用pip3 * 使用pip3
```bash ```bash
cd OneForAll cd OneForAll/oneforall
pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
python3 oneforall.py --help python3 oneforall.py --help
``` ```
**使用帮助** **使用演示**
```bash
python3 oneforall.py --target example.com run
```
![Example](./docs/useage_example.svg)
**🤔使用帮助**
命令行参数只提供了一些常用参数,更多详细的参数配置请见[config.py](./oneforall/config.py),由于众所周知的原因,如果要使用一些被墙的收集接口请先到[config.py](./oneforall/config.py)配置代理,有些收集模块需要提供API(大多都是可以注册账号免费获取),如果需要使用请到[config.py](./oneforall/config.py)配置API信息,如果不使用请忽略有关报错提示。(详细模块请阅读[搜索模块说明](./docs/collection_modules.md) 命令行参数只提供了一些常用参数,更多详细的参数配置请见[config.py](./oneforall/config.py),由于众所周知的原因,如果要使用一些被墙的收集接口请先到[config.py](./oneforall/config.py)配置代理,有些收集模块需要提供API(大多都是可以注册账号免费获取),如果需要使用请到[config.py](./oneforall/config.py)配置API信息,如果不使用请忽略有关报错提示。(详细模块请阅读[搜索模块说明](./docs/collection_modules.md)
OneForAll命令行界面基于[Fire](https://github.com/google/python-fire/)实现,有关Fire更高级使用方法请参阅[使用Fire CLI](https://github.com/google/python-fire/blob/master/docs/using-cli.md),有任何使用疑惑欢迎加群交流。
1. oneforall.py使用帮助 1. oneforall.py使用帮助
```bash ```bash
cd OneForAll
pipenv run python oneforall.py --help pipenv run python oneforall.py --help
``` ```
```bash ```bash
WARNING: The proper way to show help is 'oneforall.py -- --help'. NAME
Showing help anyway. oneforall.py - OneForAll是一款功能强大的子域收集工具
Fire trace: SYNOPSIS
1. Initial component oneforall.py --target=TARGET <flags>
2. ('The function received no value for the required argument:', 'target')
Type: type DESCRIPTION
String form: <class '__main__.OneForAll'> Version: 0.0.2
File: d:\oneforall\oneforall\oneforall.py Project: https://github.com/shmilylty/OneForAll/
Line: 24
Docstring: OneForAll是一款强大的子域收集神器
Version: 0.0.1 Example:
Project: https://github.com/shmilylty/OneForAll/ 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
:param str target: 单个域名或者每行一个域名的文件路径 Note:
:param bool brute: 是否使用爆破模块(默认禁用) 参数valid可选值有1,0,None,分别表示导出有效,无效,全部子域
:param str port: HTTP请求验证的端口范围(默认medium) 参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置
:param int valid: 导出子域的有效性(默认1) 参数format可选格式有'csv','tsv','json','yaml','html','xls','xlsx','dbf','latex','ods'
:param str format: 导出格式(默认xlsx 参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
:param str path: 导出路径(默认None)
:param bool output: 是否将导出数据输出到终端(默认False)
Note: ARGUMENTS
参数valid可选值有1,0,None,分别表示导出有效,无效,全部子域 TARGET
参数port可选值有'small', 'medium', 'large', 'xlarge',详见config.py配置 单个域名或者每行一个域名的文件路径
参数format可选格式有'csv','tsv','json','yaml','html','xls','xlsx','dbf','latex','ods'
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
Example: FLAGS
python oneforall.py --target example.com run --brute=BRUTE
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 --port=PORT
HTTP请求验证的端口范围(默认medium)
Usage: oneforall.py TARGET [BRUTE] [PORT] [VALID] [PATH] [FORMAT] [OUTPUT] --valid=VALID
oneforall.py --target TARGET [--brute BRUTE] [--port PORT] [--valid VALID] [--path PATH] [--format FORMAT] [--output OUTPUT] 导出子域的有效性(默认1)
--path=PATH
导出路径(默认None)
--format=FORMAT
导出格式(默认xlsx)
--output=OUTPUT
是否将导出数据输出到终端(默认False)
``` ```
2. aiobrute.py使用帮助 2. aiobrute.py使用帮助
```bash ```bash
cd OneForAll
pipenv run python aiobrute.py --help pipenv run python aiobrute.py --help
``` ```
```bash ```bash
WARNING: The proper way to show help is 'aiobrute.py -- --help'. NAME
Showing help anyway. aiobrute.py - OneForAll多进程多协程异步子域爆破模块
Fire trace: SYNOPSIS
1. Initial component aiobrute.py --target=TARGET <flags>
2. ('The function received no value for the required argument:', 'target')
Type: type DESCRIPTION
String form: <class '__main__.AIOBrute'> Example
File: d:\oneforall\oneforall\aiobrute.py python aiobrute.py --target example.com run
Line: 122 python aiobrute.py --target ./domains.txt run
Docstring: 多进程多协程异步子域爆破 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: 单个域名或者每行一个域名的文件路径 ARGUMENTS
:param int processes: 爆破的进程数(默认CPU核心数) TARGET
:param int coroutine: 每个爆破进程下的协程数(默认16) 单个域名或者每行一个域名的文件路径
:param str wordlist: 指定爆破所使用的字典路径(默认使用config.py配置)
:param bool recursive: 是否使用递归爆破(默认禁用)
:param int depth: 递归爆破的深度(默认2)
:param str namelist: 指定递归爆破所使用的字典路径(默认使用config.py配置)
:param bool fuzz: 是否使用fuzz模式进行爆破(默认禁用,开启必须指定fuzz正则规则)
:param str rule: fuzz模式使用的正则规则(默认使用config.py配置)
Example FLAGS
python aiobrute.py --target example.com run --processes=PROCESSES
python aiobrute.py --target ./domains.txt run 爆破的进程数(默认CPU核心数)
python aiobrute.py --target example.com --processes 4 --coroutine 64 --wordlist data/subdomains.txt run --coroutine=COROUTINE
python aiobrute.py --target example.com --recursive True --depth 2 --namelist data/next_subdomains.txt run 每个爆破进程下的协程数(默认16)
python aiobrute.py --target www.{fuzz}.example.com --fuzz True --rule [a-z][0-9] run --wordlist=WORDLIST
指定爆破所使用的字典路径(默认使用config.py配置)
Usage: aiobrute.py TARGET [PROCESSES] [COROUTINE] [WORDLIST] [RECURSIVE] [DEPTH] [NAMELIST] [FUZZ] [RULE] --recursive=RECURSIVE
aiobrute.py --target TARGET [--processes PROCESSES] [--coroutine COROUTINE] [--wordlist WORDLIST] [--recursive RECURSIVE] [--depth DEPTH] [--namelist NAMELIST] [--fuzz FUZZ] [--rule RULE] 是否使用递归爆破(默认False)
--depth=DEPTH
递归爆破的深度(默认2)
--namelist=NAMELIST
指定递归爆破所使用的字典路径(默认使用config.py配置)
--fuzz=FUZZ
是否使用fuzz模式进行爆破(默认False,开启必须指定fuzz正则规则)
--rule=RULE
fuzz模式使用的正则规则(默认使用config.py配置)
``` ```
3. dbexport.py使用帮助 3. dbexport.py使用帮助
```bash ```bash
cd OneForAll
pipenv run python dbexport.py --help pipenv run python dbexport.py --help
``` ```
```bash ```bash
WARNING: The proper way to show help is 'dbexport.py -- --help'. NAME
Showing help anyway. dbexport.py - OneForAll数据库导出模块
Fire trace: SYNOPSIS
1. Initial component dbexport.py TABLE <flags>
2. ('The function received no value for the required argument:', 'table')
Type: function DESCRIPTION
String form: <function export at 0x0000025115962048> Example:
File: d:\oneforall\oneforall\dbexport.py python dbexport.py --db result.db --table name --format csv --output False
Line: 8 python dbexport.py --db result.db --table name --format csv --path= ./result.csv
Docstring: 将数据库导出为指定格式文件
:param str table: 要导出的表 Note:
:param str db: 要导出的数据库路径(默认为results/result.sqlite3 参数valid可选值1,0,None,分别表示导出有效,无效,全部子域
:param int valid: 导出子域的有效性(默认None) 参数format可选格式:'csv', 'tsv', 'json', 'yaml', 'html', 'xls', 'xlsx', 'dbf', 'latex', 'ods'
:param str format: 导出格式(默认xlsx 参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
:param str path: 导出路径(默认None)
:param bool output: 是否将导出数据输出到终端(默认False)
Note: POSITIONAL ARGUMENTS
参数valid可选值1,0,None,分别表示导出有效,无效,全部子域 TABLE
参数format可选格式:'csv','tsv','json','yaml','html','xls','xlsx','dbf','latex','ods' 要导出的表
参数path为None会根据format参数和域名名称在项目结果目录生成相应文件
Example: FLAGS
python dbexport.py --db result.db --table name --format csv --output False --db=DB
python dbexport.py --db result.db --table name --format csv --path= ./result.csv 要导出的数据库路径(默认为results/result.sqlite3)
--valid=VALID
导出子域的有效性(默认None)
--path=PATH
导出路径(默认None)
--format=FORMAT
导出格式(默认xlsx)
--output=OUTPUT
是否将导出数据输出到终端(默认False)
Usage: dbexport.py TABLE [DB] [VALID] [PATH] [FORMAT] [OUTPUT] NOTES
dbexport.py --table TABLE [--db DB] [--valid VALID] [--path PATH] [--format FORMAT] [--output OUTPUT] You can also use flags syntax for POSITIONAL ARGUMENTS
``` ```
## 主要框架 ## 👏主要框架
* [aiodns](https://github.com/saghul/aiodns) - 简单DNS异步解析库。 * [aiodns](https://github.com/saghul/aiodns) - 简单DNS异步解析库。
* [aiohttp](https://github.com/aio-libs/aiohttp) - 异步http客户端/服务器框架 * [aiohttp](https://github.com/aio-libs/aiohttp) - 异步http客户端/服务器框架
* [aiomultiprocess](https://github.com/jreese/aiomultiprocess) - 将Python代码提升到更高的性能水平(multiprocessing和asyncio结合,实现异步多进程多协程) * [aiomultiprocess](https://github.com/jreese/aiomultiprocess) - 将Python代码提升到更高的性能水平(multiprocessing和asyncio结合,实现异步多进程多协程)
* [beautifulsoup4](https://pypi.org/project/beautifulsoup4/) - 可以轻松从HTML或XML文件中提取数据的Python库 * [beautifulsoup4](https://pypi.org/project/beautifulsoup4/) - 可以轻松从HTML或XML文件中提取数据的Python库
* [fire](https://github.com/google/python-fire) - Python Fire是一个纯粹根据任何Python对象自动生成命令行界面(CLI)的库 * [fire](https://github.com/google/python-fire) - Python Fire是一个纯粹根据任何Python对象自动生成命令行界面(CLI)的库
* [loguru](https://github.com/Delgan/loguru) - 旨在带来愉快的日志记录Python库 * [loguru](https://github.com/Delgan/loguru) - 旨在带来愉快的日志记录Python库
* [records](https://github.com/kennethreitz/records) - Records是一个非常简单但功能强大的库,用于对大多数关系数据库进行最原始SQL查询。 * [records](https://github.com/kennethreitz/records) - Records是一个非常简单但功能强大的库,用于对大多数关系数据库进行最原始SQL查询。
* [requests](https://github.com/psf/requests) - Requests 唯一的一个非转基因的 Python HTTP 库,人类可以安全享用。
* [tqdm](https://github.com/tqdm/tqdm) - 适用于Python和CLI的快速,可扩展的进度条库 * [tqdm](https://github.com/tqdm/tqdm) - 适用于Python和CLI的快速,可扩展的进度条库
感谢这些伟大优秀的Python库! 感谢这些伟大优秀的Python库!
## 目录结构 ## 🌲目录结构
```bash ```bash
D:. D:.
@@ -271,11 +275,11 @@ D:.
``` ```
## 贡献 ## 🙏贡献
非常热烈欢迎各位大佬一起完善本项目! 非常热烈欢迎各位大佬一起完善本项目!
## 后续计划 ## 后续计划
- [ ] 子域收集模块优化 - [ ] 子域收集模块优化
- [ ] 子域接管功能实现 - [ ] 子域接管功能实现
@@ -284,11 +288,11 @@ D:.
更多详细信息请阅读[TODO.md](./TODO.md)。 更多详细信息请阅读[TODO.md](./TODO.md)。
## 版本控制 ## 🔖版本控制
该项目使用[SemVer](https://semver.org/)语言化版本格式进行版本管理,你可以在[Releases](https://github.com/shmilylty/OneForAll/releases)查看可用版本。 该项目使用[SemVer](https://semver.org/)语言化版本格式进行版本管理,你可以在[Releases](https://github.com/shmilylty/OneForAll/releases)查看可用版本。
## 作者 ## 👨‍💻作者
* **[Jing Ling](https://github.com/shmilylty)** * **[Jing Ling](https://github.com/shmilylty)**
* 核心开发 * 核心开发
@@ -301,16 +305,16 @@ D:.
*你也可以在[CONTRIBUTORS.md](./CONTRIBUTORS.md)中参看所有参与该项目的开发者。* *你也可以在[CONTRIBUTORS.md](./CONTRIBUTORS.md)中参看所有参与该项目的开发者。*
## 版权 ## 📄版权
该项目签署了GPL-3.0授权许可,详情请参阅[LICENSE.md](./LICENSE.md)。 该项目签署了GPL-3.0授权许可,详情请参阅[LICENSE.md](./LICENSE.md)。
## 鸣谢 ## 😘鸣谢
感谢网上开源的各个子域收集项目! 感谢网上开源的各个子域收集项目!
感谢[A-Team](https://github.com/QAX-A-Team)大哥们热情无私的问题解答! 感谢[A-Team](https://github.com/QAX-A-Team)大哥们热情无私的问题解答!
## 免责声明 ## ## 📜免责声明 ##
本工具仅限于安全研究与教学使用,用户使用本工具所造成的所有后果,由用户承担全部法律及连带责任,本项目所有作者和贡献者不承担任何法律及连带责任。 本工具仅限于安全研究与教学使用,用户使用本工具所造成的所有后果,由用户承担全部法律及连带责任,本项目所有作者和贡献者不承担任何法律及连带责任。
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 120 KiB