OneForAll README

The project's README from github.com/shmilylty/OneForAll. As one markdown file: README.md.

OneForAll

Build Status codecov Maintainability License python python

👊OneForAll是一款功能强大的子域收集工具 📝English Document

Example

🚀上手指南

📢 请务必花一点时间阅读此文档,有助于你快速熟悉OneForAll!

🐍安装要求

OneForAll基于Python 3.6.0开发和测试,OneForAll需要高于Python 3.6.0的版本才能运行。 安装Python环境可以参考Python 3 安装指南。运行以下命令检查Python和pip3版本:

python -V
pip3 -V

如果你看到类似以下的输出便说明Python环境没有问题:

Python 3.6.0
pip 19.2.2 from C:\Users\shmilylty\AppData\Roaming\Python\Python36\site-packages\pip (python 3.6)
✔安装步骤(git 版)
  1. 下载

由于该项目处于开发中,会不断进行更新迭代,下载时请使用git clone克隆最新代码仓库,也方便后续的更新,不推荐从Releases下载,因为Releases里版本更新缓慢,也不方便更新, 本项目已经在码云(Gitee)镜像了一份,国内推荐使用码云进行克隆比较快:

git clone https://gitee.com/shmilylty/OneForAll.git

或者:

git clone https://github.com/shmilylty/OneForAll.git
  1. 安装

你可以通过pip3安装OneForAll的依赖,以下为Windows系统下使用pip3安装依赖的示例:注意:如果你的Python3安装在系统Program Files目录下,如:C:\Program Files\Python36,那么请以管理员身份运行命令提示符cmd执行以下命令!

cd OneForAll/
python3 -m pip install -U pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple/
pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
python3 oneforall.py --help

其他系统平台的请参考依赖安装,如果在安装依赖过程中发现编译某个依赖库失败时可以参考常见问题与回答.md文档中解决方法,如果依然不能解决欢迎加群反馈问题。

  1. 更新

执行以下命令更新项目(可保存对/config/setting.py和/config/api.py的修改):

git stash        # 暂存本地的修改
git fetch --all  # 拉取项目更新
git pull         # 下载覆盖
git stash pop    # 释放本地修改
✔安装步骤(docker 版)

首先下载并编辑配置文件,添加自己的api和个性化设置,并保留原始文件结构

config
├── api.py
├── default.py
├── __init__.py
├── log.py
└── setting.py

拉取镜像并执行,其中~/.config替换为你自己配置文件所在文件夹的路径

docker pull shmilylty/oneforall
docker run -it --rm -v ~/results:/OneForAll/results -v ~/.config:/OneForAll/config shmilylty/oneforall --target example.com run

参数直接加在指令末尾,结果会输出在本地目录~/results,如需保存到其他位置,可以自行修改

✨使用演示

如果你是通过pip3安装的依赖则使用以下命令运行示例:

python3 oneforall.py --target example.com run
python3 oneforall.py --targets ./example.txt run

Example

🧐结果说明

我们以python3 oneforall.py --target example.com run命令为例,OneForAll在默认参数正常执行完毕会在results目录生成相应结果:

Result

example.com.csv是每个主域下的子域收集结果。

all_subdomain_result_1583034493.csv是每次运行OneForAll收集到子域的汇总结果,包含example.com.csv,方便在批量收集场景中获取全部结果。

result.sqlite3是存放每次运行OneForAll收集到子域的SQLite3结果数据库,其数据库结构如下图:

Database

其中类似example_com_origin_result表存放每个模块最初子域收集结果。

其中类似example_com_resolve_result表存放对子域进行解析后的结果。

其中类似example_com_last_result表存放上一次子域收集结果(需要收集两次以上才会生成)。

其中类似example_com_now_result表存放现在子域收集结果,一般情况关注这张表就可以了。

更多信息请参阅字段解释说明。

🤔使用帮助

命令行参数只提供了一些常用参数,更多详细的参数配置请见setting.py,如果你认为有些参数是命令界面经常使用到的或缺少了什么参数等问题非常欢迎反馈。由于众所周知的原因,如果要使用一些被墙的收集接口请先到setting.py配置代理,有些收集模块需要提供API(大多都是可以注册账号免费获取),如果需要使用请到api.py配置API信息,如果不使用请忽略有关报错提示。(详细模块请阅读收集模块说明)

OneForAll命令行界面基于Fire实现,有关Fire更高级使用方法请参阅使用Fire CLI。

oneforall.py是主程序入口,oneforall.py可以调用brute.py,takerover.py及dbexport.py等模块,为了方便进行子域爆破独立出了brute.py,为了方便进行子域接管风险检查独立出了takerover.py,为了方便数据库导出独立出了dbexport.py,这些模块都可以单独运行,并且所接受参数要更丰富一点,如果要单独使用这些模块请参考使用帮助

❗注意:当你在使用过程中遇到一些问题或者疑惑时,请先到Issues里使用搜索找找答案,还可以参阅常见问题与回答。

oneforall.py使用帮助

以下帮助信息可能不是最新的,你可以使用python oneforall.py --help获取最新的帮助信息。

python oneforall.py --help
NAME
    oneforall.py - OneForAll帮助信息

SYNOPSIS
    oneforall.py COMMAND | --target=TARGET <flags>

DESCRIPTION
    OneForAll是一款功能强大的子域收集工具

    Example:
        python3 oneforall.py version
        python3 oneforall.py --target example.com run
        python3 oneforall.py --targets ./domains.txt run
        python3 oneforall.py --target example.com --valid None run
        python3 oneforall.py --target example.com --brute True run
        python3 oneforall.py --target example.com --port small run
        python3 oneforall.py --target example.com --fmt csv run
        python3 oneforall.py --target example.com --dns False run
        python3 oneforall.py --target example.com --req False run
        python3 oneforall.py --target example.com --takeover False run
        python3 oneforall.py --target example.com --show True run

    Note:
        参数alive可选值True,False分别表示导出存活,全部子域结果
        参数port可选值有'default', 'small', 'large', 详见config.py配置
        参数fmt可选格式有 'csv','json'
        参数path默认None使用OneForAll结果目录生成路径

ARGUMENTS
    TARGET
        单个域名(二选一必需参数)
    TARGETS
        每行一个域名的文件路径(二选一必需参数)

FLAGS
    --brute=BRUTE
        s
    --dns=DNS
        DNS解析子域(默认True)
    --req=REQ
        HTTP请求子域(默认True)
    --port=PORT
        请求验证子域的端口范围(默认只探测80端口)
    --valid=VALID
        只导出存活的子域结果(默认False)
    --fmt=FMT
        结果保存格式(默认csv)
    --path=PATH
        结果保存路径(默认None)
    --takeover=TAKEOVER
        检查子域接管(默认False)

🎉项目简介

项目地址:https://github.com/shmilylty/OneForAll

在渗透测试中信息收集的重要性不言而喻,子域收集是信息收集中必不可少且非常重要的一环,目前网上也开源了许多子域收集的工具,但是总是存在以下部分问题:

为了解决以上痛点,此项目应用而生,正如其名,我希望OneForAll是一款集百家之长,功能强大的全面快速子域收集终极神器🔨。

目前OneForAll还在开发中,肯定有不少问题和需要改进的地方,欢迎大佬们提交Issues和PR,用着还行给个小星星✨吧,目前有一个专门用于OneForAll交流和反馈QQ群👨‍👨‍👦‍👦::824414244(加群验证:信息收集)。

👍功能特性

如果你有其他很棒的想法请务必告诉我!😎

🌲目录结构

更多信息请参阅目录结构说明。

本项目docs目录下还提供了一些帮助与说明,如子域字典来源说明、泛解析判断流程。

👏用到框架

感谢这些伟大优秀的Python库!

🔖版本控制

该项目使用SemVer语言化版本格式进行版本管理,你可以参阅变更记录说明了解历史变更情况。

⌛后续计划

更多信息请参阅后续开发计划。

🙏贡献

非常热烈欢迎各位大佬一起完善本项目!

👨‍💻贡献者

你可以在贡献者文档中查看所有贡献者以及他们所做出的贡献,感谢他们让OneForAll变得更强大好用。

☕赞赏

如果你觉得这个项目帮助到了你,你可以打赏一杯咖啡以资鼓励:)

📄版权

该项目签署了GPL-3.0授权许可,详情请参阅LICENSE。

😘鸣谢

感谢网上开源的各个子域收集项目!

感谢A-Team大哥们热情无私的问题解答!

📜免责声明

本工具仅能在取得足够合法授权的企业安全建设中使用,在使用本工具过程中,您应确保自己所有行为符合当地的法律法规。 如您在使用本工具的过程中存在任何非法行为,您将自行承担所有后果,本工具所有开发者和所有贡献者不承担任何法律及连带责任。 除非您已充分阅读、完全理解并接受本协议所有条款,否则,请您不要安装并使用本工具。 您的使用行为或者您以其他任何明示或者默示方式表示接受本协议的,即视为您已阅读并同意本协议的约束。

💖Star趋势

Stargazers over time

OneForAll (shmilylty/OneForAll)

Searching Database…

10.1K ·GitHub
What is this?OneForAll is a powerful subdomain collection tool: point it at a target domain and it gathers subdomains from many sources — a core reconnaissance step in penetration testing, which is why the author built it.
Do I drive it from the terminal, or does it have a graphical interface?It is a pure command-line tool: oneforall.py is the entry point and the CLI is generated with Python Fire. There is no GUI yet — a friendly frontend is on the author's roadmap.
How do I get it running?Clone the repo with git and install the dependencies with pip3 (there is also a Docker route). Then run: python3 oneforall.py --target example.com run — results are written to the results directory.
What do I need installed first?Python above 3.6.0 with pip3 — the tool was developed and tested on Python 3.6.0. On Windows, if Python sits in Program Files, run cmd as administrator for the dependency install.
Do all the collection sources work out of the box?No — some modules need API keys, most of them free after a quick account registration; you configure them in api.py. Some interfaces are blocked in China, so set a proxy in setting.py; errors from unused sources can be ignored.
Will it run on Windows, or is it a Linux-only tool?It is cross-platform: the README walks through a Windows pip3 install, and being Python 3-based it also runs on macOS and Linux — plus there is a Docker image for servers.
How does it actually find subdomains?Via about 65 modules in seven categories: certificate transparency (crt.sh, censys and more), DNS datasets (24 modules like SecurityTrails and DNSDumpster), 18 search engines (Google, Bing, GitHub and more), threat intel platforms (VirusTotal, AlienVault), DNS queries for SRV, MX, NS, SOA and TXT records, zone transfers and NSEC walking, plus web archives — and it also brute-forces with dictionaries and fuzz mode, crawls page and JS content, and permutes known subdomains.
How fast does it go through domains?Very fast: bruteforcing is delegated to massdns, which resolves more than 350,000 domains per second, collection modules run on multiple threads, and verification DNS and HTTP checks use async coroutines.
Does it check for subdomain takeover?Yes — takeover risk checks are enabled by default and support batch checking. It can even attempt automatic takeover of vulnerable subdomains, though for now that only works for Github and is still being improved.
Can I point it at any domain I want?No. The README's disclaimer says the tool may only be used in legally authorized enterprise security work, and you alone are responsible for keeping your actions within local laws — the developers take no liability.
Creator
shmilylty
Size
105.5 MB
Stars
10.1K
Age
7y
Commits · 90 Days