110
Watching the Watchers Target Exploitation via Public Search Engines mail://[email protected] http://johnny.ihackstuff.com

Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://[email protected] ... The vulnerability lies in a

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Watching the

Watchers

Target Exploitation via Public

Search Enginesmail://[email protected]

http://johnny.ihackstuff.com

Page 2: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

what’s this about?

using search engines to do interesting

(sometimes unintended) stuff

sp3ak l1ke l33to hax0rs

act as transparent proxy servers

sneak past security

find development sites

Page 3: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

what’s this about?

using search engines to find exploitable targets on the web which

run certain operating systems

run certain web server software

harbor specific vulnerabilities

harbor sensitive data in public directories

harbor sensitive data in public files

automating the process: googlescan

Page 4: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

pick your poison

we have certain needs from a search engine:

advanced search options (not just AND’s and OR’s)

browsing down or changed pages (caching)

instant response (zero-wait)

document and language translations

web, news, image and ftp searches

The obvious choice: Google

Page 5: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

not new...Vincent GAILLOT

<[email protected]

lyon.fr> posted this to

BUGTRAQ nearly two

years ago...

Page 6: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

doing interesting stuff

hax0r, “Google hacks,” proxy, auth

bypass, finding development sites

Page 7: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

hax0r

for those of us

spending way

too much time

spe@king

hax0r...

Page 8: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

/misc: “Google Hacks”

There is this book.

And it’s an O’REILLY book.

But it’s not about hacking.

It’s about searching.

I didn’t write it.

Because if I wrote it, it would really be about hacking

using Google and that would get both Google and

O’REILLY both really upset and then lawyers would get

involved, which is never good unless of course the lawyer

happens to be Jennifer Granick... =)

Page 9: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

proxy

Google offers a

very nice

language

translation

service.

Page 10: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

for example,

translating from

english to

spanish...

proxy

Page 11: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Our english-to-spanish translated Google page is:

http://translate.google.com/translate (main URL)

?u=http://www.defcon.org&langpair=en|es (options)

What happens if we play with the options a bit to provide an

english-to-english translation, for example?

http://translate.google.com/translate (main URL)

?u=http://www.defcon.org&langpair=en|en (options)

proxy

Page 12: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

we’re surfing

through Google,

not to the evil

DEFCON page.

The boss will be

sooo proud! 8P

proxy

Page 13: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

proxy

Google proxy bouncers

http://exploit.wox.org/tools/googleproxy.html

http://johnny.ihackstuff.com

Page 14: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

finding development sites

this is a copy of a

production site found on

a web development

company’s server...

use unique phrases from

an existing site to find

mirrors or development

servers hosting the same

page.

Page 15: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

finding development sites

• troll the development site with another search looking for more files on that server...

Page 16: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

finding development sites

• eventually, creative searching can lead to pay dirt: a source code dump

dir!

Page 17: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

auth bypass

Let’s say an attacker is interested in

what’s behind www.thin-ice.com, a

password protected page:

Page 18: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

auth bypass

One search gives us insight into the

structure of the site:

Page 19: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

auth bypass

Another search gives a cache link:

Page 20: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

auth bypass

Another click takes us to the cached version of

the page (no password needed!)

Page 21: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

auth bypass

One more click to the really interesting

stuff... site source code!

*this site was notified and secured before making this public. sorry, kids ;-)

Page 22: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

evil searching: the

basics

tools of the trade

Page 23: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Google search syntax

Tossing Google around requires a firm

grasp of the basics.

Many of the details can be found here:

http://www.google.com/apis/reference.html

Page 24: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

simple word search

A simple search...

Page 25: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

simple word search

...can return amazing results. This is the contents of a

live .bash_history file!

Page 26: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

simple word search

Crawling around on the same web site reveals a

firewall configuration file complete with a username and

password...

Page 27: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

simple word search

...as well as an ssh known hosts file!

Page 28: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

simple phrase search

Creativity with search phrases (note the use of quotes)…

Page 29: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

simple phrase search

...can reveal interesting tidbits like

this Cold Fusion error message.

Page 30: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

simple phrase search

(Error messages

can be very

revealing. )

Page 31: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

simple phrase search II

Sometimes the most idiotic searches

(“enter UNIX command”)...

Page 32: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

simple phrase search II

...can be the most rewarding!

Page 33: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

symbol use

+ (plus) AND, force use

- (dash) NOT (when used outside

quotes)

. (period) any character

- (dash) space (when used in

quotes)

* (asterisk) wildcard word (when used

in quotes)

special characters

Page 34: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

site: site-specific search

site:gov boobs

Page 35: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

site: crawling

site:defcon.org defcon

-use the site: keyword

along with the site name

for a quick list of

potential servers and

directories

Page 36: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

site: crawling

-use the site: keyword

along with a common file

extension to find

accidental directory

listings..

Page 37: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Date Searching

• Date Restricted

Search

• Star Wars daterange:2452122-

2452234

• If you want to limit your results to documents that

were published within a specific date range, then

you can use the “daterange: “ query term to

accomplish this. The “daterange:” query term

must be in the following format:

• daterange:<start_date>-<end date> where

• <start_date> = Julian date indicating the start of

the date range

<end_date> = Julian date indicating the end of

the date range

• The Julian date is calculated by the number of

days since January 1, 4713 BC. For example, the

Julian date for August 1, 2001 is 2452122.

Page 38: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Title searching

Starting a query with the term "allintitle:"

restricts the results to those with all of the

query words in the title.

allintitle: Google searchTitle Search (all)

If you prepend "intitle:" to a query term,

Google search restricts the results to

documents containing that word in the

title. Note there can be no space between

the "intitle:" and the following word.

Note: Putting "intitle:" in front of every word

in your query is equivalent to putting

"allintitle:" at the front of your query.

intitle:Google searchTitle Search (term)

Page 39: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

INURL: URL Searches

inurl: find the search term within the URL

inurl:admin

inurl:admin

users mbox

inurl:admin users

passwords

Page 40: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

filetype:

filetype:xls “checking

account” “credit card”

many more examples

coming... patience...

Page 41: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

finding interesting stuff

finding OS and web server versions

Page 42: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Windows-based default server

intitle:"Welcome to Windows 2000 Internet Services"

Page 43: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Windows-based default server

intitle:"Under construction" "does not currently have"

Page 44: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Windows NT 4.0

intitle:“Welcome to IIS 4.0"

Page 45: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

OpenBSD/Apache (scalp=)

“powered by Apache” “powered by openbsd"

Page 46: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Apache 1.2.6

Intitle:”Test Page for Apache” “It Worked!”

Page 47: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Apache 1.3.0 – 1.3.9

Intitle:”Test Page for Apache” “It worked!” “this web site!”

Page 48: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Apache 1.3.11 - 1.3.26

"seeing this instead" intitle:"Test Page for Apache"

Page 49: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Apache 2.0

Intitle:”Simple page for Apache” “Apache Hook Functions”

Page 50: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Directory Info Gathering

• Some servers, like Apache, generate a server version tag...

Page 51: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Apache Version Info

...which we can harvest for some quick stats...

•Apache

Version

•Number

of Servers

• 1.3.6

• 119,00

0.00

• 1.3.3

• 151,00

0.00

• 1.3.14

• 159,00

0.00

• 1.3.24

• 171,00

0.00

• 1.3.9

• 203,00

0.00

• 2.0.39

• 256,00

0.00

• 1.3.23

• 259,00

0.00

• 1.3.19

• 260,00

0.00

• 1.3.12

• 300,00

0.00

• 1.3.20

• 353,00

0.00

Page 52: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Weird Apache Versions

Esoteric Apache Versions found on Googlequery: intitle:"Index of" "Apache/[ver] Server at"

310

27,300

5

60 ,500

69 ,300

7 4 61 3 9 20 2 1,130 474

62 ,900

9,400

73933 30 207 932451,120

65 ,00064,200

45,200

01000020000300004000050000600007000080000

1.2

.6

1.3

b6

1.3

.0

1.3

.1

1.3

.2

1.3

.4-d

ev

1.3

.4

1.3

.7-d

ev

1.3

.11

1.3

.15

-dev

1.3

.17

1.3

.17

-HO

F

1.3

.21

-dev

1.3

.23

-de

v

1.3

.24

-de

v

1.3

.26

+in

ters

erv

er

1.3

.xx

2.0

.16

2.0

.18

2.0

.28

2.0

.32

2.0

.35

2.0

.36

2.0

.37

-dev

2.0

.40

-dev

A p a c h e V e r s i o n

Nu

mb

er

of

Serv

ers

Page 53: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Common Apache Versions

Common Apache Versions found on Googlequery: intitle:"Index of" "Apache/[ver] Server at"

159,000

260,000

353,000

495,000

259,000

171,000

896,000

256,000

119,000

151,000 203,000

300,000

0.00

200,000.00

400,000.00

600,000.00

800,000.00

1,000,000.001

.3.1

2

1.3

.14

1.3

.19

1.3

.20

1.3

.22

1.3

.23

1.3

.24

1.3

.26

1.3

.3

1.3

.6

1.3

.9

2.0

.39

Apache Server Version

Nu

mb

er

of

Se

rve

rs

Page 54: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

vulnerability trolling

finding 0day targets...

Page 55: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

vulnerability trolling

A new vulnerability hits the streets...

Page 56: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

vulnerability trolling

The vulnerability lies in a cgi script called “normal_html.cgi”

Page 57: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

vulnerability trolling

212 sites are

found with the

vulnerable CGI

the day the exploit

is released.

Page 58: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

more interesting stuff...

finding sensitive data in directories

and files

Page 59: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Directory Listings

Directory listings are often misconfigurations in the web server.

A directory listing shows a list of files in a directory as opposed to presenting a web page.

Directory listings can provide very useful information.

Page 60: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Directory Example

a query of

intitle:”Index of”

reveals sites like

this one.

The “intitle”

keyword is one

of the most

powerful in the

google master’s

arsenal...

Page 61: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Directory Example

notice that the

directory listing

shows the

names of the

files in the

directory.

we can combine

our “intitle”

search with

another search

to find specific

files available on

the web.

Page 62: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Intitle:”Index of” .htpasswd

Lots more

examples

coming. Stick

around for the

grand finale...

Page 63: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

finding interesting stuff

automation: googlescan

Page 64: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Googlescan

With a known set of file-based web

vulnerabilities, a vulnerability scanner

based on search engines is certainly a

reality.

Let’s take a look at a painfully simple

example using nothing more than UNIX

shell commands...

Page 65: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Googlescan.shfirst, create a file

(vuln_files) with the

names of cgi

programs...

Page 66: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Googlescan.sh

rm temp

awk -F"/"

'{print $NF"|http://www.google.com/search?q=

intitle%3A%22Index+of%22+"$NF}' vuln_files > queries

for query in `cat queries`

do

echo -n $query"|" >> temp

echo $query | awk -F"|" '{print $2}'

lynx -source `echo $query | awk -F"|" '{print $2}'` |

grep "of about" |

awk -F "of about" '{print $2}' |

awk -F"." '{print $1}' |

tr -d "</b>[:cntrl:] " >> temp

echo " " >> temp

Done

cat temp |

awk -F"|" '{print "<A HREF=\"" $2 "\">" $1 " (" $3 "hits)

</A><BR><BR>"}' | grep -v "(1,770,000" > report.html

...then, use this shell

script...

Page 67: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Googlescan.sh output

...to output an

html list of

potentially

vulnerable or

interesting web

servers

according to

Google.

Page 68: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

http://johnny.ihackstuff.com/googledorks.shtml

Page 69: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

more interesting stuff

Rise of the Robots

Page 70: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Rise of the Robots

“Rise of the Robots”, Phrack 57-10 by

Michal Zalewski: autonomous malicious

robots powered by public search engines

Search engine crawlers pick up malicious

links and follow them, actively exploiting

targets

Page 71: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Rise of the Robots: Example

Michal presents the following example links on his indexed web page:

http://somehost/cgi-bin/script.pl?p1=../../../../attack

http://somehost/cgi-bin/script.pl?p1=;attack

http://somehost/cgi-bin/script.pl?p1=|attack

http://somehost/cgi-bin/script.pl?p1=`attack`

http://somehost/cgi-bin/script.pl?p1=$(attack)

http://somehost:54321/attack?`id`

http://somehost/AAAAAAAAAAAAAAAAAAAAA...

Page 72: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Rise of the Robots: Results

Within Michal’s study, the robots followed all

the links as written, including connecting to

non-http ports!

The robots followed the “attack links,”

performing the attack completely unawares.

Moral: Search engines can attack for you, and

store the results, all without an attacker

sending a single packet directly to the target.

Page 73: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Prevention

Locking it down

Page 74: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Google’s advice

This isn’t Google’s fault.

Google is very happy to remove

references. See

http://www.google.com/remove.html.

Follow the webmaster advice found at

http://www.google.com/webmasters/faq.h

tml.

Page 75: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

My advice

Don’t be a dork. Keep it off the web!

Scan yourself.

Be proactive.

Watch googledorks (http://johnny.ihackstuff.com/googledorks.shtml)

Page 76: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Finally....

The Grand Finale!

Page 77: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of test-cgi

Page 78: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of page.cfm

exploitable by

passing invalid

?page_id=

Page 79: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of dead.letter

Page 80: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of pwd.db

passwd –pam.conf

Page 81: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of master.passwd

Page 82: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of..etc passwd

Page 83: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of passwd

Page 84: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:"Index.of..etc" passwd

Page 85: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:"Index.of..etc" passwd

Page 86: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:"Index.of..etc" passwd

Page 87: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of auth_user_file.txt

Page 88: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of pwd.db

passwd –pam.conf

Page 89: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of ws_ftp.ini

Page 90: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of

administrators.pwd

Page 91: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of people.lst

Page 92: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of passlist

Page 93: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of .htpasswd

Page 94: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of “.htpasswd” htpasswd.bak

Page 95: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of “.htpasswd” htpasswd.bak

Page 96: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of “.htpasswd” htpasswd.bak

Page 97: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of secring.pgp

Page 98: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of..etc hosts

Page 99: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of..etc hosts

Page 100: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:Index.of etc shadow

Page 101: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of passlist

Page 102: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

filetype:xls username password email

Page 103: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

intitle:index.of config.php

Page 104: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

social security numbers

how about a few

names and

SSN’s?

Page 105: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

social security numbers II

How about a few

thousand

names and

SSN’s?

Page 106: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

social security numbers III

How about a few

thousand more

names and

SSN’s?

Page 107: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

Final words...

Page 108: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

other google press..

“Mowse: Google Knowledge: Exposing Sensitive data with Google”

http://www.digivill.net/~mowse/code/mowse-googleknowledge.pdf

“Autism: Using google to hack”

www.smart-dev.com/texts/google.txt

“Google hacking”:

https://www.securedome.de/?a=actually%20report (German)

“Google: Net Hacker Tool du Jour”

http://www.wired.com/news/infostructure/0,1377,57897,00.html

Page 109: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a

EOF

<plug> Watch googleDorks. </plug>

Questions?

Contact Me / Get stuff:

http://johnny.ihackstuff.com

[email protected]

Special Thanks to j3n, m@c, tr3 and p3@nut! =)

Page 110: Watching the Watchers - DEF CON · 2011-02-26 · Watching the Watchers Target Exploitation via Public Search Engines mail://johnny@ihackstuff.com ... The vulnerability lies in a