firefart/its-a-trap

GitHub: firefart/its-a-trap

一个轻量级 Go Web 服务器,通过模拟 basic auth 或自定义登录表单来捕获用户输入的用户名和密码,并在提交时发送通知。

Stars: 3 | Forks: 0

# 这是陷阱 简单的 golang webserver,用于监听 basic auth 或 post 请求,并在用户输入密码时发送通知。 在使用 post 模式时,你需要添加自定义模板,并将 `username` 和 `password` 参数 post 到 `/login`。 ## 文件夹布局 ``` its-a-trap/custom ├── assets │   └── styles.css └── templates ├── finish.html └── index.html ``` 这将提供 `index.html` 服务,并在发送 post 请求时显示 `finish.html`。你可以使用 `asset_folder` 来存储模板所需的 自定义资产。在 basic auth 模式下,只会显示 `finish.html`。 ## basic auth 示例 ``` { "server": { "listen": "127.0.0.1", "port": 8000 }, "method": "basic", "cloudflare": false, "timeout": "5s", "basic": { "realm": "restricted" }, "template": { "folder": "./custom/templates", "index_template": "index.html", "finish_template": "finish.html", "asset_folder": "./custom/assets" } } ``` ## post 示例 ``` { "server": { "listen": "127.0.0.1", "port": 8000 }, "method": "post", "cloudflare": false, "timeout": "5s", "template": { "folder": "./custom/templates", "index_template": "index.html", "finish_template": "finish.html", "asset_folder": "./custom/assets" } } ``` 在 POST 模式下,你可以在模板中访问以下变量: - `{{ .LoginURL }}` - 要 post 到的 URL - `{{ .UsernameParameter }}` - username 参数名称 - `{{ .PasswordParameter }}` - password 参数名称 示例: ```




```
标签:Go, Homebrew安装, Ruby工具, Web服务器, 凭据收集, 后端开发, 多模态安全, 日志审计, 蜜罐, 证书利用, 钓鱼