SAPMAP — SAP Landscape Attack Path Mapper
SAPMAP is a BloodHound-style attack path mapper for SAP landscapes: it discovers SAP systems on a network, maps RFC trust connections, and implements real exploits (10KBLAZE/CVE-2020-6207 gateway trust, CVE-2025-31324 VisualComposer JSP webshell, a described CVE-2026-58240 Message Server rogue-registration flaw, and CVE-2026-31431 root LPE via AF_ALG page-cache patching) to chart lateral movement across ABAP, Java, HANA, and BTP-connected systems. Its AutoPwn mode chains scan → exploit → enrich → propagate across an entire landscape, and it includes an engagement-report generator, SecStore/RSECTAB credential decryption, SSH lateral movement, hash cracking via hashes.com, and a Tier-3 "evasion" module (SAL slot disable, DBTABLOG purge) paired with an extensive, specific blue-team detection guide (SAL/SM20, DBTABLOG gaps, kernel-param diffing, OS/network IOCs) for defenders to catch it.
What to do (defensive)
The summary tells you SAPMAP exists and lists its exploits; it does not carry the page's hardening and detection specifics, which is what an engineer defending an SAP landscape can act on. The page's own guidance: patch first, detect second.
Configuration changes that kill SAPMAP's primary paths:
- Populate
gw/sec_infoandgw/reg_infodeny-by-default on the Gateway — an empty ACL orP TP=* USER=* HOST=* USER-HOST=*is fatal (the 10KBLAZE path dies without it). - Set
gw/sim_mode = 0, not1— simulation mode logs but still allows the exploited path. - Populate and enforce
ms/acl_info; the MS betrusted path needs an open internal port (39NN). - Restrict
RFC_ABAP_INSTALL_AND_RUNviaS_DEVELOPauth check for non-developer service users — SAPMAP uses it for OA2C reading, RSECTAB decryption, DBTABLOG purge, and several LPE paths. - Stop storing
SAP_ALLon RFC destinations — the single most common pivot during lateral movement; use least-privilege technical users per destination. - Rotate every default credential before the system touches a non-isolated network (SAPMAP tries 16 via DIAG at sub-second latency).
- Disable VisualComposer if unused — CVE-2025-31324's
/developmentserver/metadatauploaderis the primary JSP-deploy channel.
**Detection signals SAPMAP does not suppress:**
- OS-level (survives SAP-side audit evasion): new JSPs under
.../irj/servlet_jsp/irj/root/nameddb<6>.jsp,lc<6>.jsp,pse<6>.jspowned by<sid>adm(inotify-watch this);/tmp/sapmap_*staged SQL; unexpected<sid>admchildren ofgwrd/disp+work/ms.sap*; FIM on/usr/sap/<SID>/SYS/global/security/; auditdptrace_attachrule for kernel-binary tampering. - SAP-level: fresh
USR02INSERT followed by a successful login within minutes (e.g.SAPMAP00);USR04withPROFILE='SAP_ALL'/'SAP_NEW'on non-admins; newSAPMAP_BACK_*SM59 destinations;RFC_ABAP_INSTALL_AND_RUNprograms matchingZSAPMAP_*/ZSAP_OA2C. - Network: single-source high-volume short connections to
32NN/33NN/36NN/39NN/50NNN; user-agentSAPMAP/1.0in ICM logs.
Beating the Tier-3 evasion (each technique still leaks):
- SAL slot disable leaves no
SM19header update → pollRSAU_API_GET_CONFIGevery 5 min, alert onSTATUS/UNAMEdiffering fromRSAUPROF; push SAL to SIEM so on-disk gaps don't matter. - Kernel-param flips are recorded by
RSPFL_HISTORY_DISPLAY— alert on changes togw/logging,rdisp/TRACE,rec/client,rsau/*. - DBTABLOG purge only deletes rows in its hold window; catch it via HANA SQL audit
AUDIT ACTION ON DBTABLOG (DELETE)or sequential-LOGIDgap analysis.
Version boundary
The described CVE-2026-58240 (MS ASCS_GW rogue registration, SAP Note 3759472) is fixed at kernel 9.16 PL100 / 9.18 PL032 / 9.19 PL017 / 9.20 PL007; system/secure_communication = ON blocks the plaintext path as a compensating control.
Caveats
Read-only mode (--read-only) is described by the page as a UX/API guardrail, not a security control — an operator can restart without the flag. Only the first ~60,000 of 117,897 characters were retrieved; detection detail beyond the truncation point is not shown here.
Organisations named here
- 10KBLAZE
- SAP*
- SAP_ALL
- SAP Note 3303172
- SAP Note 3759472
- SAProuter Info Leak
CVEs named here
- CVE-2025-31324
- CVE-2026-58240
- CVE-2020-6207
- CVE-2022-22536
- CVE-2026-31431
- CVE-2020-6287
- CVE-2019-0344
- CVE-2018-2380
- CVE-2020-17103
- CVE-2026-46331
Technologies named here
- Python
- Docker
- SSH
- Linux
- SAP
- SAP HANA
Techniques named here
- Copy Fail
Related in Offensive Security