Improving SAP Security: Tooling For Authorizations And Post-exploitation

Aloïs Colléaux-Le Chêne (Security Expert · Synacktiv)

Insomni'hack 2026 · Day 1 · Main Track

Overview

This technical presentation by Aloïs Colléaux-Le Chêne explores the complex authorization and authentication mechanics of Enterprise Resource Planning (ERP) systems, specifically targeting SAP architecture. The talk details a simulated enterprise penetration test that bridges low-privileged user access with critical infrastructure compromise, culminating in the extraction of sensitive banking records. By examining the structural vulnerabilities inherent in enterprise software legacy configurations, the speaker highlights the challenges security auditors face when attempting to map granular permissions across large systems without relying on native graphical interfaces.

Watch on YouTube

Visual summary for Improving SAP Security: Tooling For Authorizations And Post-exploitation by Aloïs Colléaux-Le Chêne
Visual summary for Improving SAP Security: Tooling For Authorizations And Post-exploitation by Aloïs Colléaux-Le Chêne

Key moments

  1. 0:00 Introduction and background on SAP security assessments
  2. 4:11 SAP architecture overview: SIDs, instances, and ABAP
  3. 7:10 Understanding authorizations, roles, and profiles in SAP
  4. 13:00 Introducing ASAP: Tooling for auditing SAP authorizations
  5. 15:00 Data collection methods and SQLite import process
  6. 22:12 Executing the assessment, dumping tables, and finding RCEs
  7. 24:30 Deep dive into SAP logon tickets and SSO mechanics
  8. 28:50 Extracting server credentials and forging logon tickets

Improving SAP Security: Tooling For Authorizations And Post-exploitation

Speakers: Aloïs Colléaux-Le Chêne (Security Expert, Synacktiv)

Conference: Insomni'hack

YouTube: https://www.youtube.com/watch?v=Gtgnt4XDNp4

Overview

This technical presentation by Aloïs Colléaux-Le Chêne explores the complex authorization and authentication mechanics of Enterprise Resource Planning (ERP) systems, specifically targeting SAP architecture. The talk details a simulated enterprise penetration test that bridges low-privileged user access with critical infrastructure compromise, culminating in the extraction of sensitive banking records. By examining the structural vulnerabilities inherent in enterprise software legacy configurations, the speaker highlights the challenges security auditors face when attempting to map granular permissions across large systems without relying on native graphical interfaces.

The presentation emphasizes the creation and deployment of open-source tooling designed to bridge the gap between manual, tedious GUI-based auditing and automated permission analysis. Through a combination of database dumps, local SQLite ingestion, and privilege escalation primitives centered around cryptographic single sign-on mechanisms, the talk illustrates how seemingly isolated misconfigurations chain together. Ultimately, the session demonstrates that enterprise resource software—while heavily fortified at the perimeter—frequently suffers from internal privilege accumulation vectors that demand specialized tooling to uncover and mitigate.

Background

▶ Watch: Introduction and background on SAP security assessments (0:00)

SAP environments represent some of the most critical assets within corporate IT infrastructures, handling everything from warehouse inventory tracking to human resources and financial transactions. Despite their ubiquity in major global enterprises, securing these systems remains notoriously difficult due to extensive legacy dependencies, insecure protocol configurations, and strict enterprise licensing models. Because official documentation is heavily locked behind customer and partner paywalls, independent security research into SAP architecture has historically lagged behind mainstream web and cloud application security.

The underlying architecture of an SAP system—identified by a three-character System ID (SID)—comprises multiple server instances and a shared database backend. Data segmentation within this database relies on logical partitions called clients (mandants). However, standard security boundaries between mandants are frequently porous; system administrators with raw database access can cross these boundaries effortlessly. Programs within SAP are written in a proprietary programming language called ABAP (Advanced Business Application Programming) and are executed via short codes known as transactions. Remote inter-system communication is primarily handled via the RFC (Remote Function Call) mechanism.

Historically, security tooling for SAP has been scarce. While frameworks like Bisploit and PySAP provided foundational protocol reverse engineering, and Metasploit modules offered specific brute-forcing or exploit capabilities, auditing user authorizations efficiently remained a manual hurdle. Traditional auditing relies entirely on SAP's graphical user interface (SAP GUI), which fails to support rapid, repeatable, or scriptable auditing workflows necessary for external penetration testers operating in gray-box or black-box environments.

Key Findings

▶ Watch: Understanding authorizations, roles, and profiles in SAP (7:10)

The research highlights several structural insights regarding how SAP handles access control and privilege management:

  • Program-Enforced Authorization: Access control in SAP is not enforced by the underlying operating system kernel, but rather by individual ABAP programs upon execution. While this design provides operational flexibility, it introduces systemic risk if a program lacks proper authorization validation checks.
  • Hierarchical Access Structures: Authorizations are structured through a hierarchy where roles map to profiles, and profiles contain specific authorization objects. Each authorization object evaluates up to 10 distinct authorization fields containing specific or ranged values.
  • Database Table Exposure: Critical authorization mappings rely on specific database tables, most notably USR02 (user master records containing password hashes) and tables prefixed with USR that correlate profiles to effective permissions.
  • Logon Ticket Vulnerabilities: SAP's proprietary single sign-on mechanism—known as Logon Tickets—accepts self-signed cryptographic tokens by default. Because an SAP system always trusts its own generated tokens, possessing the master server signing key allows an attacker to forge arbitrary authentication blobs and impersonate any user, including administrative master accounts like SAP*.

Technical Deep Dive

▶ Watch: Data collection methods and SQLite import process (15:00)

The core contribution introduced in the talk is an open-source auditing tool developed by Tenable called ASAP. Designed to eliminate the operational friction of auditing SAP authorizations via the GUI, ASAP operates via a structured three-step pipeline: data collection, local SQLite ingestion, and automated or manual querying.

Data Collection Methods

ASAP supports three distinct methods for extracting authorization data from a target SAP system, depending on current privilege levels:

  1. Direct Database Connection: Connecting directly to the underlying Database Management System (DBMS) (such as Sybase or HANA DB) using raw SQL execution.
  2. System Administration Toolkits: Utilizing administrative transactions like ST04 or DBA Cockpit to run raw SQL queries and export the results locally.
  3. Generic Data Browser: Leveraging transaction SC16 to manually browse and export required USR tables page-by-page when administrative access is unavailable.

Local Ingestion and Denormalization

Once raw exports (CSV, TSV, or Excel spreadsheets) are gathered, ASAP imports them into a local SQLite database (e.g., npl.sqlite). Because export formats vary wildly across SAP kernel versions and collection methods, ASAP standardizes the input before performing a denormalization process. This step flattens complex composite roles and profile hierarchies into a single unified table (profile_auth), linking users directly to their effective authorization fields and values.

Privilege Escalation via Logon Tickets

The technical apex of the assessment involves abusing SAP Logon Tickets for horizontal and vertical privilege escalation:

  • Token Structure: Logon tickets are Base64-encoded blobs utilizing a modified alphabet (substituting + with !). Internally, they rely on a Type-Length-Value (TLV) structure containing user identity, client context, issuing SID, validity periods, and a cryptographic signature.
  • Cryptographic Keys: Signature validation relies on a master cryptographic key pair stored within a proprietary file format called a PSE (Personal Security Environment), specifically located at sec/sapsso.pse within the work directory of the dialog instance.
  • Extraction and Forgery: Using file-download vulnerabilities (such as blanket authorizations in health and safety packages like CGY) or misconfigured transaction access, an attacker extracts sapsso.pse. Official SAP utilities (sapgenpse) and OpenSSL convert this file into standard PKCS#12 format. Custom tooling (SAP_logon_ticket.py) then uses the extracted private key to forge valid logon tickets. Injecting these tickets into the mySAP SSO2 cookie of the SAP web GUI grants immediate, unauthenticated session hijacking as any user, including SAP*.

Demo / Proof of Concept

▶ Watch: Executing the assessment, dumping tables, and finding RCEs (22:12)

The presenter demonstrated a complete end-to-end compromise starting from standard user credentials:

  1. Initial Enumeration: Connecting to the SAP GUI with low-privileged user credentials (Sam Fisher in mandant 001) and discovering that generic data browser transaction SC16 is improperly accessible.
  2. Data Export: Utilizing ASAP's automated AutoHotkey collection scripts to dump necessary authorization and user tables locally.
  3. Database Import & Audit: Importing the dumped dataset into npl.sqlite and running ASAP queries filtered via JSON output to identify accounts with Remote Code Execution (RCE) capabilities. User John Tito is identified as having access to the RCE-capable transaction ARCHIVE_SERVER_TO_CLIENT (transaction code SE37).
  4. Credential Cracking: Extracting John Tito's password hash from the imported USR02 table dump and cracking it via Hashcat, revealing the weak password enter23.
  5. Privilege Escalation Chain: Authenticating as John Tito, executing transaction SE37 to leverage the file-download capability, extracting the sapsso.pse master signing key from the predictable dialog instance work directory (/sec/), converting the PSE to a PKCS#12 certificate, and forging a valid logon ticket for the superuser SAP*.
  6. Final Objective: Injecting the forged logon ticket into the mySAP SSO2 web browser cookie, gaining administrative privileges, and successfully querying restricted banking data tables such as TIBAN via transaction SC16.

Defensive Implications

▶ Watch: Extracting server credentials and forging logon tickets (28:50)

Organizations running SAP infrastructures must adopt a rigorous defense-in-depth posture to mitigate the attack vectors highlighted in this talk:

  • Strict Authorization Auditing: Regularly audit user and role assignments using automated tooling to ensure the principle of least privilege is enforced. Eliminate blanket transaction access (such as unrestricted use of SC16 or SE37) for standard users.
  • Secure Cryptographic Material: Ensure that server-side directories housing sensitive system credentials and cryptographic files (such as sapsso.pse within the sec work folder) are heavily access-controlled and monitored for unauthorized file-download attempts.
  • Harden Single Sign-On Configurations: Review SAP Logon Ticket configurations across the landscape. Disable automatic acceptance of untrusted or self-signed logon tokens if SSO is not actively deployed, and rotate master signing keys regularly.
  • Patch Management: Actively track and apply SAP Security Notes to remediate known vulnerabilities, ensuring that legacy protocols and unauthenticated code execution vectors are closed.

Key Takeaways

  • SAP systems rely on program-enforced authorizations rather than kernel-level access controls, making granular permission auditing critical for security posture assessment.
  • ASAP bridges the auditing gap for penetration testers by automating the extraction, ingestion, and relational analysis of SAP authorization data via local SQLite databases.
  • Database tables such as USR02 and USR store critical master user and permission mapping data that can be targeted for offline credential cracking and privilege path discovery.
  • SAP Logon Tickets utilize self-signed cryptographic blobs that, if compromised via master PSE key extraction (sapsso.pse), allow complete session hijacking and user impersonation.
  • File-download primitives combined with predictable server directory structures (sec/) serve as highly effective catalysts for enterprise privilege escalation chains.

About the Speaker(s)

  • Aloïs Colléaux-Le Chêne (Security Expert, Synacktiv): Aloïs is a security expert at Synacktiv specializing in offensive security and penetration testing. His recent research focuses on documenting fundamental SAP concepts to uncover new vulnerabilities and audit techniques in these environments.

Reviews

→ Top-rated talks at Insomni'hack 2026

All talks from Insomni'hack 2026