hakluke/hakrawler
GitHub: hakluke/hakrawler
基于 Gocolly 的轻量级 Web 爬虫,专注于快速发现 Web 应用的端点和资产。
Stars: 4999 | Forks: 538
# Hakrawler
快速的 Golang Web 爬虫,用于收集 URL 和 JavaScript 文件位置。这基本上是 awesome Gocolly 库的一个简单实现。
## 用法示例
单个 URL:
```
echo https://google.com | hakrawler
```
多个 URL:
```
cat urls.txt | hakrawler
```
Stdin 中每一行的超时时间设为 5 秒:
```
cat urls.txt | hakrawler -timeout 5
```
通过代理发送所有请求:
```
cat urls.txt | hakrawler -proxy http://localhost:8080
```
包含子域名:
```
echo https://google.com | hakrawler -subs
```
## 示例工具链
获取 Google 的所有子域名,找出响应 http(s) 的子域名,并对它们全部进行爬取。
```
echo google.com | haktrails subdomains | httpx | hakrawler
```
## 安装
### 常规安装
首先,你需要[安装 go](https://golang.org/doc/install)。
然后运行此命令以下载并编译 hakrawler:
```
go install github.com/hakluke/hakrawler@latest
```
你现在可以运行 `~/go/bin/hakrawler`。如果你想直接运行 `hakrawler` 而不使用完整路径,你需要执行 `export PATH="~/go/bin/:$PATH"`。如果你希望此设置永久生效,也可以将此行添加到你的 `~/.bashrc` 文件中。
### Docker 安装(来自 dockerhub)
```
echo https://www.google.com | docker run --rm -i hakluke/hakrawler:v2 -subs
```
### 本地 Docker 安装
使用上面的 dockerhub 方法要容易得多,但如果你更喜欢在本地运行:
```
git clone https://github.com/hakluke/hakrawler
cd hakrawler
sudo docker build -t hakluke/hakrawler .
sudo docker run --rm -i hakluke/hakrawler --help
```
### Kali Linux:使用 apt
注意:这将安装一个旧版本的 hakrawler,不具备所有功能,并且可能存在 Bug。我建议使用其他方法。
```
sudo apt install hakrawler
```
然后,运行 hakrawler:
```
echo https://www.google.com | docker run --rm -i hakluke/hakrawler -subs
```
## 命令行选项
```
Usage of hakrawler:
-d int
Depth to crawl. (default 2)
-dr
Disable following HTTP redirects.
-h string
Custom headers separated by two semi-colons. E.g. -h "Cookie: foo=bar;;Referer: http://example.com/"
-i Only crawl inside path
-insecure
Disable TLS verification.
-json
Output as JSON.
-proxy string
Proxy URL. E.g. -proxy http://127.0.0.1:8080
-s Show the source of URL based on where it was found. E.g. href, form, script, etc.
-size int
Page size limit, in KB. (default -1)
-subs
Include subdomains for crawling.
-t int
Number of threads to utilise. (default 8)
-timeout int
Maximum time to crawl each URL from stdin, in seconds. (default -1)
-u Show only unique urls.
-w Show at which link the URL is found.
```
标签:EVTX分析, EVTX分析, Golang, Go语言, JS文件发现, URL提取, 二进制发布, 占用监测, 反编译, 子域名搜集, 安全编程, 密码管理, 开源工具, 日志审计, 目录枚举, 移动安全, 程序破解, 端点搜集, 网络安全, 请求拦截, 资产管理, 资源发现, 隐私保护