masaudsec/serverspy
GitHub: masaudsec/serverspy
面向漏洞赏金和渗透测试场景的 Bash 自动化侦察工具,一站式完成 DNS、HTTP 指纹、SSL、端口扫描等十项服务器信息收集任务。
Stars: 20 | Forks: 8
# 🕵️ ServerSpy
**面向漏洞赏金猎人和渗透测试人员的全栈服务器指纹识别工具。**
[](https://opensource.org/licenses/MIT)
[](https://www.gnu.org/software/bash/)
[]()
[](https://masaudsec.com)
## 📸 预览
```
┌──────────────────────────────────────────────────┐
│ 🕵️ ServerSpy v1.0 — masaudsec.com │
│ Full Server Fingerprinting Tool │
└──────────────────────────────────────────────────┘
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📡 DNS Resolution
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] IPv4 Address(es): 93.184.216.34
[+] CNAME: example.com.edgekey.net.
[+] Nameservers: ns1.example.com
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌐 HTTP Headers Analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] Server: nginx/1.18.0
[+] CDN Detected: Cloudflare
[+] WAF Detected: Cloudflare WAF
[✓] HSTS
[✗] CSP Missing
```
## 🔍 功能简介
ServerSpy 会自动对任何目标运行 **10 个侦察模块**:
| # | 模块 | 使用的工具 | 发现的内容 |
|---|--------|-----------|---------------|
| 1 | **DNS Resolution** | `dig` | IPv4, IPv6, CNAME, MX, NS, TXT, PTR (rDNS) |
| 2 | **WHOIS & ASN** | `whois`, ipinfo.io | Registrar, ISP, ASN, 位置, 组织 |
| 3 | **HTTP Headers** | `curl` | Server, CDN, WAF, 安全标头, Cookies |
| 4 | **Tech Stack** | `whatweb` | CMS, 框架, 语言, 库 |
| 5 | **SSL/TLS Certificate** | `openssl` | CA, SANs, TLS 版本, 有效期 |
| 6 | **Port Scan** | `nmap` | 开放的 Web 端口 + 服务版本 |
| 7 | **Passive Intel** | HackerTarget, crt.sh | 反向 IP 主机, 子域名 |
| 8 | **Traceroute** | `traceroute` | 网络路径, 跳数 |
| 9 | **Robots & Sitemap** | `curl` | 禁止访问的路径, Sitemap |
| 10 | **Auto-Install** | apt/pacman/brew | 自动安装缺失的工具 |
## ⚡ 快速开始
```
# Clone
git clone https://github.com/masaudsec/serverspy.git
cd serverspy
# 设置为可执行
chmod +x serverspy.sh
# 单个目标
./serverspy.sh example.com
# 带 protocol(自动剥离)
./serverspy.sh https://example.com
# 目标列表
./serverspy.sh -l targets.txt
```
## 📦 安装说明
### Kali Linux / Ubuntu / Debian
```
git clone https://github.com/masaudsec/serverspy.git
cd serverspy
chmod +x serverspy.sh
./serverspy.sh example.com # auto-installs missing tools on first run
```
### macOS
```
# 首先安装 Homebrew 工具
brew install nmap whatweb curl wget
git clone https://github.com/masaudsec/serverspy.git
cd serverspy
chmod +x serverspy.sh
./serverspy.sh example.com
```
### 依赖项
ServerSpy 会使用 `apt`, `pacman` 或 `brew` 自动安装缺失的依赖项。您也可以手动安装:
```
# Debian/Ubuntu/Kali
sudo apt install -y curl wget dnsutils whois nmap whatweb traceroute openssl
# Arch/Manjaro
sudo pacman -S curl wget bind whois nmap whatweb traceroute openssl
# macOS
brew install curl wget nmap whatweb
```
## 🎯 用法
```
# 单个域名
./serverspy.sh target.com
# 带 protocol 的单个域名
./serverspy.sh https://target.com
# 从列表进行批量扫描
./serverspy.sh -l domains.txt
# 帮助
./serverspy.sh --help
```
### 输出
结果会自动保存到 `serverspy_results/` 文件夹中:
```
serverspy_results/
└── example.com_20260308_143022.txt
```
## 🔎 检测能力
### CDN 检测
- Cloudflare
- AWS CloudFront
- Fastly
- Akamai
- Netlify
- Vercel
- GitHub Pages
- Sucuri
- Imperva
### WAF 检测
- Cloudflare WAF
- Sucuri WAF
- ModSecurity
- Fortinet WAF
- Akamai WAF
### 安全标头审计
- HSTS (HTTP Strict Transport Security)
- CSP (Content Security Policy)
- X-Frame-Options
- X-Content-Type-Options
- Referrer-Policy
- Permissions-Policy
### Cookie 安全标志
- HttpOnly
- Secure
- SameSite
## 📋 示例输出
```
╔══════════════════════════════════════════════════╗
║ 🎯 Target: netflix.com
╚══════════════════════════════════════════════════╝
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📡 DNS Resolution
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] IPv4 Address(es): 54.74.73.0
[+] CNAME: ipv4_1.netflix.com.
[+] Nameservers: ns1.p47.dynect.net.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏢 WHOIS & ASN Info
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] Registrar: MarkMonitor, Inc.
[+] ASN / ISP: AS2906 NETFLIX-ASN
[+] Location: Los Gatos, California, US
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌐 HTTP Headers Analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] Server: openresty
[+] Via (Proxy/CDN): 1.1 netflix.com (Envoy)
[✓] HSTS
[✓] CSP
[✓] X-Frame-Options
```
## 🛡️ 免责声明
## 👤 作者
**Masaud Ahmad** — [@masaudsec](https://masaudsec.com)
- 🌐 网站: [masaudsec.com](https://masaudsec.com)
- 漏洞赏金猎人及攻击性安全教育者
- 为安全社区构建工具
## 📄 许可证
本项目基于 **MIT License** 授权 — 详情请参阅 [LICENSE](LICENSE) 文件。
## ⭐ 支持
如果此工具帮助您发现了漏洞,请**为该仓库点赞** (star) 并与社区分享!
标签:Bash, C2日志可视化, 动态插桩, 实时处理, 密码管理, 应用安全, 指纹识别, 无服务器架构