SlideShare a Scribd company logo
SAPSAPSAPSAP Penetration Testing
& Defense In-Depth
MarianoMariano NuNuññezez Di CroceDi Croce
mnunez@cybsec.commnunez@cybsec.com
OctoberOctober 22--3, 20083, 2008
EkopartyEkoparty, Buenos Aires, Buenos Aires -- ArgentinaArgentina
©© Copyright 2008 CYBSEC.Copyright 2008 CYBSEC. AllAll rightsrights reservedreserved..
sap security, sap pentest, sap pentesting, sap pt, sap security assessment, sap vulnerability assessment, sap insecurity, sap vulnerabilities, sap vulnerability, sap defense, hardening sap, sap hardening, protecting sap
2
© 2008
WhoWhoWhoWho isisisis CYBSEC ?CYBSEC ?CYBSEC ?CYBSEC ?
Provides Information Security services since 1996.
More than 300 customers, located in LatinAmerica, USA and Europe.
Wide range of services: Strategic Management, Operation Management,
Control Management, Incident Management, PCI Services, SAP Security.
SAPSAPSAPSAP &&&& CYBSECCYBSECCYBSECCYBSEC
Member of the SAP Global Security Alliance (GSA).
Has been working with SAP (Walldorf) since 2005.
Provides specific SAP security services (Penetration Testing, Secure
Architecture Design, Secure Configuration, …)
3
© 2008
WhoWhoWhoWho amamamam I?I?I?I?
Senior Security Researcher at CYBSEC.
Devoted to Penetration Testing and Vulnerability Research.
Discovered vulnerabilities in Microsoft, Oracle, SAP, Watchfire, …
Speaker/Trainer at Blackhat, Sec-T, Hack.lu, DeepSec, Ekoparty, CIBSI, …
SAPSAPSAPSAP &&&& MeMeMeMe
Started researching in 2005.
SAP Pentesting projects (customers).
Discovered more than 40 vulnerabilities in SAP software.
Published “Attacking the Giants: Exploiting SAP Internals”.
Developed sapyto, the first SAP Penetration Testing Framework.
CYBSEC’s “SAP (In)Security ” Training instructor.
4
© 2008
AgendaAgendaAgendaAgenda
Agenda
Introduction to the SAP World
Why SAP Penetration Testing?
PenTest Setup
SAP PenTesting
Discovery Phase
Exploration Phase
Vulnerability Assessment Phase
Exploitation Phase
Case Study: SAProuter Security Assessment
Conclusions
5
© 2008
Introduction toIntroduction to
the SAP Worldthe SAP World
Basic concepts for deep knowledge
6
© 2008
SoSoSoSo………… whatwhatwhatwhat isisisis SAP?SAP?SAP?SAP?
Introduction to the SAP World
SAP (Systems, Applications and Products in Data Processing) is a
german company devoted to the development of business solutions.
More than 41.600 customers in more than 120 countries.
More than 121.000 SAP implementations around the globe.
Third biggest independent software vendor (ISV).
Provides different solutions:
CRM, ERP, PLM, SCM, SRM, GRC, Business One, …
The ERP solution is composed of different functional modules (FI, CO,
SD, HR, MM, etc) that implements organization business processes.
Modules are linked together, integrated by the Netweaver platform.
SAP runs on multiple Operating Systems and Databases.
7
© 2008
SAP Basic ConceptsSAP Basic ConceptsSAP Basic ConceptsSAP Basic Concepts
Introduction to the SAP World
Instance & System
An instance is an administrative entity which groups related
components of an SAP system, providing one or more services.
Systems are identified by SAP System ID (SID).
System (instance) parametrization is done in Profiles.
8
© 2008
SAP Basic ConceptsSAP Basic ConceptsSAP Basic ConceptsSAP Basic Concepts
Introduction to the SAP World
Client
Legally and organizationally independent unit in an SAP system
(company group, business unit, corporation).
Identified by a three-digit number.
Default clients: 000, 001 and 066.
Transaction
Related secuence of steps (dialog steps) aimed to perform an
operation in the SAP database.
Identified by a transaction code (ej: SU01, SE16, FK01, PA20,…)
9
© 2008
SAP Basic ConceptsSAP Basic ConceptsSAP Basic ConceptsSAP Basic Concepts
Introduction to the SAP World
ABAP
ABAP is the SAP high-level programming language used to
develop business applications.
Reports / Programs
ABAP programs that receive user input and produce a report in
the form of an interactive list.
Function Modules
Independent ABAP modules. Can be called locally or remotely.
The RFC (Remote Function Call) Interface
Used to call function modules on remote systems.
10
© 2008
SAP Basic ConceptsSAP Basic ConceptsSAP Basic ConceptsSAP Basic Concepts
Introduction to the SAP World
The Authorization Concept (Simplified)
Users are asigned roles/profiles.
Each profile contains a set of Authorization objects.
When a user tries to perform an activity, the required authorization
objects are checked against user’s authorization objects (user buffer).
Controlled Activities:
Starting Transactions (S_TCODE)
Accessing Tables (S_TABU_DIS)
Starting Programs (S_PROGRAM)
Calling RFC Function Modules (S_RFC)
Authorization checks can also be done programatically, through the
AUTHORITY_CHECK clause.
11
© 2008
SomeSomeSomeSome ““““LowLowLowLow----levellevellevellevel”””” KnowledgeKnowledgeKnowledgeKnowledge
Introduction to the SAP World
SAP_ALL profile = SAP God.
Many other profiles may enable a user become a god too.
Each SAP System uses its own Database.
SAP processes run under the <sid>adm or SAPService<SID> user
accounts.
Connections to the Database are done with the same UID. No
authorization at this level…
Direct access to the Database means full SAP compromise!
Connections between systems often based on Trust Relationships
(r* services).
Many customer’s interfaces are implemented through FTP (cleartext,
usually weak passwords).
12
© 2008
Why SAPWhy SAP
Penetration Testing?Penetration Testing?
Or why You and your CFO should care
13
© 2008
Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?
Why SAP Penetration Testing?
The new SAP system
must be running on
October 3rd, no excuses.
14
© 2008
Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?
Why SAP Penetration Testing?
The new SAP system
must be running on
October 3rd, no excuses.
But we haven’t secured the
systems yet…you know,
there is something called
“Security”
15
© 2008
Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?
Why SAP Penetration Testing?
The new SAP system
must be running on
October 3rd, no excuses.
But we haven’t secured the
systems yet…you know,
there is something called
“Security”
Security? Hmm…is it French?
I don’t care…
Business *must* go on!
16
© 2008
Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?
Why SAP Penetration Testing?
The new SAP system
must be running on
October 3rd, no excuses.
But we haven’t secured the
systems yet…you know,
there is something called
“Security”
Security? Hmm…is it French?
I don’t care…
Business *must* go on!
But we should take care of
User authorizations to
prevent frauds!
17
© 2008
Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?
Why SAP Penetration Testing?
The new SAP system
must be running on
October 3rd, no excuses.
But we haven’t secured the
systems yet…you know,
there is something called
“Security”
Security? Hmm…is it French?
I don’t care…
Business *must* go on!
But we should take care of
User authorizations to
prevent frauds!
Just give everyone full access
(SAP_ALL) for three months,
then we’ll lock it down
18
© 2008
Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?
Why SAP Penetration Testing?
The new SAP system
must be running on
October 3rd, no excuses.
But we haven’t secured the
systems yet…you know,
there is something called
“Security”
Security? Hmm…is it French?
I don’t care…
Business *must* go on!
But we should take care of
User authorizations to
prevent frauds!
Just give everyone full access
(SAP_ALL) for three months,
then we’ll lock it down
OK…
19
© 2008
Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?
Why SAP Penetration Testing?
The new SAP system
must be running on
October 3rd, no excuses.
But we haven’t secured the
systems yet…you know,
there is something called
“Security”
Security? Hmm…is it French?
I don’t care…
Business *must* go on!
But we should take care of
User authorizations to
prevent frauds!
Just give everyone full access
(SAP_ALL) for three months,
then we’ll lock it down
OK…
@#-*!#&$%!!
20
© 2008
Why do you Need an SAP Penetration Test? (cont.)Why do you Need an SAP Penetration Test? (cont.)Why do you Need an SAP Penetration Test? (cont.)Why do you Need an SAP Penetration Test? (cont.)
Why SAP Penetration Testing?
CFOCFOCFOCFO’’’’ssss MistakeMistakeMistakeMistake::::
SecuritySecuritySecuritySecurity guyguyguyguy’’’’ssss MistakeMistakeMistakeMistake::::
Alert
Weak SAP Security configuration can
definitely result in Business Frauds!
Alert
SAP Security is much (*much*) more
than User roles and authorizations!
21
© 2008
Why do you Need an SAP Penetration Test? (Wrap up)Why do you Need an SAP Penetration Test? (Wrap up)Why do you Need an SAP Penetration Test? (Wrap up)Why do you Need an SAP Penetration Test? (Wrap up)
Why SAP Penetration Testing?
Security configurations of SAP systems are usually left by default.
By default, many configurations are not secure.
Conclusion: Many SAP implementations are not secure!
Is yours secure? A Penetration Test to these systems will help you
know how your SAP implementation can be attacked and which is the
real impact of this.
It will help you discover the weaknesses, secure them, and increase
the security level of your systems (a.k.a decrease fraud risk).
In this talk, we’ll see some of the activities that make up the different
phases of an SAP Penetration Testing (no way of covering them all).
22
© 2008
PenTestPenTest SetupSetup
Before we begin …
23
© 2008
PreparationPreparationPreparationPreparation
PenTest Setup
What do you need? The Shopping List
sapyto
nmap
r* tools (rsh, rlogin, rexec)
SQL client tools
NFS client tools
SMB client & security tools
BurpSuite / w3af
Nessus
john (patched)
hydra
Try to get as much information as possible about target platforms,
usage and policies before starting the assessment.
Remember that everthing that breaks while you are pentesting *will*
be your fault (even if someone breaks his leg).
24
© 2008
sapytosapytosapytosapyto
First SAP Penetration Testing Framework.
Support for activities in all phases of the pentest.
Open-source (and free).
Plugin based.
Developed in Python and C.
Version 0.93 released at Blackhat Europe 07.
sapyto
25
© 2008
AvailableAvailableAvailableAvailable Plugins inPlugins inPlugins inPlugins in sapytosapytosapytosapyto v0.93v0.93v0.93v0.93
sapyto
Audit: Attack:
RFC Ping.
Registration of External Servers.
Detection of RFCEXEC.
Detection of SAPXPG.
Get system information.
Get server documentation.
RFC_START_PROGRAM Dir Traversal.
Run commands through RFCEXEC.
Run commands through SAPXPG.
StickShell.
Evil Twin Attack.
Get remote RFCShell.
Tools:
RFC Password Obfuscator / De-obfuscator.
26
© 2008
HotHotHotHot NewsNewsNewsNews!!!! sapytosapytosapytosapyto v0.98v0.98v0.98v0.98
sapyto
Core and architecture fully re-built.
Based on connectors.
The SAPRFC* connectors and the RFCSDK.
Plugins are now categorized in Discovery, Audit and Exploit.
Discovery plugins find new targets.
Audit plugins carry out the vulnerability assessments.
Exploit plugins are used as proof of concepts for discovered vulns.
sapytoAgents deployment.
New plugins for auditing SAProuters, find clients, bruteforcing, …
27
© 2008
Discovery PhaseDiscovery Phase
Finding SAP targets
28
© 2008
Discovering SAP Systems and Applications (Targets)Discovering SAP Systems and Applications (Targets)Discovering SAP Systems and Applications (Targets)Discovering SAP Systems and Applications (Targets)
Discovery Phase
Available Options:
Traffic sniffing.
SAP portscanning.
Checking SAPGUI configurations.
SAP Systems use a “fixed” range of ports.
Most ports follows the PREFIX + SYS. NUMBER format.
Common ports: 32XX, 33XX, 36XX, 39XX, 3299, 81XX, …
Nmap: Watch Timings (-T3) and don’t use version detection.
New sapyto will provide automatic discovery of SAP systems and
configuration of targets/connectors for auditing!
29
© 2008
ExplorationExploration PhasePhase
Getting as much information as possible
30
© 2008
Getting Information from SAP Application ServersGetting Information from SAP Application ServersGetting Information from SAP Application ServersGetting Information from SAP Application Servers
Exploration Phase
The RFC_SYSTEM_INFO function module returns information about
remote SAP Application Servers (implemented in sapyto’s sapinfo plugin)
Can be called remotely (and anonymously) by default. [5]
sapinfo(target#0) {
Remote System Information:
RFC Log Version: 011
Release Status of SAP System: 700
Kernel Release: 700
Operating System: Linux
Database Host: sapl01
Central Database System: ORACLE
Integer Format: Little Endian
Dayligth Saving Time:
Float Type Format: IEEE
Hostame: sapl01
IP Address: 192.168.3.4
System ID: TL1
RFC Destination: sapl01_TL1_00
Timezone: -18000 (diff from UTC in seconds)
Character Set: 4103
Machine ID: 390
31
© 2008
Getting Information from SAP Application ServersGetting Information from SAP Application ServersGetting Information from SAP Application ServersGetting Information from SAP Application Servers
Exploration Phase
The RFC_SYSTEM_INFO function module returns information about
remote SAP Application Servers (implemented in sapyto’s sapinfo plugin)
Can be called remotely (and anonymously) by default. [5]
sapinfo(target#0) {
Remote System Information:
RFC Log Version: 011
Release Status of SAP System: 700
Kernel Release: 700
Operating System: Linux
Database Host: sapl01
Central Database System: ORACLE
Integer Format: Little Endian
Dayligth Saving Time:
Float Type Format: IEEE
Hostame: sapl01
IP Address: 192.168.3.4
System ID: TL1
RFC Destination: sapl01_TL1_00
Timezone: -18000 (diff from UTC in seconds)
Character Set: 4103
Machine ID: 390
Protection / Countermeasure
Restrict connections to the SAP Gateway at the network level.
For more information, refer to SAP Note 931252.
32
© 2008
Finding Available ClientsFinding Available ClientsFinding Available ClientsFinding Available Clients
Exploration Phase
Users are client-dependent.
Default clients: 000, 001, 066.
getClients(target#0) {
Client 000 is available.
Client 001 is available.
Client 066 is available.
Client 101 is available.
Client 200 is available.
} res: Ok
33
© 2008
Analyzing Shared ResourcesAnalyzing Shared ResourcesAnalyzing Shared ResourcesAnalyzing Shared Resources
Exploration Phase
The Common Transport Directory (CTD) is the directory where
changes (transports) are exported to and imported from in an SAP
landscape.
This directory must be shared for all systems in the landscape.
It is often the case, where the kernel files and profiles are shared to
dialog instances.
$ showmount –e sapserver
/export/usr/sap/trans (everyone)
/export/sapmnt/NP1 (everyone)
/export/informix/NP1 (everyone)
/export/interfacesNP1 (everyone)
/export/interfsrcNP1 (everyone)
34
© 2008
Analyzing Shared ResourcesAnalyzing Shared ResourcesAnalyzing Shared ResourcesAnalyzing Shared Resources
Exploration Phase
The Common Transport Directory (CTD) is the directory where
changes (transports) are exported to and imported from in an SAP
landscape.
This directory must be shared for all systems in the landscape.
It is often the case, where the kernel files and profiles are shared to
dialog instances.
$ showmount –e sapserver
/export/usr/sap/trans (everyone)
/export/sapmnt/NP1 (everyone)
/export/informix/NP1 (everyone)
/export/interfacesNP1 (everyone)
/export/interfsrcNP1 (everyone)
Protection / Countermeasure
Shared resource access should be restricted to SAP
related systems and users only.
35
© 2008
VulnerabilityVulnerability
AssesmentAssesment PhasePhase
Analyzing the discovered components
36
© 2008
SAP Default UsersSAP Default UsersSAP Default UsersSAP Default Users
Vulnerability Assessment Phase
There is public information regarding the existence of default SAP
user accounts.
Many of these accounts are configured with high privileged profiles.
ADMIN000, 001Communication UserSAPCPIC
SUPPORT066User for the
EarlyWatch Service
EARLYWATCH
19920706000,001ABAP Dictionary super
user
DDIC
06071992
PASS
000,001, 066
new clients
Super userSAP*
PasswordClientsDescriptionUser ID
37
© 2008
SAP Default UsersSAP Default UsersSAP Default UsersSAP Default Users
Vulnerability Assessment Phase
There is public information regarding the existence of default SAP
user accounts.
Many of these accounts are configured with high privileged profiles.
ADMIN000, 001Communication UserSAPCPIC
SUPPORT066User for the
EarlyWatch Service
EARLYWATCH
19920706000,001ABAP Dictionary super
user
DDIC
06071992
PASS
000,001, 066
new clients
Super userSAP*
PasswordClientsDescriptionUser ID
Protection / Countermeasure
Default users must be secured.
SAP* should be deactivated.
Use report RSUSR003 to check the status of default users.
38
© 2008
SAP User AccountSAP User AccountSAP User AccountSAP User Account BruteforcingBruteforcingBruteforcingBruteforcing
Vulnerability Assessment Phase
Usernames are up to 12 characters long.
As part of the PenTest, you can try guessing/cracking user credentials.
SensitiveInsensitiveCase
408Max. Length
New Passwords (> 6.40)Old Passwords (≤ 6.40)
WARNING! User locking is implemented! (usually, between 3-12 tries)
Ops! In versions ≤ 6.20, lock counter is not incremented through RFC.
sapyto’s bruteLogin plugin can work in different modes:
Try default users only and SAP*:PASS in detected clients.
Specific credentials wordlist.
Username and Password wordlists.
39
© 2008
Getting Credentials from the WireGetting Credentials from the WireGetting Credentials from the WireGetting Credentials from the Wire –––– RFC SniffingRFC SniffingRFC SniffingRFC Sniffing
Vulnerability Assessment Phase
RFC (Remote Function Call) is the most widely used interface in the
SAP world.
In order for a system to connect through RFC, it must provide login
information for the remote system.
RFC is clear-text, but you won’t be able to see the password in the
wire…
Password is obfuscated! -> Use sapyto’s getPassword plugin
...
01a0 00 00 00 00 00 00 06 05 14 00 10 5f 22 ea 45 5e ..........._".E^
01b0 22 c5 10 e1 00 00 00 c0 a8 02 8b 05 14 01 30 00 ".............0.
01c0 0a 72 66 63 5f 73 65 72 76 65 72 01 30 01 11 00 .rfc_server.0...
01d0 06 42 43 55 53 45 52 01 11 01 17 00 0b 81 bb 89 .BCUSER.........
01e0 62 fc b5 3e 70 07 6e 79 01 17 01 14 00 03 30 30 b..?w.oy......00
01f0 30 01 14 01 15 00 01 45 01 15 05 01 00 01 01 05 0......E........
0200 01 05 02 00 00 05 02 00 0b 00 03 36 34 30 00 0b ...........640..
0210 01 02 00 0e 5a 43 55 53 54 5f 47 45 54 4d 4f 4e ....ZCUST_GETMON
0220 45 59 01 02 05 14 00 10 5f 22 ea 45 5e 22 c5 10 EY......_".E^"..
0230 e1 00 00 00 c0 a8 02 8b 05 14 02 01 00 09 43 4c ..............CL
0240 49 45 4e 54 5f 49 44 02 01 02 03 00 08 43 55 53 IENT_ID......CUS
0250 54 30 30 31 00 02 03 ff ff 00 00 ff ff 00 00 01 T001............
0260 c7 00 00 3e 80 ...>.
for CHAR in CLEAR_TEXT_PASS:
OBFUSCATED_PASS[i] = CHAR XOR KEY[i]
40
© 2008
Getting Credentials from the WireGetting Credentials from the WireGetting Credentials from the WireGetting Credentials from the Wire –––– RFC SniffingRFC SniffingRFC SniffingRFC Sniffing
Vulnerability Assessment Phase
RFC (Remote Function Call) is the most widely used interface in the
SAP world.
In order for a system to connect through RFC, it must provide login
information for the remote system.
RFC is clear-text, but you won’t be able to see the password in the
wire…
Password is obfuscated! -> Use sapyto’s getPassword plugin
...
01a0 00 00 00 00 00 00 06 05 14 00 10 5f 22 ea 45 5e ..........._".E^
01b0 22 c5 10 e1 00 00 00 c0 a8 02 8b 05 14 01 30 00 ".............0.
01c0 0a 72 66 63 5f 73 65 72 76 65 72 01 30 01 11 00 .rfc_server.0...
01d0 06 42 43 55 53 45 52 01 11 01 17 00 0b 81 bb 89 .BCUSER.........
01e0 62 fc b5 3e 70 07 6e 79 01 17 01 14 00 03 30 30 b..?w.oy......00
01f0 30 01 14 01 15 00 01 45 01 15 05 01 00 01 01 05 0......E........
0200 01 05 02 00 00 05 02 00 0b 00 03 36 34 30 00 0b ...........640..
0210 01 02 00 0e 5a 43 55 53 54 5f 47 45 54 4d 4f 4e ....ZCUST_GETMON
0220 45 59 01 02 05 14 00 10 5f 22 ea 45 5e 22 c5 10 EY......_".E^"..
0230 e1 00 00 00 c0 a8 02 8b 05 14 02 01 00 09 43 4c ..............CL
0240 49 45 4e 54 5f 49 44 02 01 02 03 00 08 43 55 53 IENT_ID......CUS
0250 54 30 30 31 00 02 03 ff ff 00 00 ff ff 00 00 01 T001............
0260 c7 00 00 3e 80 ...>.
for CHAR in CLEAR_TEXT_PASS:
OBFUSCATED_PASS[i] = CHAR XOR KEY[i]
Protection / Countermeasure
Enable SNC, protecting the confidentiality and integrity of
the traffic.
41
© 2008
Analysis of the RFC InterfaceAnalysis of the RFC InterfaceAnalysis of the RFC InterfaceAnalysis of the RFC Interface
Vulnerability Assessment Phase
RFC Communication is done through the Gateway Service.
The GW can connect with external RFC servers:
Registered Servers:
The external system registers to the GW under a Program ID.
Started Servers:
The GW connects to a remote system and starts a program (trust?)
By exploiting Registered Servers caveats, it may be possible to obtain
confidential information, DoS, perform RFC MITM and callback attacks.
By exploiting Started Servers vulnerabilities, it may be possible to obtain
remote code execution on misconfigured Application Servers.
(check the “Attacking the Giants: Exploiting SAP Internals” white-paper)
42
© 2008
ExploitationExploitation PhasePhase
Getting access and beyond
43
© 2008
ButButButBut………… why do we need Exploitation anyway?why do we need Exploitation anyway?why do we need Exploitation anyway?why do we need Exploitation anyway?
Exploitation Phase
Vulnerability Assessments reports enumerate discovered vulnerabilities
with the associated risk estimate.
A security aware individual would easily see the problems.
But, what about the people from the Financial areas?
For them to get involved, they need to see the facts! You must show
them how “their” information can be compromised -> screenshots, live-
demos…
Vulnerability Assessments are 2D, Exploitation adds a new Dimension.
44
© 2008
SAP Password Considerations & CrackingSAP Password Considerations & CrackingSAP Password Considerations & CrackingSAP Password Considerations & Cracking
Exploitation Phase
SAP has implemented different password hashing mechanisms.
Passwords hashes are stored in table USR02 (BCODE, PASSCODE)
and USH02.
Code Version F + Code Version B (2 hashes)G
Based on SHA1, 40 characters, Case
Insensitive, UTF-8
F
ReservedE
Based on MD5, 8 characters, Uppercase, UTF-8D
Not implementedC
Based on MD5, 8 characters, Uppercase, ASCIIB
ObsoleteA
DescriptionCode Vers.
On June 26 2008, a patch for John The Ripper for CODVN B and F was
published.
45
© 2008
SAP Password Considerations & CrackingSAP Password Considerations & CrackingSAP Password Considerations & CrackingSAP Password Considerations & Cracking
Exploitation Phase
SAP has implemented different password hashing mechanisms.
Passwords hashes are stored in table USR02 (BCODE, PASSCODE)
and USH02.
Code Version F + Code Version B (2 hashes)G
Based on SHA1, 40 characters, Case
Insensitive, UTF-8
F
ReservedE
Based on MD5, 8 characters, Uppercase, UTF-8D
Not implementedC
Based on MD5, 8 characters, Uppercase, ASCIIB
ObsoleteA
DescriptionCode Vers.
On June 26, a patch for John The Ripper for CODVN B and F was
published.
Protection / Countermeasure
Access to tables USR02 and USH02 should be protected.
Password security should be enforced through profile
configuration (login/* parameters).
Table USR40 can be used to protect from trivial passwords.
For more information, refer to SAP Note 1237762.
46
© 2008
Exploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication Mechanism
Exploitation Phase
Discovered by me in 2007.
Discovered by Jochen Hein in 2003 (D’oh!)
Target: Default SAP/Oracle installations.
The SAP+Oracle Authentication Mechanism
SAP connects to the database as the OPS$<username> (eg: OPS$<SID>adm).
Retrieves user and password from table SAPUSER.
Re-connects to the database, using the retrieved credentials.
47
© 2008
Exploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication Mechanism
Exploitation Phase
There is a special Oracle configuration parameter named
REMOTE_OS_AUTHENT.
If set to TRUE, Oracle “trusts” that the remote system has authenticated the
user used for the SQL connection (!)
The user is created as “indentified externally” in the Oracle database.
Oracle recommendation: remote_os_authent = false
SAP default and necessary configuration: remote_os_authent = true
What do you need?
Database host/port.
SAP System ID.
Oracle Instance ID ( = SAPSID?)
48
© 2008
Exploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication Mechanism
Exploitation Phase
There is a special Oracle configuration parameter named
REMOTE_OS_AUTHENT.
If set to TRUE, Oracle “trusts” that the remote system has authenticated the
user used for the SQL connection (!)
The user is created as “indentified externally” in the Oracle database.
Oracle recommendation: remote_os_authent = false
SAP default and necessary configuration: remote_os_authent = true
What do you need?
Database host/port.
SAP System ID.
Oracle Instance ID ( = SAPSID?)
Protection / Countermeasure
Restrict who can connect to the Oracle listener:
tcp.validnode_checking = yes
tcp.invited_nodes = (192.168.1.102, …)
49
© 2008
Exploiting Weak RFC Interface SecurityExploiting Weak RFC Interface SecurityExploiting Weak RFC Interface SecurityExploiting Weak RFC Interface Security
Exploitation Phase
Possible in default configuration of SAP Systems.
Allows for unauthenticated remote code execution.
…
…
Starting EXPLOIT plugins
----------------------------
weakRFC(target#1) {
Creating new SHELL object...
SHELL object created. ID: 536
} res: Ok
sapyto> shells
sapyto/shells> list
Shell ID: 536 [RFCShell]
Target information:
Connector: SAPRFC_EXT
SAP Gateway Host: sapprd01
SAP Gateway Service: 3300
...
...
sapyto/shells> start 536
Starting shell #536
RFCShell - Run commands through RFC.
The remote target OS is: Win.NET.
sapyto/shells/536> run whoami
Call successfull. Command output:
prdadm
sapyto/shells/536>
50
© 2008
Exploiting Weak RFC Interface SecurityExploiting Weak RFC Interface SecurityExploiting Weak RFC Interface SecurityExploiting Weak RFC Interface Security
Exploitation Phase
Possible in default configuration of SAP Systems.
Allows for unauthenticated remote code execution.
…
…
Starting EXPLOIT plugins
----------------------------
weakRFC(target#1) {
Creating new SHELL object...
SHELL object created. ID: 536
} res: Ok
sapyto> shells
sapyto/shells> list
Shell ID: 536 [RFCShell]
Target information:
Connector: SAPRFC_EXT
SAP Gateway Host: sapprd01
SAP Gateway Service: 3300
...
...
sapyto/shells> start 536
Starting shell #536
RFCShell - Run commands through RFC.
The remote target OS is: Win.NET.
sapyto/shells/536> run whoami
Call successfull. Command output:
prdadm
sapyto/shells/536>
Protection / Countermeasure
Starting of External RFC Servers is controlled through the file
specified by the gw/sec_info profile parameter.
This file should exist and restrict access to allowed systems
to start specific programs in the Application Servers.
The gw/reg_info file protects Registered Servers and should
be configured as well.
For more information, refer to SAP Note 618516.
51
© 2008
Case Study:Case Study:
SAProuterSAProuter SecuritySecurity
AssessmentAssessment
52
© 2008
Internet
Internal Network
Border FW
SAProuter
DEV
Other Internal
Systems
IntraWeb
External User
QAS PRD
SSH Server
Internal Users Mainframe
SAProuterSAProuterSAProuterSAProuter IntroductionIntroductionIntroductionIntroduction
Case Study: SAProuter Security Assessment
SAProuter is an SAP program working as a proxy, which analyzes
connections between SAP systems and between SAP systems and
external networks.
Typical SAProuter Architecture
53
© 2008
SAProuterSAProuterSAProuterSAProuter IntroductionIntroductionIntroductionIntroduction
Case Study: SAProuter Security Assessment
If SAProuter is in place, clients have to specify a route string to connect.
/H/saprouter/S/3299/H/sapprd1/S/3200
Access in controlled through an ACL file called Route Permission Table.
Entry format:
First-match criteria.
In no match, deny connection.
P/S/D src_host dst_host dst_port pwd
54
© 2008
TheTheTheThe RouteRouteRouteRoute PermissionPermissionPermissionPermission TableTableTableTable
Case Study: SAProuter Security Assessment
Route Permission Table Example:
D host1 host2 serviceX
P 192.168.1.* host2 * pass123
S 10.1.*.* 10.1.2.* *
D * * * *
Route Permission Table in the realrealrealreal life:
D host1 host2 serviceX
P 192.168.1.* host2 * pass123
S 10.1.*.* 10.1.2.* *
P * * * *
55
© 2008
SAProuterSAProuterSAProuterSAProuter SecuritySecuritySecuritySecurity AssessmentAssessmentAssessmentAssessment withwithwithwith sapytosapytosapytosapyto
Case Study: SAProuter Security Assessment
The saprouterSpy plugin
Performs Internal Network port-scan.
Discovers new targets through SAProuter and configure them for
auditing by other plugins.
56
© 2008
SAProuterSAProuterSAProuterSAProuter SecuritySecuritySecuritySecurity AssessmentAssessmentAssessmentAssessment:::: sapytoAgentssapytoAgentssapytoAgentssapytoAgents
Case Study: SAProuter Security Assessment
Native Routing
SAPRouter also supports the “routing” of native protocols.
Useful for remote administration of Operating Systems, DB, etc.
Certain limitations apply.
saprouterAgent plugin deploys a sapytoAgent, which can be used to
proxy native connections (HTTP, SSH, Telnet, etc) to internal systems.
57
© 2008
Internet
Internal Network
Border FW
SAProuter
DEV
Other Internal
Systems
IntraWeb
External User
QAS PRD
SSH Server
Internal Users Mainframe
SAProuterSAProuterSAProuterSAProuter IntroductionIntroductionIntroductionIntroduction
Case Study: SAProuter Security Assessment
SAProuter is an SAP program working as a proxy, which analyzes
connections between SAP systems and between SAP systems and
external networks.
Typical SAProuter Architecture
Protection / Countermeasure
SAProuter should be implemented in a separate DMZ.
Use VPNs and/or restrict connections at the border Firewall.
The Route Permission Table should restrict access only to allowed parties, to
specific targets and ports.
SNC should be required.
Entries containing wildcards (*) are discouraged and should be carefully analyzed.
58
© 2008
ConclusionsConclusions
Wrapping up
59
© 2008
ConclusionsConclusionsConclusionsConclusions
Conclusions
It’s impossible to cover all the activities of an SAP Pentest in a one hour talk!
SAP systems deal with sensitive business information and processes. The
integrity, confidentiality and availability of this information is critical.
SAP systems security is often overlooked during the implementation phase, in
order to avoid “business delays”.
SAP security is much more than User Roles/Profiles and Authorizations!
By default, some configurations would expose the systems to high risk threats.
SAP provides many ways to secure systems and communications.
Administrators should enable security settings as soon as possible.
Pentesting your SAP systems will let you know the current security level of your
implementation (and show your managers why you need resources to secure it :P )
CYBSEC’s sapyto supports activities of all phases of the project.
SAP Penetration Tests should be carried out in controlled environments,
performed by qualified experts in the subject.
60
© 2008
ReferencesReferencesReferencesReferences
References
“Attacking the Giants: Exploiting SAP Internals” White-paper
http://www.cybsec.com/upload/bh-eu-07-nunez-di-croce-WP_paper.pdf
John The Ripper Patch for SAP hashes
http://marc.info/?l=john-users&m=121444075820309&w=2
sapyto
http://www.cybsec.com/EN/research/sapyto.php
CYBSEC’s SAP Security Services
http://www.cybsec.com/EN/services/SAP_security.php
SAP Note 931252 - Security Note: Authority Check for Function Group SRFC.
SAP Note 618516 - Security-related enhancement of RFCEXEC program.
SAP Note 1237762 - ABAP systems: Protection against password hash attacks
61
© 2008
¿¿QuestionsQuestions??
62
© 2008
ThankThank youyou!!
www.cybsec.com

More Related Content

What's hot

Sap security – thinking with a hacker’s hat
Sap security – thinking with a hacker’s hatSap security – thinking with a hacker’s hat
Sap security – thinking with a hacker’s hat
n|u - The Open Security Community
 
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP ForensicsOnapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Onapsis Inc.
 
Practical SAP pentesting (B-Sides San Paulo)
Practical SAP pentesting (B-Sides San Paulo)Practical SAP pentesting (B-Sides San Paulo)
Practical SAP pentesting (B-Sides San Paulo)
ERPScan
 
5 real ways to destroy business by breaking SAP applications
5 real ways to destroy business by breaking SAP applications5 real ways to destroy business by breaking SAP applications
5 real ways to destroy business by breaking SAP applications
ERPScan
 
Blended Web and Database Attacks on Real Time In-memory Platforms
Blended Web and Database Attacks on Real Time In-memory PlatformsBlended Web and Database Attacks on Real Time In-memory Platforms
Blended Web and Database Attacks on Real Time In-memory Platforms
Onapsis Inc.
 
A Holistic View on SAP Security Why Securing Production Systems Is Not Enough
 	A Holistic View on SAP Security Why Securing Production Systems Is Not Enough 	A Holistic View on SAP Security Why Securing Production Systems Is Not Enough
A Holistic View on SAP Security Why Securing Production Systems Is Not Enough
Onapsis Inc.
 
Preventing Vulnerabilities in SAP HANA based Deployments
Preventing Vulnerabilities in SAP HANA based DeploymentsPreventing Vulnerabilities in SAP HANA based Deployments
Preventing Vulnerabilities in SAP HANA based Deployments
Onapsis Inc.
 
All your SAP passwords belong to us
All your SAP passwords belong to usAll your SAP passwords belong to us
All your SAP passwords belong to us
ERPScan
 
Assess and monitor SAP security
Assess and monitor SAP securityAssess and monitor SAP security
Assess and monitor SAP securityERPScan
 
Incident Response and SAP Systems
Incident Response and SAP SystemsIncident Response and SAP Systems
Incident Response and SAP SystemsOnapsis Inc.
 
If I want a perfect cyberweapon, I'll target ERP - second edition
If I want a perfect cyberweapon, I'll target ERP - second editionIf I want a perfect cyberweapon, I'll target ERP - second edition
If I want a perfect cyberweapon, I'll target ERP - second editionERPScan
 
SAP security landscape. How to protect(hack) your(their) big business
SAP security landscape. How to protect(hack) your(their) big businessSAP security landscape. How to protect(hack) your(their) big business
SAP security landscape. How to protect(hack) your(their) big businessERPScan
 
SAP SDM Hacking
SAP SDM HackingSAP SDM Hacking
SAP SDM Hacking
ERPScan
 
Assessing and Securing SAP Solutions
Assessing and Securing SAP SolutionsAssessing and Securing SAP Solutions
Assessing and Securing SAP Solutions
ERPScan
 
Attacking SAP Mobile
Attacking SAP MobileAttacking SAP Mobile
Attacking SAP Mobile
ERPScan
 
Securing SAP in 5 steps
Securing SAP in 5 stepsSecuring SAP in 5 steps
Securing SAP in 5 steps
ERPScan
 
Practical pentesting of ERPs and business applications
Practical pentesting of ERPs and business applicationsPractical pentesting of ERPs and business applications
Practical pentesting of ERPs and business applications
ERPScan
 
Inception of the SAP Platforms Brain: Attacks on SAP Solution Manager
Inception of the SAP Platforms Brain: Attacks on SAP Solution ManagerInception of the SAP Platforms Brain: Attacks on SAP Solution Manager
Inception of the SAP Platforms Brain: Attacks on SAP Solution Manager
Onapsis Inc.
 
If I want a perfect cyberweapon, I'll target ERP
If I want a perfect cyberweapon, I'll target ERPIf I want a perfect cyberweapon, I'll target ERP
If I want a perfect cyberweapon, I'll target ERP
ERPScan
 
SAP security made easy
SAP security made easySAP security made easy
SAP security made easyERPScan
 

What's hot (20)

Sap security – thinking with a hacker’s hat
Sap security – thinking with a hacker’s hatSap security – thinking with a hacker’s hat
Sap security – thinking with a hacker’s hat
 
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP ForensicsOnapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
 
Practical SAP pentesting (B-Sides San Paulo)
Practical SAP pentesting (B-Sides San Paulo)Practical SAP pentesting (B-Sides San Paulo)
Practical SAP pentesting (B-Sides San Paulo)
 
5 real ways to destroy business by breaking SAP applications
5 real ways to destroy business by breaking SAP applications5 real ways to destroy business by breaking SAP applications
5 real ways to destroy business by breaking SAP applications
 
Blended Web and Database Attacks on Real Time In-memory Platforms
Blended Web and Database Attacks on Real Time In-memory PlatformsBlended Web and Database Attacks on Real Time In-memory Platforms
Blended Web and Database Attacks on Real Time In-memory Platforms
 
A Holistic View on SAP Security Why Securing Production Systems Is Not Enough
 	A Holistic View on SAP Security Why Securing Production Systems Is Not Enough 	A Holistic View on SAP Security Why Securing Production Systems Is Not Enough
A Holistic View on SAP Security Why Securing Production Systems Is Not Enough
 
Preventing Vulnerabilities in SAP HANA based Deployments
Preventing Vulnerabilities in SAP HANA based DeploymentsPreventing Vulnerabilities in SAP HANA based Deployments
Preventing Vulnerabilities in SAP HANA based Deployments
 
All your SAP passwords belong to us
All your SAP passwords belong to usAll your SAP passwords belong to us
All your SAP passwords belong to us
 
Assess and monitor SAP security
Assess and monitor SAP securityAssess and monitor SAP security
Assess and monitor SAP security
 
Incident Response and SAP Systems
Incident Response and SAP SystemsIncident Response and SAP Systems
Incident Response and SAP Systems
 
If I want a perfect cyberweapon, I'll target ERP - second edition
If I want a perfect cyberweapon, I'll target ERP - second editionIf I want a perfect cyberweapon, I'll target ERP - second edition
If I want a perfect cyberweapon, I'll target ERP - second edition
 
SAP security landscape. How to protect(hack) your(their) big business
SAP security landscape. How to protect(hack) your(their) big businessSAP security landscape. How to protect(hack) your(their) big business
SAP security landscape. How to protect(hack) your(their) big business
 
SAP SDM Hacking
SAP SDM HackingSAP SDM Hacking
SAP SDM Hacking
 
Assessing and Securing SAP Solutions
Assessing and Securing SAP SolutionsAssessing and Securing SAP Solutions
Assessing and Securing SAP Solutions
 
Attacking SAP Mobile
Attacking SAP MobileAttacking SAP Mobile
Attacking SAP Mobile
 
Securing SAP in 5 steps
Securing SAP in 5 stepsSecuring SAP in 5 steps
Securing SAP in 5 steps
 
Practical pentesting of ERPs and business applications
Practical pentesting of ERPs and business applicationsPractical pentesting of ERPs and business applications
Practical pentesting of ERPs and business applications
 
Inception of the SAP Platforms Brain: Attacks on SAP Solution Manager
Inception of the SAP Platforms Brain: Attacks on SAP Solution ManagerInception of the SAP Platforms Brain: Attacks on SAP Solution Manager
Inception of the SAP Platforms Brain: Attacks on SAP Solution Manager
 
If I want a perfect cyberweapon, I'll target ERP
If I want a perfect cyberweapon, I'll target ERPIf I want a perfect cyberweapon, I'll target ERP
If I want a perfect cyberweapon, I'll target ERP
 
SAP security made easy
SAP security made easySAP security made easy
SAP security made easy
 

Viewers also liked

SAP Test automation - fully automatic test of complex business processes incl...
SAP Test automation - fully automatic test of complex business processes incl...SAP Test automation - fully automatic test of complex business processes incl...
SAP Test automation - fully automatic test of complex business processes incl...
Tobias Trapp
 
Sap pi overview
Sap pi overviewSap pi overview
Sap pi overviewsmavachee
 
SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01
Argos
 
Sap interface overview
Sap interface overviewSap interface overview
Sap interface overviewgnareshmbacwa
 
Ale edi i_doc.sapdb.info
Ale edi i_doc.sapdb.infoAle edi i_doc.sapdb.info
Ale edi i_doc.sapdb.infoIvs Naresh
 
Ale Idoc Edi
Ale Idoc EdiAle Idoc Edi
Ale Idoc Edi
shesagiri
 
SAP INTEGRATIONS WITH SERVICENOW
SAP INTEGRATIONS WITH SERVICENOWSAP INTEGRATIONS WITH SERVICENOW
SAP INTEGRATIONS WITH SERVICENOW
Aspediens
 
SAP ALE Idoc
SAP ALE IdocSAP ALE Idoc
SAP ALE Idoc
Jugul Crasta
 
SAP Performance Testing Best Practice Guide v1.0
SAP Performance Testing Best Practice Guide v1.0SAP Performance Testing Best Practice Guide v1.0
SAP Performance Testing Best Practice Guide v1.0
Argos
 
CIN India Country Version for Taxes
CIN India Country Version for TaxesCIN India Country Version for Taxes
CIN India Country Version for TaxesMABarve
 
SAP GST INDIA
SAP GST INDIA SAP GST INDIA
SAP GST INDIA
Hari Krishna
 

Viewers also liked (11)

SAP Test automation - fully automatic test of complex business processes incl...
SAP Test automation - fully automatic test of complex business processes incl...SAP Test automation - fully automatic test of complex business processes incl...
SAP Test automation - fully automatic test of complex business processes incl...
 
Sap pi overview
Sap pi overviewSap pi overview
Sap pi overview
 
SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01
 
Sap interface overview
Sap interface overviewSap interface overview
Sap interface overview
 
Ale edi i_doc.sapdb.info
Ale edi i_doc.sapdb.infoAle edi i_doc.sapdb.info
Ale edi i_doc.sapdb.info
 
Ale Idoc Edi
Ale Idoc EdiAle Idoc Edi
Ale Idoc Edi
 
SAP INTEGRATIONS WITH SERVICENOW
SAP INTEGRATIONS WITH SERVICENOWSAP INTEGRATIONS WITH SERVICENOW
SAP INTEGRATIONS WITH SERVICENOW
 
SAP ALE Idoc
SAP ALE IdocSAP ALE Idoc
SAP ALE Idoc
 
SAP Performance Testing Best Practice Guide v1.0
SAP Performance Testing Best Practice Guide v1.0SAP Performance Testing Best Practice Guide v1.0
SAP Performance Testing Best Practice Guide v1.0
 
CIN India Country Version for Taxes
CIN India Country Version for TaxesCIN India Country Version for Taxes
CIN India Country Version for Taxes
 
SAP GST INDIA
SAP GST INDIA SAP GST INDIA
SAP GST INDIA
 

Similar to Sap penetration testing_defense_in_depth

Exploiting Critical Attack Vectors to Gain Control of SAP Systems
Exploiting Critical Attack Vectors to Gain Control of SAP SystemsExploiting Critical Attack Vectors to Gain Control of SAP Systems
Exploiting Critical Attack Vectors to Gain Control of SAP Systems
Onapsis Inc.
 
SAST Managed Services for SAP [Webinar]
SAST Managed Services for SAP [Webinar]SAST Managed Services for SAP [Webinar]
SAST Managed Services for SAP [Webinar]
akquinet enterprise solutions GmbH
 
SAP Forensics Detecting White Collar Cyber-crime
SAP Forensics Detecting White Collar Cyber-crimeSAP Forensics Detecting White Collar Cyber-crime
SAP Forensics Detecting White Collar Cyber-crime
Onapsis Inc.
 
Isms5
Isms5Isms5
Isms5
aaditya
 
Deploying Static Application Security Testing on a Large Scale
Deploying Static Application Security Testing on a Large ScaleDeploying Static Application Security Testing on a Large Scale
Deploying Static Application Security Testing on a Large Scale
Achim D. Brucker
 
SAST Code Security Advisor for SAP [Webinar]
SAST Code Security Advisor for SAP [Webinar]SAST Code Security Advisor for SAP [Webinar]
SAST Code Security Advisor for SAP [Webinar]
akquinet enterprise solutions GmbH
 
Attacks Based on Security Configurations
Attacks Based on Security ConfigurationsAttacks Based on Security Configurations
Attacks Based on Security Configurations
Onapsis Inc.
 
Cyber attacks on your SAP S/4HANA systems? So you can stay relaxed. [Webinar]
Cyber attacks on your SAP S/4HANA systems? So you can stay relaxed. [Webinar]Cyber attacks on your SAP S/4HANA systems? So you can stay relaxed. [Webinar]
Cyber attacks on your SAP S/4HANA systems? So you can stay relaxed. [Webinar]
akquinet enterprise solutions GmbH
 
Monitoring for Operational Outcomes and Application Insights: Best Practices ...
Monitoring for Operational Outcomes and Application Insights: Best Practices ...Monitoring for Operational Outcomes and Application Insights: Best Practices ...
Monitoring for Operational Outcomes and Application Insights: Best Practices ...
Amazon Web Services
 
Effective Cyber Security – the difference between “point in time” and “period...
Effective Cyber Security – the difference between “point in time” and “period...Effective Cyber Security – the difference between “point in time” and “period...
Effective Cyber Security – the difference between “point in time” and “period...
akquinet enterprise solutions GmbH
 
SAST Threat Detection: What you stand to gain from intelligent, SAP real-time...
SAST Threat Detection: What you stand to gain from intelligent, SAP real-time...SAST Threat Detection: What you stand to gain from intelligent, SAP real-time...
SAST Threat Detection: What you stand to gain from intelligent, SAP real-time...
akquinet enterprise solutions GmbH
 
Short introduction to SAP security research (sitNL)
Short introduction to SAP security research (sitNL)Short introduction to SAP security research (sitNL)
Short introduction to SAP security research (sitNL)
Twan van den Broek
 
Best Practice Guide Security: How to check your SAP systems for security. [We...
Best Practice Guide Security: How to check your SAP systems for security. [We...Best Practice Guide Security: How to check your SAP systems for security. [We...
Best Practice Guide Security: How to check your SAP systems for security. [We...
akquinet enterprise solutions GmbH
 
Security Testing: Myths, Challenges, and Opportunities - Experiences in Integ...
Security Testing: Myths, Challenges, and Opportunities - Experiences in Integ...Security Testing: Myths, Challenges, and Opportunities - Experiences in Integ...
Security Testing: Myths, Challenges, and Opportunities - Experiences in Integ...
Achim D. Brucker
 
Simple SAP Security Breach !!
Simple SAP Security Breach !!Simple SAP Security Breach !!
Simple SAP Security Breach !!
SAPYard
 
Addressing Web Application Security Vulnerabilities.pdf
Addressing Web Application Security Vulnerabilities.pdfAddressing Web Application Security Vulnerabilities.pdf
Addressing Web Application Security Vulnerabilities.pdf
CecilSu
 
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
Amazon Web Services
 
Erp security joris-van_de_vis_sap_security_sitnl_2015_v0.2
Erp security joris-van_de_vis_sap_security_sitnl_2015_v0.2Erp security joris-van_de_vis_sap_security_sitnl_2015_v0.2
Erp security joris-van_de_vis_sap_security_sitnl_2015_v0.2
jvandevis
 
Pen Testing SAP Critical Information Exposed
Pen Testing SAP Critical Information ExposedPen Testing SAP Critical Information Exposed
Pen Testing SAP Critical Information Exposed
Onapsis Inc.
 
Towards new shores with cross-system SoD analyses. [Webinar]
Towards new shores with cross-system SoD analyses. [Webinar]Towards new shores with cross-system SoD analyses. [Webinar]
Towards new shores with cross-system SoD analyses. [Webinar]
akquinet enterprise solutions GmbH
 

Similar to Sap penetration testing_defense_in_depth (20)

Exploiting Critical Attack Vectors to Gain Control of SAP Systems
Exploiting Critical Attack Vectors to Gain Control of SAP SystemsExploiting Critical Attack Vectors to Gain Control of SAP Systems
Exploiting Critical Attack Vectors to Gain Control of SAP Systems
 
SAST Managed Services for SAP [Webinar]
SAST Managed Services for SAP [Webinar]SAST Managed Services for SAP [Webinar]
SAST Managed Services for SAP [Webinar]
 
SAP Forensics Detecting White Collar Cyber-crime
SAP Forensics Detecting White Collar Cyber-crimeSAP Forensics Detecting White Collar Cyber-crime
SAP Forensics Detecting White Collar Cyber-crime
 
Isms5
Isms5Isms5
Isms5
 
Deploying Static Application Security Testing on a Large Scale
Deploying Static Application Security Testing on a Large ScaleDeploying Static Application Security Testing on a Large Scale
Deploying Static Application Security Testing on a Large Scale
 
SAST Code Security Advisor for SAP [Webinar]
SAST Code Security Advisor for SAP [Webinar]SAST Code Security Advisor for SAP [Webinar]
SAST Code Security Advisor for SAP [Webinar]
 
Attacks Based on Security Configurations
Attacks Based on Security ConfigurationsAttacks Based on Security Configurations
Attacks Based on Security Configurations
 
Cyber attacks on your SAP S/4HANA systems? So you can stay relaxed. [Webinar]
Cyber attacks on your SAP S/4HANA systems? So you can stay relaxed. [Webinar]Cyber attacks on your SAP S/4HANA systems? So you can stay relaxed. [Webinar]
Cyber attacks on your SAP S/4HANA systems? So you can stay relaxed. [Webinar]
 
Monitoring for Operational Outcomes and Application Insights: Best Practices ...
Monitoring for Operational Outcomes and Application Insights: Best Practices ...Monitoring for Operational Outcomes and Application Insights: Best Practices ...
Monitoring for Operational Outcomes and Application Insights: Best Practices ...
 
Effective Cyber Security – the difference between “point in time” and “period...
Effective Cyber Security – the difference between “point in time” and “period...Effective Cyber Security – the difference between “point in time” and “period...
Effective Cyber Security – the difference between “point in time” and “period...
 
SAST Threat Detection: What you stand to gain from intelligent, SAP real-time...
SAST Threat Detection: What you stand to gain from intelligent, SAP real-time...SAST Threat Detection: What you stand to gain from intelligent, SAP real-time...
SAST Threat Detection: What you stand to gain from intelligent, SAP real-time...
 
Short introduction to SAP security research (sitNL)
Short introduction to SAP security research (sitNL)Short introduction to SAP security research (sitNL)
Short introduction to SAP security research (sitNL)
 
Best Practice Guide Security: How to check your SAP systems for security. [We...
Best Practice Guide Security: How to check your SAP systems for security. [We...Best Practice Guide Security: How to check your SAP systems for security. [We...
Best Practice Guide Security: How to check your SAP systems for security. [We...
 
Security Testing: Myths, Challenges, and Opportunities - Experiences in Integ...
Security Testing: Myths, Challenges, and Opportunities - Experiences in Integ...Security Testing: Myths, Challenges, and Opportunities - Experiences in Integ...
Security Testing: Myths, Challenges, and Opportunities - Experiences in Integ...
 
Simple SAP Security Breach !!
Simple SAP Security Breach !!Simple SAP Security Breach !!
Simple SAP Security Breach !!
 
Addressing Web Application Security Vulnerabilities.pdf
Addressing Web Application Security Vulnerabilities.pdfAddressing Web Application Security Vulnerabilities.pdf
Addressing Web Application Security Vulnerabilities.pdf
 
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
 
Erp security joris-van_de_vis_sap_security_sitnl_2015_v0.2
Erp security joris-van_de_vis_sap_security_sitnl_2015_v0.2Erp security joris-van_de_vis_sap_security_sitnl_2015_v0.2
Erp security joris-van_de_vis_sap_security_sitnl_2015_v0.2
 
Pen Testing SAP Critical Information Exposed
Pen Testing SAP Critical Information ExposedPen Testing SAP Critical Information Exposed
Pen Testing SAP Critical Information Exposed
 
Towards new shores with cross-system SoD analyses. [Webinar]
Towards new shores with cross-system SoD analyses. [Webinar]Towards new shores with cross-system SoD analyses. [Webinar]
Towards new shores with cross-system SoD analyses. [Webinar]
 

Recently uploaded

GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 

Recently uploaded (20)

GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 

Sap penetration testing_defense_in_depth

  • 1. SAPSAPSAPSAP Penetration Testing & Defense In-Depth MarianoMariano NuNuññezez Di CroceDi Croce mnunez@cybsec.commnunez@cybsec.com OctoberOctober 22--3, 20083, 2008 EkopartyEkoparty, Buenos Aires, Buenos Aires -- ArgentinaArgentina ©© Copyright 2008 CYBSEC.Copyright 2008 CYBSEC. AllAll rightsrights reservedreserved.. sap security, sap pentest, sap pentesting, sap pt, sap security assessment, sap vulnerability assessment, sap insecurity, sap vulnerabilities, sap vulnerability, sap defense, hardening sap, sap hardening, protecting sap
  • 2. 2 © 2008 WhoWhoWhoWho isisisis CYBSEC ?CYBSEC ?CYBSEC ?CYBSEC ? Provides Information Security services since 1996. More than 300 customers, located in LatinAmerica, USA and Europe. Wide range of services: Strategic Management, Operation Management, Control Management, Incident Management, PCI Services, SAP Security. SAPSAPSAPSAP &&&& CYBSECCYBSECCYBSECCYBSEC Member of the SAP Global Security Alliance (GSA). Has been working with SAP (Walldorf) since 2005. Provides specific SAP security services (Penetration Testing, Secure Architecture Design, Secure Configuration, …)
  • 3. 3 © 2008 WhoWhoWhoWho amamamam I?I?I?I? Senior Security Researcher at CYBSEC. Devoted to Penetration Testing and Vulnerability Research. Discovered vulnerabilities in Microsoft, Oracle, SAP, Watchfire, … Speaker/Trainer at Blackhat, Sec-T, Hack.lu, DeepSec, Ekoparty, CIBSI, … SAPSAPSAPSAP &&&& MeMeMeMe Started researching in 2005. SAP Pentesting projects (customers). Discovered more than 40 vulnerabilities in SAP software. Published “Attacking the Giants: Exploiting SAP Internals”. Developed sapyto, the first SAP Penetration Testing Framework. CYBSEC’s “SAP (In)Security ” Training instructor.
  • 4. 4 © 2008 AgendaAgendaAgendaAgenda Agenda Introduction to the SAP World Why SAP Penetration Testing? PenTest Setup SAP PenTesting Discovery Phase Exploration Phase Vulnerability Assessment Phase Exploitation Phase Case Study: SAProuter Security Assessment Conclusions
  • 5. 5 © 2008 Introduction toIntroduction to the SAP Worldthe SAP World Basic concepts for deep knowledge
  • 6. 6 © 2008 SoSoSoSo………… whatwhatwhatwhat isisisis SAP?SAP?SAP?SAP? Introduction to the SAP World SAP (Systems, Applications and Products in Data Processing) is a german company devoted to the development of business solutions. More than 41.600 customers in more than 120 countries. More than 121.000 SAP implementations around the globe. Third biggest independent software vendor (ISV). Provides different solutions: CRM, ERP, PLM, SCM, SRM, GRC, Business One, … The ERP solution is composed of different functional modules (FI, CO, SD, HR, MM, etc) that implements organization business processes. Modules are linked together, integrated by the Netweaver platform. SAP runs on multiple Operating Systems and Databases.
  • 7. 7 © 2008 SAP Basic ConceptsSAP Basic ConceptsSAP Basic ConceptsSAP Basic Concepts Introduction to the SAP World Instance & System An instance is an administrative entity which groups related components of an SAP system, providing one or more services. Systems are identified by SAP System ID (SID). System (instance) parametrization is done in Profiles.
  • 8. 8 © 2008 SAP Basic ConceptsSAP Basic ConceptsSAP Basic ConceptsSAP Basic Concepts Introduction to the SAP World Client Legally and organizationally independent unit in an SAP system (company group, business unit, corporation). Identified by a three-digit number. Default clients: 000, 001 and 066. Transaction Related secuence of steps (dialog steps) aimed to perform an operation in the SAP database. Identified by a transaction code (ej: SU01, SE16, FK01, PA20,…)
  • 9. 9 © 2008 SAP Basic ConceptsSAP Basic ConceptsSAP Basic ConceptsSAP Basic Concepts Introduction to the SAP World ABAP ABAP is the SAP high-level programming language used to develop business applications. Reports / Programs ABAP programs that receive user input and produce a report in the form of an interactive list. Function Modules Independent ABAP modules. Can be called locally or remotely. The RFC (Remote Function Call) Interface Used to call function modules on remote systems.
  • 10. 10 © 2008 SAP Basic ConceptsSAP Basic ConceptsSAP Basic ConceptsSAP Basic Concepts Introduction to the SAP World The Authorization Concept (Simplified) Users are asigned roles/profiles. Each profile contains a set of Authorization objects. When a user tries to perform an activity, the required authorization objects are checked against user’s authorization objects (user buffer). Controlled Activities: Starting Transactions (S_TCODE) Accessing Tables (S_TABU_DIS) Starting Programs (S_PROGRAM) Calling RFC Function Modules (S_RFC) Authorization checks can also be done programatically, through the AUTHORITY_CHECK clause.
  • 11. 11 © 2008 SomeSomeSomeSome ““““LowLowLowLow----levellevellevellevel”””” KnowledgeKnowledgeKnowledgeKnowledge Introduction to the SAP World SAP_ALL profile = SAP God. Many other profiles may enable a user become a god too. Each SAP System uses its own Database. SAP processes run under the <sid>adm or SAPService<SID> user accounts. Connections to the Database are done with the same UID. No authorization at this level… Direct access to the Database means full SAP compromise! Connections between systems often based on Trust Relationships (r* services). Many customer’s interfaces are implemented through FTP (cleartext, usually weak passwords).
  • 12. 12 © 2008 Why SAPWhy SAP Penetration Testing?Penetration Testing? Or why You and your CFO should care
  • 13. 13 © 2008 Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test? Why SAP Penetration Testing? The new SAP system must be running on October 3rd, no excuses.
  • 14. 14 © 2008 Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test? Why SAP Penetration Testing? The new SAP system must be running on October 3rd, no excuses. But we haven’t secured the systems yet…you know, there is something called “Security”
  • 15. 15 © 2008 Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test? Why SAP Penetration Testing? The new SAP system must be running on October 3rd, no excuses. But we haven’t secured the systems yet…you know, there is something called “Security” Security? Hmm…is it French? I don’t care… Business *must* go on!
  • 16. 16 © 2008 Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test? Why SAP Penetration Testing? The new SAP system must be running on October 3rd, no excuses. But we haven’t secured the systems yet…you know, there is something called “Security” Security? Hmm…is it French? I don’t care… Business *must* go on! But we should take care of User authorizations to prevent frauds!
  • 17. 17 © 2008 Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test? Why SAP Penetration Testing? The new SAP system must be running on October 3rd, no excuses. But we haven’t secured the systems yet…you know, there is something called “Security” Security? Hmm…is it French? I don’t care… Business *must* go on! But we should take care of User authorizations to prevent frauds! Just give everyone full access (SAP_ALL) for three months, then we’ll lock it down
  • 18. 18 © 2008 Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test? Why SAP Penetration Testing? The new SAP system must be running on October 3rd, no excuses. But we haven’t secured the systems yet…you know, there is something called “Security” Security? Hmm…is it French? I don’t care… Business *must* go on! But we should take care of User authorizations to prevent frauds! Just give everyone full access (SAP_ALL) for three months, then we’ll lock it down OK…
  • 19. 19 © 2008 Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test?Why do you Need an SAP Penetration Test? Why SAP Penetration Testing? The new SAP system must be running on October 3rd, no excuses. But we haven’t secured the systems yet…you know, there is something called “Security” Security? Hmm…is it French? I don’t care… Business *must* go on! But we should take care of User authorizations to prevent frauds! Just give everyone full access (SAP_ALL) for three months, then we’ll lock it down OK… @#-*!#&$%!!
  • 20. 20 © 2008 Why do you Need an SAP Penetration Test? (cont.)Why do you Need an SAP Penetration Test? (cont.)Why do you Need an SAP Penetration Test? (cont.)Why do you Need an SAP Penetration Test? (cont.) Why SAP Penetration Testing? CFOCFOCFOCFO’’’’ssss MistakeMistakeMistakeMistake:::: SecuritySecuritySecuritySecurity guyguyguyguy’’’’ssss MistakeMistakeMistakeMistake:::: Alert Weak SAP Security configuration can definitely result in Business Frauds! Alert SAP Security is much (*much*) more than User roles and authorizations!
  • 21. 21 © 2008 Why do you Need an SAP Penetration Test? (Wrap up)Why do you Need an SAP Penetration Test? (Wrap up)Why do you Need an SAP Penetration Test? (Wrap up)Why do you Need an SAP Penetration Test? (Wrap up) Why SAP Penetration Testing? Security configurations of SAP systems are usually left by default. By default, many configurations are not secure. Conclusion: Many SAP implementations are not secure! Is yours secure? A Penetration Test to these systems will help you know how your SAP implementation can be attacked and which is the real impact of this. It will help you discover the weaknesses, secure them, and increase the security level of your systems (a.k.a decrease fraud risk). In this talk, we’ll see some of the activities that make up the different phases of an SAP Penetration Testing (no way of covering them all).
  • 23. 23 © 2008 PreparationPreparationPreparationPreparation PenTest Setup What do you need? The Shopping List sapyto nmap r* tools (rsh, rlogin, rexec) SQL client tools NFS client tools SMB client & security tools BurpSuite / w3af Nessus john (patched) hydra Try to get as much information as possible about target platforms, usage and policies before starting the assessment. Remember that everthing that breaks while you are pentesting *will* be your fault (even if someone breaks his leg).
  • 24. 24 © 2008 sapytosapytosapytosapyto First SAP Penetration Testing Framework. Support for activities in all phases of the pentest. Open-source (and free). Plugin based. Developed in Python and C. Version 0.93 released at Blackhat Europe 07. sapyto
  • 25. 25 © 2008 AvailableAvailableAvailableAvailable Plugins inPlugins inPlugins inPlugins in sapytosapytosapytosapyto v0.93v0.93v0.93v0.93 sapyto Audit: Attack: RFC Ping. Registration of External Servers. Detection of RFCEXEC. Detection of SAPXPG. Get system information. Get server documentation. RFC_START_PROGRAM Dir Traversal. Run commands through RFCEXEC. Run commands through SAPXPG. StickShell. Evil Twin Attack. Get remote RFCShell. Tools: RFC Password Obfuscator / De-obfuscator.
  • 26. 26 © 2008 HotHotHotHot NewsNewsNewsNews!!!! sapytosapytosapytosapyto v0.98v0.98v0.98v0.98 sapyto Core and architecture fully re-built. Based on connectors. The SAPRFC* connectors and the RFCSDK. Plugins are now categorized in Discovery, Audit and Exploit. Discovery plugins find new targets. Audit plugins carry out the vulnerability assessments. Exploit plugins are used as proof of concepts for discovered vulns. sapytoAgents deployment. New plugins for auditing SAProuters, find clients, bruteforcing, …
  • 27. 27 © 2008 Discovery PhaseDiscovery Phase Finding SAP targets
  • 28. 28 © 2008 Discovering SAP Systems and Applications (Targets)Discovering SAP Systems and Applications (Targets)Discovering SAP Systems and Applications (Targets)Discovering SAP Systems and Applications (Targets) Discovery Phase Available Options: Traffic sniffing. SAP portscanning. Checking SAPGUI configurations. SAP Systems use a “fixed” range of ports. Most ports follows the PREFIX + SYS. NUMBER format. Common ports: 32XX, 33XX, 36XX, 39XX, 3299, 81XX, … Nmap: Watch Timings (-T3) and don’t use version detection. New sapyto will provide automatic discovery of SAP systems and configuration of targets/connectors for auditing!
  • 29. 29 © 2008 ExplorationExploration PhasePhase Getting as much information as possible
  • 30. 30 © 2008 Getting Information from SAP Application ServersGetting Information from SAP Application ServersGetting Information from SAP Application ServersGetting Information from SAP Application Servers Exploration Phase The RFC_SYSTEM_INFO function module returns information about remote SAP Application Servers (implemented in sapyto’s sapinfo plugin) Can be called remotely (and anonymously) by default. [5] sapinfo(target#0) { Remote System Information: RFC Log Version: 011 Release Status of SAP System: 700 Kernel Release: 700 Operating System: Linux Database Host: sapl01 Central Database System: ORACLE Integer Format: Little Endian Dayligth Saving Time: Float Type Format: IEEE Hostame: sapl01 IP Address: 192.168.3.4 System ID: TL1 RFC Destination: sapl01_TL1_00 Timezone: -18000 (diff from UTC in seconds) Character Set: 4103 Machine ID: 390
  • 31. 31 © 2008 Getting Information from SAP Application ServersGetting Information from SAP Application ServersGetting Information from SAP Application ServersGetting Information from SAP Application Servers Exploration Phase The RFC_SYSTEM_INFO function module returns information about remote SAP Application Servers (implemented in sapyto’s sapinfo plugin) Can be called remotely (and anonymously) by default. [5] sapinfo(target#0) { Remote System Information: RFC Log Version: 011 Release Status of SAP System: 700 Kernel Release: 700 Operating System: Linux Database Host: sapl01 Central Database System: ORACLE Integer Format: Little Endian Dayligth Saving Time: Float Type Format: IEEE Hostame: sapl01 IP Address: 192.168.3.4 System ID: TL1 RFC Destination: sapl01_TL1_00 Timezone: -18000 (diff from UTC in seconds) Character Set: 4103 Machine ID: 390 Protection / Countermeasure Restrict connections to the SAP Gateway at the network level. For more information, refer to SAP Note 931252.
  • 32. 32 © 2008 Finding Available ClientsFinding Available ClientsFinding Available ClientsFinding Available Clients Exploration Phase Users are client-dependent. Default clients: 000, 001, 066. getClients(target#0) { Client 000 is available. Client 001 is available. Client 066 is available. Client 101 is available. Client 200 is available. } res: Ok
  • 33. 33 © 2008 Analyzing Shared ResourcesAnalyzing Shared ResourcesAnalyzing Shared ResourcesAnalyzing Shared Resources Exploration Phase The Common Transport Directory (CTD) is the directory where changes (transports) are exported to and imported from in an SAP landscape. This directory must be shared for all systems in the landscape. It is often the case, where the kernel files and profiles are shared to dialog instances. $ showmount –e sapserver /export/usr/sap/trans (everyone) /export/sapmnt/NP1 (everyone) /export/informix/NP1 (everyone) /export/interfacesNP1 (everyone) /export/interfsrcNP1 (everyone)
  • 34. 34 © 2008 Analyzing Shared ResourcesAnalyzing Shared ResourcesAnalyzing Shared ResourcesAnalyzing Shared Resources Exploration Phase The Common Transport Directory (CTD) is the directory where changes (transports) are exported to and imported from in an SAP landscape. This directory must be shared for all systems in the landscape. It is often the case, where the kernel files and profiles are shared to dialog instances. $ showmount –e sapserver /export/usr/sap/trans (everyone) /export/sapmnt/NP1 (everyone) /export/informix/NP1 (everyone) /export/interfacesNP1 (everyone) /export/interfsrcNP1 (everyone) Protection / Countermeasure Shared resource access should be restricted to SAP related systems and users only.
  • 36. 36 © 2008 SAP Default UsersSAP Default UsersSAP Default UsersSAP Default Users Vulnerability Assessment Phase There is public information regarding the existence of default SAP user accounts. Many of these accounts are configured with high privileged profiles. ADMIN000, 001Communication UserSAPCPIC SUPPORT066User for the EarlyWatch Service EARLYWATCH 19920706000,001ABAP Dictionary super user DDIC 06071992 PASS 000,001, 066 new clients Super userSAP* PasswordClientsDescriptionUser ID
  • 37. 37 © 2008 SAP Default UsersSAP Default UsersSAP Default UsersSAP Default Users Vulnerability Assessment Phase There is public information regarding the existence of default SAP user accounts. Many of these accounts are configured with high privileged profiles. ADMIN000, 001Communication UserSAPCPIC SUPPORT066User for the EarlyWatch Service EARLYWATCH 19920706000,001ABAP Dictionary super user DDIC 06071992 PASS 000,001, 066 new clients Super userSAP* PasswordClientsDescriptionUser ID Protection / Countermeasure Default users must be secured. SAP* should be deactivated. Use report RSUSR003 to check the status of default users.
  • 38. 38 © 2008 SAP User AccountSAP User AccountSAP User AccountSAP User Account BruteforcingBruteforcingBruteforcingBruteforcing Vulnerability Assessment Phase Usernames are up to 12 characters long. As part of the PenTest, you can try guessing/cracking user credentials. SensitiveInsensitiveCase 408Max. Length New Passwords (> 6.40)Old Passwords (≤ 6.40) WARNING! User locking is implemented! (usually, between 3-12 tries) Ops! In versions ≤ 6.20, lock counter is not incremented through RFC. sapyto’s bruteLogin plugin can work in different modes: Try default users only and SAP*:PASS in detected clients. Specific credentials wordlist. Username and Password wordlists.
  • 39. 39 © 2008 Getting Credentials from the WireGetting Credentials from the WireGetting Credentials from the WireGetting Credentials from the Wire –––– RFC SniffingRFC SniffingRFC SniffingRFC Sniffing Vulnerability Assessment Phase RFC (Remote Function Call) is the most widely used interface in the SAP world. In order for a system to connect through RFC, it must provide login information for the remote system. RFC is clear-text, but you won’t be able to see the password in the wire… Password is obfuscated! -> Use sapyto’s getPassword plugin ... 01a0 00 00 00 00 00 00 06 05 14 00 10 5f 22 ea 45 5e ..........._".E^ 01b0 22 c5 10 e1 00 00 00 c0 a8 02 8b 05 14 01 30 00 ".............0. 01c0 0a 72 66 63 5f 73 65 72 76 65 72 01 30 01 11 00 .rfc_server.0... 01d0 06 42 43 55 53 45 52 01 11 01 17 00 0b 81 bb 89 .BCUSER......... 01e0 62 fc b5 3e 70 07 6e 79 01 17 01 14 00 03 30 30 b..?w.oy......00 01f0 30 01 14 01 15 00 01 45 01 15 05 01 00 01 01 05 0......E........ 0200 01 05 02 00 00 05 02 00 0b 00 03 36 34 30 00 0b ...........640.. 0210 01 02 00 0e 5a 43 55 53 54 5f 47 45 54 4d 4f 4e ....ZCUST_GETMON 0220 45 59 01 02 05 14 00 10 5f 22 ea 45 5e 22 c5 10 EY......_".E^".. 0230 e1 00 00 00 c0 a8 02 8b 05 14 02 01 00 09 43 4c ..............CL 0240 49 45 4e 54 5f 49 44 02 01 02 03 00 08 43 55 53 IENT_ID......CUS 0250 54 30 30 31 00 02 03 ff ff 00 00 ff ff 00 00 01 T001............ 0260 c7 00 00 3e 80 ...>. for CHAR in CLEAR_TEXT_PASS: OBFUSCATED_PASS[i] = CHAR XOR KEY[i]
  • 40. 40 © 2008 Getting Credentials from the WireGetting Credentials from the WireGetting Credentials from the WireGetting Credentials from the Wire –––– RFC SniffingRFC SniffingRFC SniffingRFC Sniffing Vulnerability Assessment Phase RFC (Remote Function Call) is the most widely used interface in the SAP world. In order for a system to connect through RFC, it must provide login information for the remote system. RFC is clear-text, but you won’t be able to see the password in the wire… Password is obfuscated! -> Use sapyto’s getPassword plugin ... 01a0 00 00 00 00 00 00 06 05 14 00 10 5f 22 ea 45 5e ..........._".E^ 01b0 22 c5 10 e1 00 00 00 c0 a8 02 8b 05 14 01 30 00 ".............0. 01c0 0a 72 66 63 5f 73 65 72 76 65 72 01 30 01 11 00 .rfc_server.0... 01d0 06 42 43 55 53 45 52 01 11 01 17 00 0b 81 bb 89 .BCUSER......... 01e0 62 fc b5 3e 70 07 6e 79 01 17 01 14 00 03 30 30 b..?w.oy......00 01f0 30 01 14 01 15 00 01 45 01 15 05 01 00 01 01 05 0......E........ 0200 01 05 02 00 00 05 02 00 0b 00 03 36 34 30 00 0b ...........640.. 0210 01 02 00 0e 5a 43 55 53 54 5f 47 45 54 4d 4f 4e ....ZCUST_GETMON 0220 45 59 01 02 05 14 00 10 5f 22 ea 45 5e 22 c5 10 EY......_".E^".. 0230 e1 00 00 00 c0 a8 02 8b 05 14 02 01 00 09 43 4c ..............CL 0240 49 45 4e 54 5f 49 44 02 01 02 03 00 08 43 55 53 IENT_ID......CUS 0250 54 30 30 31 00 02 03 ff ff 00 00 ff ff 00 00 01 T001............ 0260 c7 00 00 3e 80 ...>. for CHAR in CLEAR_TEXT_PASS: OBFUSCATED_PASS[i] = CHAR XOR KEY[i] Protection / Countermeasure Enable SNC, protecting the confidentiality and integrity of the traffic.
  • 41. 41 © 2008 Analysis of the RFC InterfaceAnalysis of the RFC InterfaceAnalysis of the RFC InterfaceAnalysis of the RFC Interface Vulnerability Assessment Phase RFC Communication is done through the Gateway Service. The GW can connect with external RFC servers: Registered Servers: The external system registers to the GW under a Program ID. Started Servers: The GW connects to a remote system and starts a program (trust?) By exploiting Registered Servers caveats, it may be possible to obtain confidential information, DoS, perform RFC MITM and callback attacks. By exploiting Started Servers vulnerabilities, it may be possible to obtain remote code execution on misconfigured Application Servers. (check the “Attacking the Giants: Exploiting SAP Internals” white-paper)
  • 43. 43 © 2008 ButButButBut………… why do we need Exploitation anyway?why do we need Exploitation anyway?why do we need Exploitation anyway?why do we need Exploitation anyway? Exploitation Phase Vulnerability Assessments reports enumerate discovered vulnerabilities with the associated risk estimate. A security aware individual would easily see the problems. But, what about the people from the Financial areas? For them to get involved, they need to see the facts! You must show them how “their” information can be compromised -> screenshots, live- demos… Vulnerability Assessments are 2D, Exploitation adds a new Dimension.
  • 44. 44 © 2008 SAP Password Considerations & CrackingSAP Password Considerations & CrackingSAP Password Considerations & CrackingSAP Password Considerations & Cracking Exploitation Phase SAP has implemented different password hashing mechanisms. Passwords hashes are stored in table USR02 (BCODE, PASSCODE) and USH02. Code Version F + Code Version B (2 hashes)G Based on SHA1, 40 characters, Case Insensitive, UTF-8 F ReservedE Based on MD5, 8 characters, Uppercase, UTF-8D Not implementedC Based on MD5, 8 characters, Uppercase, ASCIIB ObsoleteA DescriptionCode Vers. On June 26 2008, a patch for John The Ripper for CODVN B and F was published.
  • 45. 45 © 2008 SAP Password Considerations & CrackingSAP Password Considerations & CrackingSAP Password Considerations & CrackingSAP Password Considerations & Cracking Exploitation Phase SAP has implemented different password hashing mechanisms. Passwords hashes are stored in table USR02 (BCODE, PASSCODE) and USH02. Code Version F + Code Version B (2 hashes)G Based on SHA1, 40 characters, Case Insensitive, UTF-8 F ReservedE Based on MD5, 8 characters, Uppercase, UTF-8D Not implementedC Based on MD5, 8 characters, Uppercase, ASCIIB ObsoleteA DescriptionCode Vers. On June 26, a patch for John The Ripper for CODVN B and F was published. Protection / Countermeasure Access to tables USR02 and USH02 should be protected. Password security should be enforced through profile configuration (login/* parameters). Table USR40 can be used to protect from trivial passwords. For more information, refer to SAP Note 1237762.
  • 46. 46 © 2008 Exploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication Mechanism Exploitation Phase Discovered by me in 2007. Discovered by Jochen Hein in 2003 (D’oh!) Target: Default SAP/Oracle installations. The SAP+Oracle Authentication Mechanism SAP connects to the database as the OPS$<username> (eg: OPS$<SID>adm). Retrieves user and password from table SAPUSER. Re-connects to the database, using the retrieved credentials.
  • 47. 47 © 2008 Exploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication Mechanism Exploitation Phase There is a special Oracle configuration parameter named REMOTE_OS_AUTHENT. If set to TRUE, Oracle “trusts” that the remote system has authenticated the user used for the SQL connection (!) The user is created as “indentified externally” in the Oracle database. Oracle recommendation: remote_os_authent = false SAP default and necessary configuration: remote_os_authent = true What do you need? Database host/port. SAP System ID. Oracle Instance ID ( = SAPSID?)
  • 48. 48 © 2008 Exploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication MechanismExploiting SAP/Oracle Authentication Mechanism Exploitation Phase There is a special Oracle configuration parameter named REMOTE_OS_AUTHENT. If set to TRUE, Oracle “trusts” that the remote system has authenticated the user used for the SQL connection (!) The user is created as “indentified externally” in the Oracle database. Oracle recommendation: remote_os_authent = false SAP default and necessary configuration: remote_os_authent = true What do you need? Database host/port. SAP System ID. Oracle Instance ID ( = SAPSID?) Protection / Countermeasure Restrict who can connect to the Oracle listener: tcp.validnode_checking = yes tcp.invited_nodes = (192.168.1.102, …)
  • 49. 49 © 2008 Exploiting Weak RFC Interface SecurityExploiting Weak RFC Interface SecurityExploiting Weak RFC Interface SecurityExploiting Weak RFC Interface Security Exploitation Phase Possible in default configuration of SAP Systems. Allows for unauthenticated remote code execution. … … Starting EXPLOIT plugins ---------------------------- weakRFC(target#1) { Creating new SHELL object... SHELL object created. ID: 536 } res: Ok sapyto> shells sapyto/shells> list Shell ID: 536 [RFCShell] Target information: Connector: SAPRFC_EXT SAP Gateway Host: sapprd01 SAP Gateway Service: 3300 ... ... sapyto/shells> start 536 Starting shell #536 RFCShell - Run commands through RFC. The remote target OS is: Win.NET. sapyto/shells/536> run whoami Call successfull. Command output: prdadm sapyto/shells/536>
  • 50. 50 © 2008 Exploiting Weak RFC Interface SecurityExploiting Weak RFC Interface SecurityExploiting Weak RFC Interface SecurityExploiting Weak RFC Interface Security Exploitation Phase Possible in default configuration of SAP Systems. Allows for unauthenticated remote code execution. … … Starting EXPLOIT plugins ---------------------------- weakRFC(target#1) { Creating new SHELL object... SHELL object created. ID: 536 } res: Ok sapyto> shells sapyto/shells> list Shell ID: 536 [RFCShell] Target information: Connector: SAPRFC_EXT SAP Gateway Host: sapprd01 SAP Gateway Service: 3300 ... ... sapyto/shells> start 536 Starting shell #536 RFCShell - Run commands through RFC. The remote target OS is: Win.NET. sapyto/shells/536> run whoami Call successfull. Command output: prdadm sapyto/shells/536> Protection / Countermeasure Starting of External RFC Servers is controlled through the file specified by the gw/sec_info profile parameter. This file should exist and restrict access to allowed systems to start specific programs in the Application Servers. The gw/reg_info file protects Registered Servers and should be configured as well. For more information, refer to SAP Note 618516.
  • 51. 51 © 2008 Case Study:Case Study: SAProuterSAProuter SecuritySecurity AssessmentAssessment
  • 52. 52 © 2008 Internet Internal Network Border FW SAProuter DEV Other Internal Systems IntraWeb External User QAS PRD SSH Server Internal Users Mainframe SAProuterSAProuterSAProuterSAProuter IntroductionIntroductionIntroductionIntroduction Case Study: SAProuter Security Assessment SAProuter is an SAP program working as a proxy, which analyzes connections between SAP systems and between SAP systems and external networks. Typical SAProuter Architecture
  • 53. 53 © 2008 SAProuterSAProuterSAProuterSAProuter IntroductionIntroductionIntroductionIntroduction Case Study: SAProuter Security Assessment If SAProuter is in place, clients have to specify a route string to connect. /H/saprouter/S/3299/H/sapprd1/S/3200 Access in controlled through an ACL file called Route Permission Table. Entry format: First-match criteria. In no match, deny connection. P/S/D src_host dst_host dst_port pwd
  • 54. 54 © 2008 TheTheTheThe RouteRouteRouteRoute PermissionPermissionPermissionPermission TableTableTableTable Case Study: SAProuter Security Assessment Route Permission Table Example: D host1 host2 serviceX P 192.168.1.* host2 * pass123 S 10.1.*.* 10.1.2.* * D * * * * Route Permission Table in the realrealrealreal life: D host1 host2 serviceX P 192.168.1.* host2 * pass123 S 10.1.*.* 10.1.2.* * P * * * *
  • 55. 55 © 2008 SAProuterSAProuterSAProuterSAProuter SecuritySecuritySecuritySecurity AssessmentAssessmentAssessmentAssessment withwithwithwith sapytosapytosapytosapyto Case Study: SAProuter Security Assessment The saprouterSpy plugin Performs Internal Network port-scan. Discovers new targets through SAProuter and configure them for auditing by other plugins.
  • 56. 56 © 2008 SAProuterSAProuterSAProuterSAProuter SecuritySecuritySecuritySecurity AssessmentAssessmentAssessmentAssessment:::: sapytoAgentssapytoAgentssapytoAgentssapytoAgents Case Study: SAProuter Security Assessment Native Routing SAPRouter also supports the “routing” of native protocols. Useful for remote administration of Operating Systems, DB, etc. Certain limitations apply. saprouterAgent plugin deploys a sapytoAgent, which can be used to proxy native connections (HTTP, SSH, Telnet, etc) to internal systems.
  • 57. 57 © 2008 Internet Internal Network Border FW SAProuter DEV Other Internal Systems IntraWeb External User QAS PRD SSH Server Internal Users Mainframe SAProuterSAProuterSAProuterSAProuter IntroductionIntroductionIntroductionIntroduction Case Study: SAProuter Security Assessment SAProuter is an SAP program working as a proxy, which analyzes connections between SAP systems and between SAP systems and external networks. Typical SAProuter Architecture Protection / Countermeasure SAProuter should be implemented in a separate DMZ. Use VPNs and/or restrict connections at the border Firewall. The Route Permission Table should restrict access only to allowed parties, to specific targets and ports. SNC should be required. Entries containing wildcards (*) are discouraged and should be carefully analyzed.
  • 59. 59 © 2008 ConclusionsConclusionsConclusionsConclusions Conclusions It’s impossible to cover all the activities of an SAP Pentest in a one hour talk! SAP systems deal with sensitive business information and processes. The integrity, confidentiality and availability of this information is critical. SAP systems security is often overlooked during the implementation phase, in order to avoid “business delays”. SAP security is much more than User Roles/Profiles and Authorizations! By default, some configurations would expose the systems to high risk threats. SAP provides many ways to secure systems and communications. Administrators should enable security settings as soon as possible. Pentesting your SAP systems will let you know the current security level of your implementation (and show your managers why you need resources to secure it :P ) CYBSEC’s sapyto supports activities of all phases of the project. SAP Penetration Tests should be carried out in controlled environments, performed by qualified experts in the subject.
  • 60. 60 © 2008 ReferencesReferencesReferencesReferences References “Attacking the Giants: Exploiting SAP Internals” White-paper http://www.cybsec.com/upload/bh-eu-07-nunez-di-croce-WP_paper.pdf John The Ripper Patch for SAP hashes http://marc.info/?l=john-users&m=121444075820309&w=2 sapyto http://www.cybsec.com/EN/research/sapyto.php CYBSEC’s SAP Security Services http://www.cybsec.com/EN/services/SAP_security.php SAP Note 931252 - Security Note: Authority Check for Function Group SRFC. SAP Note 618516 - Security-related enhancement of RFCEXEC program. SAP Note 1237762 - ABAP systems: Protection against password hash attacks