slides: - technocation, inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · what is the...

28
White-hat Google-Hacking MySQL Sheeri Cabral Senior DB Admin/Architect, Mozilla @sheeri www.sheeri.com Slides: http://bit.ly/ghackmysql

Upload: duongduong

Post on 28-Apr-2018

218 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

White-hat Google-Hacking MySQL

Sheeri CabralSenior DB Admin/Architect, Mozilla

@sheeri www.sheeri.com

Slides:http://bit.ly/ghackmysql

Page 2: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

What is White-Hat Google Hacking?

Hacking

Using Google

White-hat

Page 3: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Where to Start

Do some searching

http://johnny.ihackstuff.com/ghdb

Page 4: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Security Advisories

App and Web servers

Applications

Companies

Page 5: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Google's TOS

Under 18?

No automation

What's not in the TOS

https://www.google.com/accounts/TOS

- past versions

Page 6: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Password Hashes

Hash Dictionaries like http://hashash.in/

Password hash is *13824B0ECE00B527531D2C716AD36C23AC11A30B

What is the password in plaintext?

Page 7: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

How to Use Google

wildcards * .

Different media types

Boolean search

Page 8: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Google Basics

10 word limit

AND assumed

foo | bar

Page 9: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Operators

http://www.google.com/help/operators.html

Site matters

filetype: vs inurl:

Google Dork

Page 10: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

site:www.sheeri.com inurl:?id=1..100000

Page 11: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Vulnerable Locations

Common paths

Open source = double-edged sword

Page 12: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Some To Try

inurl:config.php inurl:php?

inurl:delete inurl:delete.php?id=

link:private.yourcompany.com

numrange:

Page 13: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

More To Try

site:sheeri.com filetype:php inurl:id

- Then test out injection

http://*:*@www.sheeri.com

intitle:Remote.Desktop.Web.Connection site:sheeri.com

Page 14: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Further study

http://bit.ly/ghacks0

http://bit.ly/ghacks1

www.securityvulns.com

Page 15: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Defensive Strategies

Validate/scrub input

CSRF – Validate source

XSS

SQL Injection Cheat Sheet– http://bit.ly/sqlinjcheat

Page 16: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

SQL Injection

Page 17: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

SQL Injection

http://bit.ly/explainsqlinj

SELECT count(*) FROM users WHERE username='$user' and pass='$pass';

-- if count(*)>0, log in!

Page 18: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

SQL Injection

http://bit.ly/explainsqlinj

SELECT count(*) FROM users WHERE username='$user' and pass='$pass';

-- if count(*)>0, log in!

Pass: hi' or 1=1

SELECT count(*) FROM users WHERE username='foo' and pass='hi' or 1=1';

Page 19: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Validate User Input

Look for ; \g \G ' “ UNION HTML encoding NULL or char(0) VARCHAR and ' '

Page 20: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Validate User Input

Save yourself time Buffer overflows CHARSET

Page 21: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Trusting GET or POST

Only from certain pages cookies – even with valid session ids register_globals=off in PHP

Page 22: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

When, Not If

How is application DB access stored?

As strong as your weakest link

No vaccine

Page 23: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Regression Testing Tools

http://sites.google.com/site/murfie/– goolink

– crapscan

– goohosts

Page 24: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

More Actions

Google Hacking Software– http://code.google.com/p/googlehacks/

Google Hacks Honey Pot– http://ghh.sourceforge.net/

Google honors robots.txt

Page 25: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Vulnerability Checking Tools

Goolag.org – GUI – old, but open source

Wikto/Nikto

Page 26: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Mozilla is Hiring!

http://careers.mozilla.org/

DBA – MySQL, Postgres, NoSQL (some or all)

http://careers.mozilla.org/en-US/position/oTqLWfwK

SysAdmin – RHEL, CentOS, Fedora

http://careers.mozilla.org/en-US/position/o97xWfwtUS, Canada, UK, France, Spain, Germany, Netherlands,

Sweden, Denmark, Poland, China, Japan, New Zealand

In Mountain View, Senior Windows/Unix SysAdmin

http://careers.mozilla.org/en-US/position/oZmJWfwK

Page 27: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Want to Learn MySQL?

12 weeks, 1 book. MySQL Marinate!

Soak it in! www.mysqlmarinate.com

Page 28: Slides: - Technocation, Inc.technocation.org/files/doc/2012_04_ghackmysql.pdf · What is the password in plaintext? How to Use Google wildcards * . Different media types Boolean search

Questions? Comments?OurSQL podcast

- www.oursql.com

MySQL Administrator's Bible

- tinyurl.com/mysqlbible

bit.ly/ghackmysql

kimtag.com/mysql

planet.mysql.com