ajcyberdefense/cowrie-honeypot
GitHub: ajcyberdefense/cowrie-honeypot
在 AWS 上部署 Cowrie SSH 蜜罐,实现对暴力破解与攻击会话的捕获与分析。
Stars: 0 | Forks: 0
# AWS 上的 Cowrie SSH 蜜罐
一份完整的文档,介绍了在加固后的 AWS EC2 实例上部署 [Cowrie](https://github.com/cowrie/cowrie) SSH/Telnet 蜜罐,并进行流量监控与攻击者会话分析。
## 什么是蜜罐
蜜罐是一个故意暴露的诱饵服务器,旨在吸引攻击者。与其防御入侵,不如让攻击者进入并记录其所有行为。本项目使用目前最广泛使用的开源蜜罐之一 **Cowrie** 来实现以下目标:
- 捕获暴力破解登录尝试
- 记录完整的攻击者会话(他们输入的每一条命令)
- 记录恶意软件下载尝试
- 分析攻击者行为与来源
## 架构
```
Internet (attackers)
│
▼
AWS Security Group
│
┌─────┴──────────────────────┐
│ EC2 Ubuntu 22.04 LTS │
│ │
│ Port 2222 ──► Cowrie │ ← attackers land here (fake SSH)
│ Port 23 ──► Cowrie │ ← attackers land here (fake Telnet)
│ │
│ Port 2223 ──► Real SSH │ ← admin only (your IP)
│ │
│ UFW Firewall │
│ Fail2ban │
└────────────────────────────┘
│
▼
Logs & Session Recordings
│
▼
Analysis & Visualization
```
## 仓库结构
```
cowrie-honeypot/
├── README.md # This file
├── .gitignore # Excludes sensitive data and logs
│
├── docs/
│ ├── 01-aws-setup.md # EC2 instance, security groups, Elastic IP
│ ├── 02-hardening.md # SSH hardening, UFW, Fail2ban, users
│ ├── 03-cowrie-install.md # Installing and configuring Cowrie
│ └── 04-monitoring.md # Log analysis and traffic monitoring
│
├── scripts/
│ ├── harden.sh # Automated instance hardening script
│ ├── install-cowrie.sh # Automated Cowrie installation script
│ ├── analyze.py # CLI log parser and attack summary
│ └── dashboard.py # Flask web dashboard (real-time attack visualization)
│
├── configs/
│ ├── sshd_config # Hardened SSH daemon configuration
│ ├── cowrie.cfg # Cowrie honeypot configuration
│ ├── cowrie.service # Systemd service for Cowrie
│ └── dashboard.service # Systemd service for web dashboard
│
├── logs/ # Gitignored — local log storage only
│ └── .gitkeep
│
└── analysis/ # Attack analysis outputs
└── .gitkeep
```
## 安装指南
请按顺序参考以下文档:
1. [AWS 实例设置](docs/01-aws-setup.md)
2. [实例加固](docs/02-hardening.md)
3. [Cowrie 安装](docs/03-cowrie-install.md)
4. [监控与 Web 仪表盘](docs/04-monitoring.md)
## 技术栈
| 组件 | 工具 |
|------|------|
| 云服务商 | AWS EC2 |
| 操作系统 | Ubuntu 22.04 LTS |
| 蜜罐 | Cowrie |
| 防火墙 | UFW |
| 入侵防御 | Fail2ban |
| Web 仪表盘 | Flask + Chart.js |
| 编程语言 | Python 3 |
| 进程管理 | Systemd |
## 安全声明
## 许可证
MIT 许可证 — 详细信息请参见 [许可证文件](LICENSE)。
标签:AWS, DPI, EC2, ETW劫持, Fail2ban, Honeypot, IaC, PB级数据处理, PoC, SEO: AWS 蜜罐, SEO: Cowrie 配置, SEO: SSH 蜜罐, SEO: 流量分析, SEO: 蜜罐部署, SSH 蜜罐, Telnet 蜜罐, Ubuntu 22.04, UFW, 云端安全, 会话分析, 动态API解析, 堡垒主机, 威胁情报, 安全组, 安全运维, 开发者工具, 开源蜜罐, 恶意软件下载, 攻击者行为分析, 日志记录, 暴力破解, 流量监控, 端口转发, 诱饵服务器