George0Papasotiriou/CVE-2026-3333-DNS-Rebinding-to-Steal-Cloud-Metadata
GitHub: George0Papasotiriou/CVE-2026-3333-DNS-Rebinding-to-Steal-Cloud-Metadata
该项目是一个演示 CVE-2026-3333 DNS Rebinding 攻击以盗取云元数据 IAM 凭据的概念验证工具。
Stars: 0 | Forks: 0
## CVE-2026-3333 – DNS Rebinding 盗取云元数据
### **程序代码(Python 攻击者服务器 + 易受攻击的应用)**
```
#!/usr/bin/env python3
# dns_rebinding_server.py - 在 attacker IP 和 169.254.169.254 之间交替的恶意 DNS 服务器
import socket, threading, time
# 这个简单的服务器交替地将我们域名的任何子域名解析为 169.254.169.254 和 attacker IP。
DNS_QUERIES = {}
def handle_dns(data, addr, sock):
# minimal DNS response: use a simple pattern
# For demo, we'll use a static approach: first query gets attacker IP, second gets metadata IP.
# We'll simulate by running an HTTP server that the victim will contact.
pass # actual DNS logic is complex; for demonstration, we'll simulate the whole scenario.
```
# CVE-2026-3333 – DNS Rebinding 盗取云元数据

## 概述
在云环境中运行的 Web 应用程序易受 DNS Rebinding 攻击。通过使用在攻击者 IP 和云元数据 IP (169.254.169.254) 之间交替的域名,攻击者可以盗取 IAM 凭据。
## 漏洞详情
- **类型:** DNS Rebinding → SSRF
- **影响:** 通过盗取的临时凭据接管云账户。
- **根本原因:** 应用程序在 TTL 过期后会重新解析主机名,从而导致一种竞态条件,使得同一主机名指向私有 IP。
## 漏洞利用演示
1. 启动易受攻击的应用:
python vulnerable_web_app.py
2. 运行漏洞利用(模拟):
python exploit_dns_rebinding.py
标签:DNS重绑定, Python, SSRF, StruQ, 无后门, 逆向工具