28
COPYRIGHT TRUSTWAVE 2011 Presented by: Advanced SQL Injection with SQLol Daniel Crowley

Advanced SQL Injection with SQLol

Embed Size (px)

DESCRIPTION

The slides from my SOURCE Boston 2012 talk: Advanced SQL Injection with SQLol

Citation preview

Page 1: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Presented by:

Advanced SQL Injection with SQLol

Daniel Crowley

Page 2: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Daniel CrowleyTrustwave SpiderLabs

@[email protected]

Whom?

Page 3: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

SQLolA configurable SQLi test-bedA tool for

ResearchEducationTesting

http://github.com/SpiderLabs/SQLol

What?

Page 4: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Existing test-beds areInflexibleSimplified

Real-world scenarios areVariedDangerous

Why?

Page 5: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Heghlu'meH QaQ jajvam

Why? Klingon version

Page 6: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

I humbly posit that the current state(With much respect to work which does precede)Of test-beds made with vulns to

demonstrateIs lacking some in flexibility.

Why? Shakespearean version

Page 7: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Two options are presented present-day,As far as when one deals with SQL:A blind injection (bool or time delay)And UNION statement hax (oh gee, how swell…)

Why? Shakespearean version

Page 8: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Imagine we could choose how queries readAnd how our input sanitizes, oh!How nimble and specific we could beTo recreate our ‘sploit scenarios.

Why? Shakespearean version

Page 9: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

And thus is S-Q-L-O-L conceived:That we can study how to pwn DBs.

Why? Shakespearean version

Page 10: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

‘Cuz.

Why? tl;dr version

Page 11: Advanced SQL Injection with SQLol

AIMSelecting flaw configuration

Page 12: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Choose type of query

Page 13: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Choose sanitization options

Page 14: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Choose verbosity

Page 15: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Challenges

Page 16: Advanced SQL Injection with SQLol

FIREManual and automated exploitation

Page 17: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Manual

Page 18: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Manual

Page 19: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Automated

Page 20: Advanced SQL Injection with SQLol

DEMONSTRATION?HOW ABOUT A

Page 21: Advanced SQL Injection with SQLol

MAKE THE MAGIC HAPPENDeploying SQLol

Page 22: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Web server of your choicewith PHP

ADODB-supported database

Requirements

Page 23: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Un-tar SQLol inside web root

Deployment

Page 24: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Modify includes/database.config.php

Deployment

Page 25: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Run database reset script

Deployment

Page 26: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Custom sanitization routinesStored procedure injectionsDatabase privilege optionsMore challenges

Future features

Page 27: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

Try XMLmao!Possible future test beds?

cryptOMGrofLDAP (asLDAP)KTHXbypassXSSmh

Like SQLol?

Page 28: Advanced SQL Injection with SQLol

COPYRIGHT TRUSTWAVE 2011

[email protected]: @dan_crowley

Code:http://github.com/SpiderLabs/SQLol

http://www.surveymonkey.com/sourceboston12

Questions?