Who Am iPrasanna KanagasabaiWork @ MNC in Bangalore IndiaPen tester in the DAY, Programmer by NIGHT@prasannain
ScenarioMy BOSS wants me to test our internal SAP servers and report findings…PROBLEMI have never seen a SAP systemI have no knowledge of SAP vulnerabilitiesWere is the documents availablePeople who deploy and maintain SAP have poor knowledge ofsecurity
SolutionDownload documents on SAP from various sites.Understand the architectureUnderstand SAP security vulnerabilitiesTest each vulnerabilities manuallyTry some of the Open Source SAP testing tools:1. Bizsploit (http://www.onapsis.com/research-free-solutions.php)2. Metasploit Modules (http://labs.mwrinfosecurity.com/blog/2012/04/27/mwr-sap-metasploit- modules/)3. ERPScans SAP Pentesting Tool (http://erpscan.com/products/erpscan-pentesting-tool/)Buy and run a commercial SAP security scanner
Fortunately it changes tomorrow Introducing "IronSAP" Open Source SAP Security Scanner
Identification via bannerServer Header could provide information what the underlying infrastructure is hosted on “Server: SAP J2EE Engine/7.00”Sap systems are no differentIronWASP has a passive plug-in that automatically picks these and raises it as a finding
Error MessagesSAP Error messages could revel a big deal of critical information. “Errorcode: ICF-NF-http-XXXX_EAZ_00-…………”XXXX -- > HostnameEAZ -- > SAPSID00 -- > System NumberIronSAP can detect this information, it will raise a finding with the pages and critical information found
ICFThere are 1500 ICF services that are shippedThey behave like any normal server side pages do.They receive web input, process, and output the resultsServices are divided into Public Services Private Services
ICFPublic services are responded without any authenticationPrivate services can request authentication as configured…Most services require authentication
ICF & IronSAPIronSAP can find all the services that respond to a request. (200 OK)If the response was 200 it continues to check If it is a login page or has some interesting contentIf login is Basic authentication it launches a brute force attack.Automatically checks all HTTP(s) ports and finds interesting pages.
ICF - Info ServiceA dangerous Public ICF serviceFound @ /sap/public/infoReturns SAP internal information as a XMLironSAP: Icf Finger printer scans and finds the info service and raises a finding in the system.
ICF 2 – SOAP RFCRFC is a protocol to call ABAP programsNot available on the internetICF service allows access to the underlying RFCIf enabled the malicious user can run RFC programs as present in the local networkIronSAP: fingerprint finds presence of this ICF service and raises the finding.
Admin PagesSAP has web administration page that has in store real time information on SAP infrastructure.Can be found without authenticationIronSAP: fingerprint finds presence of this ICF service and raises the finding
Verb TamperingWeb.xml defines if a request should challenge a with a authentication for a given HTTP methodA faulty implementation can allow a user to bypass the authentication.IronSAP: attempts to access the resource using “HEAD” for all requests that challenged with a request, records positive outcome.
REMOTE_USERSAP EP can use web access manger for authenticationThe user contacts the WAM with his credentialsThe WAM verifies his identityThe WAM forwards the user to the SAP EP with a HTTP header with the username of the successful logged in userEP checks its database if the user existsEP sets the SSO logged in cookie
REMOTE_USERThe problem is if a request is sent to the SAP EP with the correct header a user could be logged in without having credentials.IronSAP: on finding a portal login it would try to login to the system with different users in REMOTE_USER header.
SAP Start ServiceSAP management Console found on the SAP system on port 5<instance id>13/14Installed by DefaultRemote management of usersInformation DisclosureNo or basic AuthenticationIronSAP: Queries this web service and retrieves the information from the SAP system and raises the finding
Next For IronSAPDatabase SecurityRFCSAP Client attacksSAP TransactionsPasswordsABAP
Thank YouIronSAP automates the process discovery of theSAP attacks found by the following researchers:Mariano Nuñez DiCroceChris John RileyAlexander PolyakovDave HartleyI would also like to thank:Lavakumar (Author of IronWASP)Pavan Kumar (I bugged him nearly every night for information on SAP)Garrage4Hackers (I got a lot of resources from here)