一个用于检测 Log4Shell CVE-2021-44228 漏洞的自动化、可靠扫描器。
视频演示:
以下是帮助用法:
$ python3 log4jhunt.py
+--------------+
Log4JHunt
+--------------+
[+] Log4jHunt by RedHunt Labs - A Modern Attack Surface (ASM) Management Company
[+] Author: Pinaki Mondal (RHL Research Team)
[+] Continuously Track Your Attack Surface using https://redhuntlabs.com/nvadr.
[-] You have to supply at least a single host to scan!
usage: log4jhunt.py [-h] [-u URL] [-f FILE] [-d DELAY] [-t TIMEOUT] [-T TOKEN] [-E EMAIL] [-W WEBHOOK] [-S SERVER] [-ua USERAGENT] [-m METHOD] [-H HEADERS] [-p PROXY]
optional arguments:
-h, --help show this help message and exit
-u URL, --url URL URL to probe for the vulnerability.
-f FILE, --file FILE Specify a file containing list of hosts to scan.
-d DELAY, --delay DELAY
Delay in-between two concurrent requests.
-t TIMEOUT, --timeout TIMEOUT
Scan timeout for a single host.
-T TOKEN, --token TOKEN
Canary token to use in payloads for scanning.
-E EMAIL, --email EMAIL
Email to receive notifications.
-W WEBHOOK, --webhook WEBHOOK
Webhook URL to receive notifications.
-S SERVER, --server SERVER
Custom DNS callback server for receiving notifications.
-ua USERAGENT, --user-agent USERAGENT
Custom user agent string to use for requests.
-m METHOD, --methods METHOD
Comma separated list of HTTP Method to use
-H HEADERS, --headers HEADERS
Comma separated list of custom HTTP headers to use.
-p PROXY, --proxy PROXY
HTTP proxy to use (if any).
该工具使用来自 Canary Tokens 的 Log4Shell 令牌。如果令牌(--token)和服务器(--server)的值为空,该工具能够自动生成令牌。
令牌生成后,令牌和认证值将写入名为 canary-token.json 的文件中。
你可以通过两种模式指定目标:
./log4jhunt.py -u 1.2.3.4:8080 ...
./log4jhunt.py -f targets.txt ...
有两种方式可以接收通知:
--email)-- 由 Canarytokens 提供的服务。--webhook)-- 由 Canarytokens 提供的服务。--server)-- 你自己的自定义 DNS 回调服务器。一旦工具发现易受攻击的服务器,通知将被转发回你偏好的通信渠道。
--methods 自定义 HTTP 方法。--headers 指定一组自定义的 HTTP 请求头。--user-agent 请求头指定自定义的用户代理。--timeout 指定自定义的超时值。--proxy 指定用于 HTTP 请求的自定义代理。由于涉及大量 HTTP 请求,远程主机处理这些请求可能是一项繁重的任务。--delay 参数正是为帮助你应对这些情况而设计的。你可以指定一个以秒为单位的延迟值——该值将用于同一服务器同一端口上的两次连续请求之间。
我们已在博客中介绍了有关 Log4j 漏洞的更多详细信息。
该工具基于 MIT 许可证授权。参见 LICENSE。
目前该工具为 v0.1 版本。
RedHunt Labs 的研究团队想感谢 Thinkst Canary 出色的 Canary Token 项目。