Top 10 most interes.ng SAP vulnerabili.es and a9acks



Similar documents
Top 10 most interesting SAP vulnerabilities and attacks Alexander Polyakov

Invest in security to secure investments. Breaking SAP Portal. Dmitry Chastuhin Principal Researcher at ERPScan

THE STATE OF SAP SECURITY 2013: VULNERABILITIES, THREATS AND TRENDS

Alexander Polyakov CTO ERPScan

A GLOBAL SURVEY Authors:

EAS-SEC Project: Securing Enterprise Business Applications

A crushing blow at the heart of SAP J2EE Engine. For BlackHat USA Version 1.0

If I want a perfect cyberweapon, I'll target ERP

sec.org

How to hack VMware vcenter server in 60 seconds

Inception of the SAP Platform's Brain Attacks on SAP Solution Manager

PRACTICAL PENTESTING OF ERP SYSTEMS AND BUSINESS

Forgotten World: Corporate Business Application Systems

Invest in security to secure investments Oracle PeopleSoft applications are under attacks!

VoIP Security How to prevent eavesdropping on VoIP conversa8ons. Dmitry Dessiatnikov

The SAProuter An Internet Window to your SAP Platform (and beyond)

Attacks to SAP. Web Applications Your crown jewels online. Mariano Nuñez Di Croce. Troopers, Germany. March 30th,

ATTACKS TO SAP WEB APPLICATIONS

Application Security Testing. Erez Metula (CISSP), Founder Application Security Expert

Web Application Report

Practical pentesting of ERP s and business applications

Evolution of Penetration Testing

Bank Hacking Live! Ofer Maor CTO, Hacktics Ltd. ATC-4, 12 Jun 2006, 4:30PM

Members of the UK cyber security forum. Soteria Health Check. A Cyber Security Health Check for SAP systems

CRYPTUS DIPLOMA IN IT SECURITY

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

Vulnerability Assessment and Penetration Testing

HI THIS IS URGENT PLZ FIX ASAP: Cri5cal Vulnerabili5es and Bug Bounty Programs

Auditing the Security of an SAP HANA Implementation

Network Security. Computer Security & Forensics. Security in Compu5ng, Chapter 7. l Network Defences. l Firewalls. l Demilitarised Zones

Thick Client Application Security

Andreas Wiegenstein Dr. Markus Schumacher

COURSE NAME: INFORMATION SECURITY INTERNSHIP PROGRAM

ERP Security. Myths, Problems, Solutions

Andreas Mertz (Founder/Man. Dir. it-cube SYSTEMS, CISSP) 360 SAP Security

Research Paper SAP Penetration Testing Using Metasploit

Attack Vector Detail Report Atlassian

Penetration: from Application down to OS

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

Some notes on SAP Security

MatriXay Database Vulnerability Scanner V3.0

SAP Netweaver Application Server and Netweaver Portal Security

OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair

Kaseya Fundamentals Workshop DAY THREE. Developed by Kaseya University. Powered by IT Scholars

Client logo placeholder XXX REPORT. Page 1 of 37

BSides London SAP Slapping. A Penetra3on Testers Guide

SAP. Penetration Testing. with Onapsis Bizploit. Mariano Nuñez. Di Croce. HITB Security Conference, Dubai. April 22,

Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability

Executive Summary On IronWASP

How to hack VMware vcenter server in 60 seconds

Web Application Security Considerations

What is Web Security? Motivation

SAP Secure Operations Map. SAP Active Global Support Security Services May 2015

Integrigy Corporate Overview

Penetration Testing with Kali Linux

EC-Council CAST CENTER FOR ADVANCED SECURITY TRAINING. CAST 619 Advanced SQLi Attacks and Countermeasures. Make The Difference CAST.

SCP - Strategic Infrastructure Security

Security testing the Internet-of-things

Automating Security Testing. Mark Fallon Senior Release Manager Oracle

Automated Penetration Testing with the Metasploit Framework. NEO Information Security Forum March 19, 2008

Network Security and Firewall 1

Mobile Applica,on and BYOD (Bring Your Own Device) Security Implica,ons to Your Business. Dmitry Dessiatnikov

An Introduction to Network Vulnerability Testing

Virtualization System Security

Assessing BYOD with the Smarthpone Pentest Framework. Georgia Weidman

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

ABC LTD EXTERNAL WEBSITE AND INFRASTRUCTURE IT HEALTH CHECK (ITHC) / PENETRATION TEST

Attack and Penetration Testing 101

Web App Security Audit Services

Hardening of SAP HTTP- and Webservices

Hardening of SAP HTTP- and Webservices

Why Web Applications are making a hackers life easy. Presented by Jon Grew BT SBS

NETWORK PENETRATION TESTING

Adding Value to Automated Web Scans. Burp Suite and Beyond

Security Guide SAP GUI for Windows

CSE331: Introduction to Networks and Security. Lecture 32 Fall 2004

How to scan/exploit a ssl based webserver. by xxradar. mailto:xxradar@radarhack.com. Version 1.

Please Complete Speaker Feedback Surveys. SecurityTube.net

Security Goals Services

Defending Against Web App A0acks Using ModSecurity. Jason Wood Principal Security Consultant Secure Ideas

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

NETWORK DEVICE SECURITY AUDITING

Sample Report. Security Test Plan. Prepared by Security Innovation

Barracuda Web Site Firewall Ensures PCI DSS Compliance

Locking down a Hitachi ID Suite server

Security and Your SAP System When Working with Winshuttle Products

Learn Ethical Hacking, Become a Pentester

SysPatrol - Server Security Monitor

Web Application Security

Exploi'ng NoSQL Like Never Before HITB AMS 2014

PERDIX: A FRAMEWORK FOR REALTIME BEHAVIORAL EVALUATION OF SECURITY THREATS IN CLOUD COMPUTING ENVIRONMENT

Transcription:

Invest in security to secure investments Top 10 most interes.ng SAP vulnerabili.es and a9acks Alexander Polyakov CTO at ERPScan

About ERPScan The only 360- degree SAP Security solu8on - ERPScan Security Monitoring Suite for SAP Leader by the number of acknowledgements from SAP ( 150+ ) 60+ presenta.ons key security conferences worldwide 25 Awards and nomina.ons Research team - 20 experts with experience in different areas of security Headquarters in Palo Alto (US) and Amsterdam (EU) 2

What is SAP? Shut up And Pay 3

Really The most popular business applica8on More than 120000 customers 74% of Forbes 500 4

Agenda Intro SAP security history SAP on the Internet Top 10 latest interes8ng apacks DEMOs Conclusion 5

3 areas of SAP Security 2002 Business logic security (SOD) Prevents a3acks or mistakes made Solu8on: GRC 2008 ABAP Code security Prevents a3acks or mistakes made by developers Solu8on: Code audit 2010 Applica3on pla4orm security Prevents unauthorized access both insiders and remote a3ackers Solu8on: Vulnerability Assessment and Monitoring 6

Talks about SAP security 35 30 25 20 15 10 Most popular: BlackHat HITB Troopers RSA Source DeepSec etc. 5 0 2006 2007 2008 2009 2010 2011 2012 7

SAP Security notes 900 800 700 600 500 400 300 200 100 0 By April 26, 2012, a total of 2026 notes 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 8

SAP vulnerabili.es by type 1 - Directory Traversal 2 - XSS/Unauthorised modifica8on of stored 3 - Missing Auth check 4 - Informa8on Disclosure 5 - Unauthorized usage of applica8on 6 - Hard- coded creden8als 7 - Code injec8on vulnerability 8 - Verb tampering 9 - Remote Code Execu8on 10 - Denial of service 11 - BOF 12 - SQL Inj Stats from : 1Q 2012 1Q 2010 4Q 2009 0 50 100 150 200 250 300 350 9

SAP on the Internet We have collected data about SAP systems in the WEB Have various stats by countries, applica8ons, versions Informa8on from Google, Shodan, Nmap scan MYTH: SAP systems a9acks available only for insiders 10

SAP on the Internet About 5000 systems including Dispatcher, Message server, SapHostcontrol, Web- services 11

SAP on the Internet 12

Top 10 vulnerabili.es 2011-2012 1. Authen8ca8on Bypass via Verb tampering 2. Authen8ca8on Bypass via the Invoker servlet 3. Buffer overflow in ABAP Kernel 4. Code execu8on via TH_GREP 5. MMC read SESSIONID 6. Remote portscan 7. Encryp8on in SAPGUI 8. BAPI XSS/SMBRELAY 9. XML Blowup DOS 10. GUI Scrip8ng DOS 13

10 GUI- Scrip.ng DOS: Descrip.on SAP users can run scripts which automate their user func8ons A script has the same rights in SAP as the user who launched it Security message which is shown to user can be turned off in the registry Almost any user can use SAP Messages (SM02 transac8on) New It is possible to run DOS apack on any user using a simple script Author: Dmitry Chastukhin (ERPScan) 14

10 GUI- scrip.ng: Other a9acks Script can be uploaded using: SAPGUI Ac8veX vulnerability Teensy USB flash Any other method of client exploita8on Other a9acks like changing banking accounts in LFBK also possible 15

10 GUI- scrip.ng: Business risks Sabotage High Espionage No Fraud No Ease of exploita.on Medium 16

10 GUI- scrip.ng: Preven.on SAP GUI Scrip8ng Security Guide sapgui/user_scrip8ng = FALSE Block registry modifica8on on worksta8ons 17

9 XML Blowup DOS: Descrip.on WEBRFC interface can be used to run RFC func8ons By default any user can have access Even without S_RFC auth SAP NetWeaver is vulnerable to malformed XML packets It is possible to run DOS apack on server using simple script It is possible to run over the Internet! New Author: Alexey Tyurin (ERPScan) 18

9 XML Blowup DOS: Demo 19

9 XML Blowup DOS: Business risks Sabotage Cri.cal Espionage No Fraud No Ease of exploita.on Medium 20

9 XML Blowup DOS: Preven.on Disable WEBRFC Prevent unauthorized access to WEBRFC using S_ICF Install SAP notes 1543318 and 1469549 21

8 BAPI script injec.on/hash stealing : Descrip.on SAP BAPI transac8on fails to properly sani8ze input Possible to inject JavaScript code or link to a fake SMB server SAP GUI clients use Windows so their creden8als will be transferred to apackers host. Author: Dmitry Chastukhin (ERPScan) 22

8 BAPI script injec.on/hash stealing: Demo New 23

8 BAPI script injec.on/hash stealing: Business risks Espionage High Sabotage High Fraud High Ease of exploita.on Low 24

7 SAP GUI bad encryp.on: Descrip.on SAP FrontEnd can save encrypted passwords in shortcuts Shortcuts stored in.sap file This password uses byte- XOR algorithm with secret key Key has the same value for every installa8on of SAP GUI Any password can be decrypted in 1 second New Author: Alexey Sintsov (ERPScan) 25

7 SAP GUI bad encryp.on: Business risks Espionage High Sabotage Medium Fraud High Ease of exploita.on Medium 26

7 SAP GUI bad encryp.on: Preven.on Disable password storage in GUI 27

6 Remote port scan via JSP: Descrip.on It is possible to scan internal network from the Internet Authen.ca.on is not required SAP NetWeaver J2EE engine is vulnerable /ipcpricing/ui/bufferoverview.jsp? server=172.16.0.13 & port=31337 & password= & dispatcher= & targetclient= & view= Author: Alexander Polyakov (ERPScan) 28

6 Remote port scan via JSP: Demo HTTP port Port closed SAP port 29

6 Remote port scan via JSP: Business risks Sabotage Low Espionage Medium Fraud No Ease of exploita.on High 30

6 Remote port scan via JSP: Preven.on Install SAP notes: 1548548, 1545883, 1503856, 948851, 1545883 Disable unnecessary applica8ons 31

5 MMC JSESSIONID stealing: Descrip.on Remote management of SAP Platorm By default, many commands go without auth Exploits implemented in Metasploit (by ChrisJohnRiley) Most of the bugs are informa8on disclosure It is possible to find informa8on about JSESSIONID Only if trace is ON New 1) Original bug by ChrisJohnRiley 2) JSESSIONID by Alexey Sintsov and Alexey Tyurin (ERPScan) Can be authen.cated as an exis.ng user remotely 32

5 MMC JSESSIONID stealing: Business risks Espionage Cri.cal Fraud High Sabotage Medium Ease of exploita.on Medium 33

5 MMC JSESSIONID stealing: Preven.on The JSESSIONID by default will not be logged in log file Don t use TRACE_LEVEL = 3 on produc8on systems or delete traces aver use Other info hpp://help.sap.com/saphelp_nwpi71/helpdata/en/ d6/49543b1e49bc1fe10000000a114084/frameset.htm 34

4 Remote command execu.on in TH_GREP: Descrip.on RCE vulnerability in RFC module TH_GREP Found by Joris van de Vis SAP was not properly patched (1433101) We have discovered that the patch can be bypassed in Windows Original bug by Joris van de Vis (erp- sec) Bypass by Alexey Tyurin (ERPScan) 35

4 RCE in TH_GREP: Details elseif opsys = 'Windows NT'. concatenate '/c:"' string '"' filename into grep_params in character mode. else. /*if linux*/ /* 185 */ replace all occurrences of '''' in local_string with '''"''"'''. /* 186 */ concatenate '''' local_string '''' filename into grep_params /* 187*/ in character mode. /* 188*/ endif. /* 188*/ 36

4 RCE in TH_GREP: Demo #1 37

4 - RCE in TH_GREP: More details 4 ways to execute vulnerable program Using transac8on "Se37 Using transac8on SM51 (thanks to Felix Granados) Using remote RFC call "TH_GREP" Using SOAP RFC call "TH_GREP" via web 38

4 RCE in TH_GREP: Demo #2 39

4 RCE in TH_GREP: Business risks Espionage High Sabotage Medium Fraud High Ease of exploita.on medium 40

4 RFC in TH_GREP: Preven.on Install SAP notes 1580017, 1433101 Prevent access to cri8cal transac8ons and RFC func8ons Check the ABAP code of your Z- transac8ons for similar vulnerabili8es 41

3 - ABAP Kernel BOF: Descrip.on Presented by Andreas Wiegenstein at BlackHat EU 2011 Buffer overflow in SAP kernel func8on C_SAPGPARAM When NAME field is more than 108 chars Can be exploited by calling an FM which uses C_SAPGPARAM Example of report RSPO_R_SAPGPARAM Author: (VirtualForge) 42

3 ABAP Kernel BOF: Business risks Espionage Cri.cal Sabotage Cri.cal Fraud Cri.cal Ease of exploita.on Medium 43

3 ABAP Kernel BOF: Preven.on Install SAP notes: - 1493516 Correc8ng buffer overflow in ABAP system call - 1487330 Poten8al remote code execu8on in SAP Kernel Prevent access to cri8cal transac8ons and RFC func8ons Check the ABAP code of your Z- transac8ons for cri8cal calls 44

2 Invoker Servlet: Descrip.on Rapidly calls servlets by their class name Published by SAP in their security guides Possible to call any servlet from the applica8on Even if it is not declared in WEB.XML Can be used for auth bypass 45

2 - Invoker Servlet: Details <servlet>! <servlet-name>criticalaction</servlet-name>! <servlet-class>com.sap.admin.critical.action</servlet-class>! </servlet>! <servlet-mapping>! <servlet-name>criticalaction</</servlet-name>! <url-pattern>/admin/critical</url-pattern>! </servlet-mapping! <security-constraint>! <web-resource-collection>! <web-resource-name>restrictedaccess</web-resource-name>! <url-pattern>/admin/*</url-pattern>! <http-method>get</http-method>! </web-resource-collection>! <auth-constraint>!<role-name>admin</role-name>!</auth-constraint>! Author: Dmitry Chastukhin (ERPScan) </security-constraint>! What if we call /servlet/com.sap.admin.cri.cal.ac.on 46

2 Invoker servlet: Business risks Espionage High Sabotage High Fraud High Ease of use Very easy! 47

2 - Invoker servlet: Preven.on Update to the latest patch 1467771, 1445998 EnableInvokerServletGlobally property of the servlet_jsp must be false If you can t install patches for some reason, you can check all WEB.XML files using ERPScan web.xml scanner manually. 48

1 VERB Tampering 49

1 st Place Verb Tampering <security-constraint>! <web-resource-collection>! <web-resource-name>restrictedaccess</web-resourcename>! <url-pattern>/admin/*</url-pattern>! <http-method>get</http-method>! </web-resource-collection>!!<auth-constraint>!<role-name>admin</role-name>!</auth-constraint>! </security-constraint>! Author: Alexander Polyakov (ERPScan)! What if we use HEAD instead of GET? 50

1 Verb tampering: Details CTC Secret interface for managing J2EE engine Can be accessed remotely Can run user management ac8ons: Add users Add to groups Run OS commands Start/Stop J2EE Remotely without authen.ca.on! 51

1 Verb tampering: Demo 52

1 Verb tampering: More details If patched, can be bypassed by the Invoker servlet! 53

1 Verb tampering: Business risks Espionage Cri.cal Sabotage Cri.cal Fraud Cri.cal Ease of use Very easy! 54

1 st Place Verb tampering: Preven.on Preven8on: Install SAP notes 1503579,1616259 Install other SAP notes about Verb Tampering (about 18) Scan applica8ons using ERPScan WEB.XML check tool or manually Secure WEB.XML by dele8ng all <hpp- method> Disable the applica8ons that are not necessary 55

Conclusion It is possible to be protected from almost all those kinds of issues and we are working hard with SAP to make it secure SAP Guides Regular Security assessments Monitoring technical security ABAP Code review Segrega.on of Du.es It s all in your hands 56

Future work Many of the researched things cannot be disclosed now because of our good relagonship with SAP Security Response Team, whom I would like to thank for cooperagon. However, if you want to see new demos and 0- days, follow us at @erpscan and a3end the future presentagons: PHDays in May (Moscow) Just4Mee8ng in July (Portugal) BlackHat USA in July (Las Vegas) 57

web: e- mail: TwiPer: www.erpscan.com info@erpscan.com sales@erpscan.com @erpscan @sh2kerr Greetz to our crew who helped: Dmitriy Evdokimov, Alexey Sintsov, Alexey Tyurin, Pavel Kuzmin, Evgeniy Neelov. 58