就像是带挡板的保龄球。 - @ippsec
AutoRecon 是一款多线程网络侦察工具,能够自动对服务进行枚举。它旨在为 CTF 和其他渗透测试环境(例如 OSCP)节省时间。在实际的渗透测试任务中也可能有用。
该工具的工作流程是:首先执行端口扫描/服务检测扫描。根据初始结果,工具会使用多种不同的工具对这些服务启动进一步的枚举扫描。例如,如果发现 HTTP 服务,将会启动 feroxbuster(以及其他工具)。
工具中的一切都是高度可配置的。默认配置不会进行任何自动化利用,以符合 OSCP 考试规则。如果你想向配置中添加自动利用工具,风险自负。作者不对因误用本工具而产生的负面行为承担责任。
免责声明:尽管 AutoRecon 尽力对尽可能多的服务进行识别和枚举,但不保证每个服务都能被识别,也不保证每个服务都能被完全枚举。AutoRecon 的用户(尤其是学生)应当同时进行手动枚举。不要仅依赖此工具参加考试、CTF 或其他活动。
AutoRecon 的灵感来源于作者在 OSCP 实验室中使用的三个工具:Reconnoitre、ReconScan 和 bscan。虽然这三个工具都有用,但单独使用任何一个都无法完全满足需求。AutoRecon 结合了上述工具的最佳特性,同时还实现了许多新功能,帮助测试人员对多个目标进行枚举。
有四种方式安装 AutoRecon:pipx、pip、手动安装 以及 Docker。在通过任何这些方法安装之前,需要满足某些先决条件。如果你最近没有刷新过 apt 缓存,请运行以下命令以便安装最新的可用包:```bash sudo apt update
### Python 3
AutoRecon 需要使用 Python 3.8+ 和 pip,可以通过以下命令在 Kali Linux 上安装:```bash
sudo apt install python3
sudo apt install python3-pip
AutoRecon中使用的几个命令引用了SecLists项目,位于目录/usr/share/seclists/。你可以手动下载SecLists项目到该目录(https://github.com/danielmiessler/SecLists),或者如果你使用的是Kali Linux(强烈推荐),你可以运行以下命令:```bash sudo apt install seclists
如果你没有安装 SecLists,AutoRecon 仍然会运行,但一些命令可能会失败,而且一些手动命令也可能不会运行。
此外,根据你的操作系统,可能需要安装以下命令:```
curl
dnsrecon
enum4linux
feroxbuster
gobuster
impacket-scripts
nbtscan
nikto
nmap
onesixtyone
oscanner
redis-tools
smbclient
smbmap
snmpwalk
sslscan
svwar
tnscmd10g
whatweb
在 Kali Linux 上,你可以使用以下命令确保所有这些都已安装:```bash sudo apt install seclists curl dnsrecon enum4linux feroxbuster gobuster impacket-scripts nbtscan nikto nmap onesixtyone oscanner redis-tools smbclient smbmap snmp sslscan sipvicious tnscmd10g whatweb
### 安装方法 #1:pipx(推荐)
建议您使用 `pipx` 安装 AutoRecon。pipx 将 AutoRecon 安装在其自己的虚拟环境中,并使其在全局上下文中可用,从而避免包依赖冲突及其导致的不稳定性。首先,使用以下命令安装 pipx:```bash
sudo apt install python3-venv
python3 -m pip install --user pipx
python3 -m pipx ensurepath
你将需要重新加载 ~/.bashrc 或 ~/.zshrc 文件(或打开一个新标签页)才能使用 pipx。
使用以下命令安装 AutoRecon:
pipx install git+https://github.com/Tib3rius/AutoRecon.git
``````bash
pipx install git+https://github.com/Tib3rius/AutoRecon.git
请注意,如果您想使用 sudo 运行 AutoRecon(这是更快地进行 SYN 扫描和 UDP 扫描所必需的),您必须使用 一种 以下示例:```bash sudo env "PATH=$PATH" autorecon [OPTIONS] sudo $(which autorecon) [OPTIONS]
### 安装方法 #2:pip
或者,你可以使用 `pip` 通过以下命令安装 AutoRecon:```bash
python3 -m pip install git+https://github.com/Tib3rius/AutoRecon.git
请注意,如果你想使用sudo运行AutoRecon(为更快的SYN扫描和UDP扫描所需),你将必须以root用户(或使用sudo)运行上述命令。
类似于pipx,如果通过pip安装,你可以简单地执行autorecon来运行AutoRecon。
如果你更倾向于不使用pip或pipx,你仍然可以手动将autorecon.py作为脚本安装和执行。在AutoRecon目录内,安装依赖:```bash
python3 -m pip install -r requirements.txt
然后您将能够运行 `autorecon.py` 脚本:```bash
python3 autorecon.py [OPTIONS] 127.0.0.1
使用pipx安装AutoRecon后,升级是最容易的,这也是推荐该安装方法的原因。只需运行以下命令:```bash pipx upgrade autorecon
### pip
如果你已使用pip安装了AutoRecon,你需要先卸载AutoRecon,然后使用相同的安装命令重新安装:```bash
python3 -m pip uninstall autorecon
python3 -m pip install git+https://github.com/Tib3rius/AutoRecon.git
如果您已手动安装 AutoRecon,只需切换到 AutoRecon 目录并运行以下命令:```bash git pull
假设你没有修改AutoRecon目录中的任何内容,这将从GitHub仓库拉取最新代码,之后你可以像往常一样通过 autorecon.py 脚本运行AutoRecon。
### Plugins
插件更新流程正在开发中。在那之前,升级后请删除 ~/.local/share/AutoRecon 目录,然后运行AutoRecon(带上任意参数)以重新填充最新文件。
## Usage
AutoRecon使用Python 3特有的功能,不支持Python 2。```
usage: autorecon [-t TARGET_FILE] [-p PORTS] [-m MAX_SCANS] [-mp MAX_PORT_SCANS] [-c CONFIG_FILE] [-g GLOBAL_FILE] [--tags TAGS]
[--exclude-tags TAGS] [--port-scans PLUGINS] [--service-scans PLUGINS] [--reports PLUGINS] [--plugins-dir PLUGINS_DIR]
[--add-plugins-dir PLUGINS_DIR] [-l [TYPE]] [-o OUTPUT] [--single-target] [--only-scans-dir] [--no-port-dirs]
[--heartbeat HEARTBEAT] [--timeout TIMEOUT] [--target-timeout TARGET_TIMEOUT] [--nmap NMAP | --nmap-append NMAP_APPEND]
[--proxychains] [--disable-sanity-checks] [--disable-keyboard-control] [--force-services SERVICE [SERVICE ...]] [--accessible]
[-v] [--version] [--curl.path VALUE] [--dirbuster.tool {feroxbuster,gobuster,dirsearch,ffuf,dirb}]
[--dirbuster.wordlist VALUE [VALUE ...]] [--dirbuster.threads VALUE] [--dirbuster.ext VALUE]
[--onesixtyone.community-strings VALUE] [--global.username-wordlist VALUE] [--global.password-wordlist VALUE]
[--global.domain VALUE] [-h]
[targets ...]
Network reconnaissance tool to port scan and automatically enumerate services found on multiple targets.
positional arguments:
targets IP addresses (e.g. 10.0.0.1), CIDR notation (e.g. 10.0.0.1/24), or resolvable hostnames (e.g. foo.bar) to scan.
optional arguments:
-t TARGET_FILE, --target-file TARGET_FILE
Read targets from file.
-p PORTS, --ports PORTS
Comma separated list of ports / port ranges to scan. Specify TCP/UDP ports by prepending list with T:/U: To scan both
TCP/UDP, put port(s) at start or specify B: e.g. 53,T:21-25,80,U:123,B:123. Default: None
-m MAX_SCANS, --max-scans MAX_SCANS
The maximum number of concurrent scans to run. Default: 50
-mp MAX_PORT_SCANS, --max-port-scans MAX_PORT_SCANS
The maximum number of concurrent port scans to run. Default: 10 (approx 20% of max-scans unless specified)
-c CONFIG_FILE, --config CONFIG_FILE
Location of AutoRecon's config file. Default: ~/.config/AutoRecon/config.toml
-g GLOBAL_FILE, --global-file GLOBAL_FILE
Location of AutoRecon's global file. Default: ~/.config/AutoRecon/global.toml
--tags TAGS Tags to determine which plugins should be included. Separate tags by a plus symbol (+) to group tags together. Separate
groups with a comma (,) to create multiple groups. For a plugin to be included, it must have all the tags specified in
at least one group. Default: default
--exclude-tags TAGS Tags to determine which plugins should be excluded. Separate tags by a plus symbol (+) to group tags together. Separate
groups with a comma (,) to create multiple groups. For a plugin to be excluded, it must have all the tags specified in
at least one group. Default: None
--port-scans PLUGINS Override --tags / --exclude-tags for the listed PortScan plugins (comma separated). Default: None
--service-scans PLUGINS
Override --tags / --exclude-tags for the listed ServiceScan plugins (comma separated). Default: None
--reports PLUGINS Override --tags / --exclude-tags for the listed Report plugins (comma separated). Default: None
--plugins-dir PLUGINS_DIR
The location of the plugins directory. Default: ~/.local/share/AutoRecon/plugins
--add-plugins-dir PLUGINS_DIR
The location of an additional plugins directory to add to the main one. Default: None
-l [TYPE], --list [TYPE]
List all plugins or plugins of a specific type. e.g. --list, --list port, --list service
-o OUTPUT, --output OUTPUT
The output directory for results. Default: results
--single-target Only scan a single target. A directory named after the target will not be created. Instead, the directory structure will
be created within the output directory. Default: False
--only-scans-dir Only create the "scans" directory for results. Other directories (e.g. exploit, loot, report) will not be created.
Default: False
--no-port-dirs Don't create directories for ports (e.g. scans/tcp80, scans/udp53). Instead store all results in the "scans" directory
itself. Default: False
--heartbeat HEARTBEAT
Specifies the heartbeat interval (in seconds) for scan status messages. Default: 60
--timeout TIMEOUT Specifies the maximum amount of time in minutes that AutoRecon should run for. Default: None
--target-timeout TARGET_TIMEOUT
Specifies the maximum amount of time in minutes that a target should be scanned for before abandoning it and moving on.
Default: None
--nmap NMAP Override the {nmap_extra} variable in scans. Default: -vv --reason -Pn -T4
--nmap-append NMAP_APPEND
Append to the default {nmap_extra} variable in scans. Default:
--proxychains Use if you are running AutoRecon via proxychains. Default: False
--disable-sanity-checks
Disable sanity checks that would otherwise prevent the scans from running. Default: False
--disable-keyboard-control
Disables keyboard control ([s]tatus, Up, Down) if you are in SSH or Docker.
--force-services SERVICE [SERVICE ...]
A space separated list of services in the following style: tcp/80/http tcp/443/https/secure
--accessible Attempts to make AutoRecon output more accessible to screenreaders. Default: False
-v, --verbose Enable verbose output. Repeat for more verbosity.
--version Prints the AutoRecon version and exits.
-h, --help Show this help message and exit.
plugin arguments:
These are optional arguments for certain plugins.
--curl.path VALUE The path on the web server to curl. Default: /
--dirbuster.tool {feroxbuster,gobuster,dirsearch,ffuf,dirb}
The tool to use for directory busting. Default: feroxbuster
--dirbuster.wordlist VALUE [VALUE ...]
The wordlist(s) to use when directory busting. Separate multiple wordlists with spaces. Default: ['/root/.local/share/AutoRecon/wordlists/dirbuster.txt']
--dirbuster.threads VALUE
The number of threads to use when directory busting. Default: 10
--dirbuster.ext VALUE
The extensions you wish to fuzz (no dot, comma separated). Default: txt,html,php,asp,aspx,jsp
--dirbuster.recursive
Enables recursive searching (where available). Warning: This may cause significant increases to scan times. Default: False
--dirbuster.extras VALUE
Any extra options you wish to pass to the tool when it runs. e.g. --dirbuster.extras='-s 200,301 --discover-backup'
--enum4linux.tool {enum4linux-ng,enum4linux}
The tool to use for doing Windows and Samba enumeration. Default: enum4linux-ng
--onesixtyone.community-strings VALUE
The file containing a list of community strings to try. Default: /usr/share/seclists/Discovery/SNMP/common-snmp-community-strings-onesixtyone.txt
--redirect-host-discovery.update-hosts
If set, discovered redirect hostnames will be added to /etc/hosts with the target IP
--subdomain-enum.domain VALUE
The domain to use as the base domain (e.g. example.com) for subdomain enumeration. Default: None
--subdomain-enum.wordlist VALUE [VALUE ...]
The wordlist(s) to use when enumerating subdomains. Separate multiple wordlists with spaces. Default: ['/usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt']
--subdomain-enum.threads VALUE
The number of threads to use when enumerating subdomains. Default: 10
--vhost-enum.hostname VALUE
The hostname to use as the base host (e.g. example.com) for virtual host enumeration. Default: None
--vhost-enum.wordlist VALUE [VALUE ...]
The wordlist(s) to use when enumerating virtual hosts. Separate multiple wordlists with spaces. Default: ['/usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt']
--vhost-enum.threads VALUE
The number of threads to use when enumerating virtual hosts. Default: 10
--wpscan.api-token VALUE
An API Token from wpvulndb.com to help search for more vulnerabilities.
global plugin arguments:
These are optional arguments that can be used by all plugins.
--global.username-wordlist VALUE
A wordlist of usernames, useful for bruteforcing. Default: /usr/share/seclists/Usernames/top-usernames-shortlist.txt
--global.password-wordlist VALUE
A wordlist of passwords, useful for bruteforcing. Default: /usr/share/seclists/Passwords/darkweb2017-top100.txt
--global.domain VALUE
The domain to use (if known). Used for DNS and/or Active Directory. Default: None
AutoRecon 支持四级详细程度:
注意:您可以通过按向上和向下箭头键在扫描过程中更改 AutoRecon 的详细程度。
默认情况下,结果将存储在 ./results 目录中。每个目标都会创建一个新的子目录。该子目录的结构是:``` . ├── exploit/ ├── loot/ ├── report/ │ ├── local.txt │ ├── notes.txt │ ├── proof.txt │ └── screenshots/ └── scans/ ├── _commands.log ├── _manual_commands.txt ├── tcp80/ ├── udp53/ └── xml/
exploit目录用于存放你为目标下载或编写的漏洞利用代码。
loot目录用于存放你在目标上找到的战利品(例如哈希值、有趣的文件)。
report目录包含一些自动生成的文件和目录,对报告编写很有用:
* local.txt 可用于存储目标上找到的 local.txt 标志。
* notes.txt 应包含一个基本模板,你可以在其中为每个发现的服务编写笔记。
* proof.txt 可用于存储目标上找到的 proof.txt 标志。
* screenshots 目录用于存放你在利用目标过程中使用的截图。
scans目录存放 AutoRecon 执行的所有扫描结果,包括端口扫描/服务检测扫描以及任何服务枚举扫描。它还包含另外两个文件:
* \_commands.log 包含 AutoRecon 对目标执行的每条命令的列表。这在某个命令失败、你希望修改后重新运行时非常有用。
* \_manual_commands.txt 包含任何被认为“过于危险”而无法自动运行的命令,原因可能是它们过于侵入性、需要基于人工分析进行修改,或者在有人监控时效果更好。
默认情况下,会为每个开放端口创建一个目录(例如 tcp80、udp53),并在相应目录中存储在该端口上发现的服务扫描结果。你可以使用 `--no-port-dirs` 命令行选项禁用此行为,此时扫描结果将直接存储在 scans 目录中。
如果扫描出错,scans 目录中还会出现一个名为 `\_errors.log` 的文件,其中包含一些详细信息以提醒用户。
如果输出与定义的模式匹配,scans 目录中还会出现一个名为 `\_patterns.log` 的文件,其中包含匹配输出的详细信息。
`scans/xml` 目录单独存储任何 XML 输出(例如来自 Nmap 扫描的结果),以避免 scans 主目录过于杂乱。
## 用户评价
> AutoRecon 在我参加 OSCP 考试时发挥了不可估量的作用,因为它让我免于手动执行那些繁琐的主动信息收集命令。我可以直接开始处理一个目标,所有需要的信息都清晰地摆在我面前。我强烈推荐任何在 PWK 实验室、OSCP 考试或 VulnHub、HTB 等环境中的人使用这个工具。无论是刚开始接触 OffSec 的新手,还是经验丰富的老手,它都是一款出色的工具。只要确保你在两者之间的某个阶段,花时间了解“引擎盖下”发生了什么,以及它如何/为何进行扫描。
>
>\- b0ats(攻克 5/5 台考试主机)
> 哇,真是个了不起的发现!在使用 AutoRecon 之前,ReconScan 是我在目标上首选的枚举脚本,因为它能在发现开放端口后自动运行枚举命令。唯一缺少的是自动创建渗透测试人员在参与过程中可能需要的关键目录(exploit、loot、report、scans)。Reconnoitre 做到了这一点,但不会自动为你运行这些命令。我曾以为 ReconScan 是终极工具,直到我尝试了 AutoRecon。它太棒了!它结合了 Reconnoitre(自动创建目录)和 ReconScan(自动执行枚举命令)的最佳功能。我只需要在单个目标或一组目标上运行它,然后在我继续剩余扫描的同时,开始查看它已经收集的信息。事实证明一切尽在掌握 :) 通过了 OSCP 考试!感谢 Tib3rius!
>
>\- werk0ut
> 一位朋友向我推荐了 AutoRecon,于是我在 PWK 实验室里试了试。AutoRecon 启动了我们都常用的工具,无论是 nmap 还是 nikto,并且还根据你攻击的目标创建了一个漂亮的子文件夹系统。AutoRecon 最强大的功能是速度;在 OSCP 考试中,我将工具放在后台运行,同时开始处理另一个目标,几分钟后,所有 AutoRecon 的输出就已经在等着我了。AutoRecon 会创建一个包含你应该手动尝试的命令的文件,其中一些可能需要调整(例如,hydra 暴力破解命令)。拥有这样一份额外的检查清单非常好。
>
>\- tr3mb0(攻克 4/5 台考试主机)
> 在我学习 OSCP 并建立渗透测试方法论的过程中,接触到 AutoRecon 完全改变了我的游戏规则。AutoRecon 是一个多线程侦察工具,它整合并自动化了流行的枚举工具,替你完成了大部分艰苦工作。没有比这更好的了!在我的 OSCP 考试主机上运行 AutoRecon 后,我获得了一个装满信息的宝箱,这帮助我着手处理每台主机并一次性通过了考试。这个工具最好的部分是,它会根据初始端口扫描结果自动启动进一步的枚举扫描(例如,如果检测到 SMB,则运行 enum4linux)。唯一不好的地方是,我没有早点使用这个工具!感谢 Tib3rius。
>
>\- rufy(攻克 4/5 台考试主机)
> AutoRecon 允许安全研究人员迭代扫描主机并识别潜在的攻击向量。其真正威力在于,攻击者可以在处理另一台主机时在后台执行扫描。我可以启动扫描,完成我正在处理的特定主机,然后返回发现所有相关扫描都已完成。然后我就可以立即开始尝试获取初始访问权限,而不是手动执行主动扫描过程。我将在未来的渗透测试和 CTF 中继续使用 AutoRecon,并强烈建议你也这样做。
>
>\- waar(攻克 4.99/5 台考试主机)
> “如果你每天要重复做一项任务超过两次,你就需要把它自动化。”这是前任老板给我的建议。AutoRecon 将这句话铭记于心。无论你是在考试中还是在 PWK 实验室里,都可以启动 AutoRecon,让它发挥魔力。在上次考试中,我在处理缓冲区溢出时运行了它。当我完成时,所有我需要的枚举数据都已经摆在面前供我查阅。10/10 分推荐给任何刚接触 CTF 的人,以及长期从事这方面工作的人。
>
>\- whoisflynn
> 我太爱这个工具了,所以我写了它。
>
>\- Tib3rius(攻克 5/5 台考试主机)
> 我强烈推荐任何准备参加 OSCP、参加 CTF 或使用 HTB 的人来看看这个工具。在 HTB 上使用 AutoRecon 一个月后,我又在 PWK 实验室里使用它,它帮助我通过了 OSCP 考试。如果你在习惯某种枚举方法上遇到困难,我鼓励你遵循这个脚本使用的流程和技术。它消除了你可能习惯的许多繁琐工作,同时提供了组织良好的子目录,让你可以快速检查,以免迷失方向。它提供的那些手动命令非常适合你在无计可施时需要特定处理的情况。这是一个非常有价值的工具,我再怎么推荐也不为过。
>
>\- d0hnuts(攻克 5/5 台考试主机)
> AutoRecon 不仅仅是另一个工具,它是一个用于渗透测试的侦察关联框架。这帮助我在处理其他目标时启动大量扫描。这大大有助于时间管理。它帮助我攻克了 PWK 考试中的 4/5 台靶机!结果:通过!
>
>\- Wh0ami(攻克 4/5 台考试主机)
> 第一次听说 AutoRecon 时,我问自己是否真的需要它,我的枚举能力还可以……我抱着开放的心态尝试了一下,立刻对它生成的信息量感到有些震惊。一旦我习惯了它,并开始阅读输出,我才意识到自己错过了多少信息。我在 OSCP 考试中使用了它,它找到了我本不可能发现的东西。我坚信,如果没有 AutoRecon,我可能会失败。这是一个很棒的工具,我对 Tib3rius 能制作出这样的东西印象深刻。这绝对是我已经向其他人推荐的东西,包括你!
>
>\- othornew
> AutoRecon 帮助我在 OSCP 考试中节省了宝贵的时间,让我花更少的时间扫描系统,更多的时间入侵系统。这个软件物超所值!
>
>\- TorHackr
> 这个神奇的工具让枚举变得轻而易举,只需启动它,就能欣赏多线程的威力,输出大量原本需要执行大量命令才能获得的信息。我坚信,仅仅通过在 OSCP 考试中使用 AutoRecon,一半的努力就已经完成了。强烈推荐!
>
>\- Arman(解决 4.5/5 台考试主机)