20121017 ia4sp praesentation sap sicherheit wiegenstein
DESCRIPTION
20121017 IA4SP Praesentation SAP Sicherheit WiegensteinTRANSCRIPT
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Dr. Markus Schumacher
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
„IA4SP & RAAD: SAP-Partner Konferenz 2012 “ – 17. Oktober, Walldorf
SAP-Sicherheit Offene Fenster für Hacker oder Der Weg des geringsten Widerstands
Andreas Wiegenstein
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Mein Auto, mein Haus, mein Boot, …
Andreas Wiegenstein
Gründer von Virtual Forge (Heidelberg), verantwortlich für R&D
SAP Security Researcher, aktiv seit 2003
Credit von SAP für mehr als 20 gemeldete 0-day Schwachstellen
Regelmäßiger Referent auf internationalen Konferenzen
SAP TechEd 2004 (USA & Europa) / 2005 (USA) / 2006 (USA), DSAG
2009
BlackHat 2011 (Europa), Hack in the Box 2011 (Europa)
Troopers 2011 & 2012 (Europa), RSA 2012 (USA)
Co-Autor „Sichere ABAP Programmierung" (SAP Press)
Training Class WDESA3 @ SAP University
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
SAP Applikationssicherheit
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Der Weg des geringsten Widerstands
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Was im Standard schützt…
ABAP Workbench (SE80)
INSERT REPORT
Transaktionaler Schutz : Anlegen von ABAP Programmen
S_DEVELOP ?
Produktivsystem ?
S_TCODE ?
Erzeugt ABAP Programme
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
…hilft nicht bei Eigenentwicklungen
Funktionsbaustein ZFB1
INSERT REPORT
Eigenentwicklungen können sämtliche Regeln außer Kraft setzen
Business Server Page ZBSP
Web Dynpro Anwendung ZWD
Transaktion ZTRANS1
REPORT ZREP
Funktionsbaustein ZFB2 Transaktion ZTRANS2
Risiko
Risiko
Risiko
Risiko
Risiko
Risiko
Risiko Erzeugt ABAP Programme
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Unternehmen haben ~ 1.65 Mio LOC Custom ABAP (netto) *
Dies entspricht etwa 1% des SAP Standards (ECC 6.0)
Das wären 8 Bermuda Dreiecke auf der Erde, was der doppelten
Fläche des Mittelmeeres entspräche.
* Virtual Forge Studie mit 61 Firmen und 120 Mio LOC (netto)
Netto = Code ohne Kommentare und Leerzeilen
Eigenentwicklungen in Zahlen
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Ein Unternehmen haftet immer für eigenen Code*
Relevanz
Hausinterne Entwicklung
Outsourcing
Firmenzukäufe
* (Chuprunov, SAP Revision, SAP Press, 2012)
SAP Audits
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Was kann schief gehen?
1. Berechtigungsfehler
2. Injection Schwachstellen
3. Hintertüren und Standard-Bypasses
4. Datenlecks
Sicherheitsrisiken im ABAP
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
IF sy-uname <> for_user.
AUTHORITY-CHECK OBJECT 'S_DEVELOP'
ID 'DEVCLASS' DUMMY
ID 'OBJTYPE' FIELD 'DEBUG'
ID 'OBJNAME' FIELD for_user
ID 'P_GROUP' DUMMY
ID 'ACTVT' FIELD '90'.
ELSE.
AUTHORITY-CHECK OBJECT 'S_DEVELOP'
ID 'DEVCLASS' DUMMY
ID 'OBJTYPE' FIELD 'DEBUG'
ID 'OBJNAME' DUMMY
ID 'P_GROUP' DUMMY
ID 'ACTVT' FIELD '03'.
IF sy-subrc <> 0.
cx_wd_general=>raise( text-001 ).
ENDIF.
ENDIF.
Quiz: Berechtigungsfehler
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Berechtigungsfehler - Statistik
Es gibt im Schnitt 1 kritischen Berechtigungsfehler alle 1.400 LOC*
* Virtual Forge Studie mit 61 Firmen und 120 Mio LOC (netto)
Netto = Code ohne Kommentare und Leerzeilen
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
BIZEC APP/11 Prüfempfehlungen
ID Schwachstelle Beschreibung
APP-01 ABAP Command Injection Ausführung beliebigen ABAP Codes
APP-02 OS Command Injection Ausführung beliebiger Betriebssystem-Kommandos
APP-03 Native SQL Injection Ausführung beliebiger nativer SQL Kommandos
APP-04 Improper Authorization (Missing, Broken, Proprietary, Generic)
Fehlende oder fehlerhafte Berechtigungsprüfung
APP-05 Directory Traversal Unerlaubter Schreib-/Lesezugriff auf Dateien (SAP Server)
APP-06 Direct Database Modifications Unerlaubter Zugriff auf SAP Standard Tabellen
APP-07 Cross-Client Database Access Mandantenübergreifender Zugriff auf Geschäftsdaten
APP-08 Open SQL Injection Schadhafte Manipulation von Datenbankbefehlen
APP-09 Generic Module Execution Unerlaubte Ausführung von Modulen (Reports, FuBas, etc)
APP-10 Cross-Site Scripting Manipulation des Browser UI, Diebstahl von Berechtigungen
APP-11 Obscure ABAP Code Versteckter bzw. nicht auditierbarer ABAP Code
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Weitere Informationen
Literatur
Organisationen
Sichere ABAP-Programmierung (SAP PRESS, 372 S., 2009)
Andreas Wiegenstein, Markus Schumacher,
Sebastian Schinzel, Frederik Weidemann
BIZEC – Business Security Initiative
http://www.bizec.org
Handbuch SAP-Revision (SAP PRESS, 700 S., 2012)
Maxim Chuprunov
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Demos
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
ABAP Command Injection
Funktionale Analyse des Befehls INSERT REPORT
1. Auswirkungen auf die Authorization Trace
2. Auswirkungen auf einem Produktivsystem
3. Modifikation des SAP Standards
4. Die folgenden SAP Notes patchen ABAP Command Injections
A. 1589919 (Juli 2011)
B. 1592312 (Juli 2011)
DEMO
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Native SQL Injection
0-day im SAP Standard
1. Erste bekannte native SQL Injection
2. Ausführen von beliebigen SQL Kommandos
3. SAP Note 1456569 (Dez. 2010) löst das gezeigte Problem
DEMO
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
„Hintertüren“ im Standard
Direkte Eingabe von “OK Codes” in TA RSRV
1. Normaler Programmfluss: "display"
2. Versteckter Programmfluss: "editor_call“
Keine „echte“ Hintertür, aber ein schönes „Osterei“
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Vielen Dank für Ihr Interesse
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Haben Sie noch Fragen?
VIRTUALFORGE GmbH
Speyerer Straße 6
69115 Heidelberg
Deutschland
Telefon: + 49 (0) 6221 86 89 0 - 0
Fax: + 49 (0) 6221 86 89 0 - 101
© 2011 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
TITEL bearbeiten
© 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved. © 2012 Virtual Forge GmbH | www.virtualforge.com | All rights reserved.
Dieser Vortrag demonstriert Sicherheitsrisiken in der Sprache ABAP.
Wenn bestimmte Sicherheitsfehler in ABAP möglich sind, bedeutet dies
nicht zwangsläufig , dass diese im SAP Standard Code vorhanden sind.
Virtual Forge hat allerdings sämtliche hier beschriebenen Fehler in
Eigenentwicklungen bei SAP Kunden entdeckt.
Disclaimer