SlideShare a Scribd company logo
First Improvised Security Testing Conference
Madrid, 8th August 2003


   Advanced Google
   Sear ching
   Google as a hacking tool
              Author: Johnny Long
                   johnny@ihackstuff.com
                 http://johnny.ihackstuff.com

                 Speaker: Vicente Aceituno
Why Google?

 Google caches all crawled web pages
 Google provides instant response
 Google provides document translations
 Google provides language translation
 Google provides web, news, catalog and
  ftp searches
 Google is cool
Index
 Google Searching
 Default Web pages
 Directory listings
 Finding files
 Googlescan tools
 Rise of the Robots
 Prevention
Google Searching

 Google provides a great deal of
  information about using it’s search
  engine in it’s fullest capacity.

 The following tables are copied verbatim
  from Google’s usage documents
Basic Searching
 Special Query
                 Example Query        Description
    Capability
                                      If a common word is essential to getting the results you
 Include Query   Star Wars Episode         want, you can include it by putting a "+" sign in
      Term           +I                    front of it.

                                      You can exclude a word from your search by putting a
 Exclude Query
                 bass -music              minus sign ("-") immediately in front of the term you
     Term
                                          want to exclude from the search results.

                                      Search for complete phrases by enclosing them in
                                          quotation marks or connecting them with hyphens.
                                          Words marked in this way will appear together in
 Phrase Search   "yellow pages"
                                          all results exactly as entered.
                                      Note: You may need to use a "+" to force inclusion of
                                          common words in a phrase.

                                      Google search supports the Boolean "OR" operator. To
 Boolean OR      vacation london OR
                                         retrieve pages that include either word A or word
     Search          paris
                                         B, use an uppercase OR between terms.
Filtering/Exclusion
                                                The query prefix "filetype:" filters the results
                                                    returned to include only documents with
                                                    the extension specified immediately
                                                    after. Note there can be no space
                       Google filetype:doc OR
 File Type Filtering                                between "filetype:" and the specified
                          filetype:pdf
                                                    extension.
                                                Note: Multiple file types can be included in a
                                                    filtered search by adding more
                                                    "filetype:" terms to the search query.


                                                The query prefix "-filetype:" filters the results
                                                    to exclude documents with the
                                                    extension specified immediately after.
                       Google -filetype:doc -       Note there can be no space between "-
 File Type Exclusion
                          filetype:pdf              filetype:" and the specified extension.
                                                Note: Multiple file types can be excluded in
                                                    a filtered search by adding more "-
                                                    filetype:" terms to the search query.
Filtering site/date
                                                     If you know the specific web site you want to
                                                           search but aren’t sure where the information
                                                           is located within that site, you can use Google
                                                           to search only within a specific web site.
                                                     Do this by entering your query followed by the
 Site Restricted
                   admission site:www.stanford.edu         string “site:” followed by the host name.
      Search
                                                     Note: The exclusion operator (“-“) can be applied
                                                           to this query term to remove a web site from
                                                           consideration in the search.
                                                           Note: Only one site: term per query is
                                                           supported.

                                                     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
 Date Restricted   Star Wars daterange:2452122-      <start_date> = Julian date indicating the start of
     Search             2452234                            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.
Title searching

                                                   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
 Title Search (term)   intitle:Google search
                                                   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.




                                                   Starting a query with the term "allintitle:"
 Title Search (all)    allintitle: Google search   restricts the results to those with all of the
                                                   query words in the title.
URL Searches
                                              If you prepend "inurl:" to a query term, Google
                                                    search restricts the results to documents
                                                    containing that word in the result URL. Note
                                                    there can be no space between the "inurl:" and
                                                    the following word.
                                              Note: "inurl:" works only on words , not URL
                                                    components. In particular, it ignores
URL Search (term)   inurl:Google search
                                                    punctuation and uses only the first word
                                                    following the "inurl:" operator. To find multiple
                                                    words in a result URL, use the "inurl:" operator
                                                    for each word.
                                              Note: Putting "inurl:" in front of every word in your
                                                    query is equivalent to putting "allinurl:" at the
                                                    front of your query.

                                              Starting a query with the term "allinurl:" restricts the
                                                    results to those with all of the query words in
                                                    the result URL.
                                              Note: "allinurl:" works only on words, not URL
                                                    components. In particular, it ignores
                                                    punctuation. Thus, "allinurl: foo/bar" restricts
URL Search (all)    allinurl: Google search
                                                    the results to pages with the words "foo" and
                                                    "bar" in the URL, but does not require that they
                                                    be separated by a slash within that URL, that
                                                    they be adjacent, or that they be in that
                                                    particular word order. There is currently no way
                                                    to enforce these constraints.
Text/Link Searching


                                                Starting a query with the term “allintext:”
                           allintext: Google        restricts the results to those with all of
 Text Only Search (all)
                                 search             the query words in only the body text,
                                                    ignoring link, URL, and title matches.




                                                Starting a query with the term “allinlinks:”
                           allinlinks: Google       restricts the results to those with all of
 Links Only Search (all)
                                 search             the query words in the URL links on the
                                                    page.
Link Searches

                                         The query prefix "link:" lists web pages that
                                             have links to the specified web page.
                                             Note there can be no space between
 Back Links      link:www.google.com
                                             "link:" and the web page URL.
                                         Note: No other query terms can be specified
                                             when using this special query term.




                                         The query prefix "related:" lists web pages
                                             that are similar to the specified web
                 related:www.google.co       page. Note there can be no space
 Related Links
                      m                      between "link:" and the web page URL.
                                         Note: No other query terms can be specified
                                             when using this special query term.
Translation service




                 Google offers a
                    very nice
                    language
                   translation
                     service.
Tricks
  When www.google.com is not available, try
   www2.google.com or www3.google.com.
  Reading the google’s cache can prevent filters
   to know what page are you seeing.
  You can get the same result we trick an
   english-to-english translation.
   http://translate.google.com/translate   (main URL)


   ?u=http://www.defcon.org&langpair=en|en              (options)
Intuitive Google
Sear ches
Default Web Pages
Windows-based default
server
              intitle:"Welcome to
              Windows 2000 Internet
              Services"
Windows-based default
server
                intitle:"Under
                construction" "does
                not currently have"
Windows NT 4.0

                 intitle:“Welcome
                 to IIS 4.0"
OpenBSD/Apache
(scalp=)
             “powered by
             Apache” “powered
             by openbsd"
Apache 1.2.6

               Intitle:”Test Page
               for Apache” “It
               Worked!”
Apache 1.3.0 – 1.3.9

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


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


             Intitle:”Simple page
             for Apache”
             “Apache Hook
             Functions”
Apache Version Info
    Apache    Number of
    Version   Servers
    1.3.6     119,000.00
    1.3.3     151,000.00
    1.3.14    159,000.00
    1.3.24    171,000.00
                           Google told
    1.3.9     203,000.00   us all this.
    2.0.39    256,000.00   We’ll discuss
    1.3.23    259,000.00
                           how in the
                           next section.
    1.3.19    260,000.00
    1.3.12    300,000.00
    1.3.20    353,000.00
    1.3.22    495,000.00
    1.3.26    896,000.00
Intuitive
Sear ches
Directory Listings
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.
Directory Example

                    Intitle:”Index of”


                    This query serves
                    as the basis for all
                    directory
                    searches…
Directory Info
Gathering
                 Some
                 servers, like
                 Apache,
                 generate a
                 server
                 version tag.
Esoteric Apache
Versioning
                                      Esoteric Apache Versions found on Google
                                                      query: intitle:"Index of" "Apache/[ver] Server at"
Number of Servers




                    80000                                                     69,300
                                                                                            64,200                                                             65,000
                    70000                                      60,500                                                                                               62,900

                    60000                                                                                                                      45,200
                    50000
                    40000
                                                  27,300
                    30000
                    20000                                                                                                                                                9,400
                    10000   33   30   245   310            5            207            93            74   61    3    9   20    2    1 30 474
                                                                                                                                     ,1
                                                                                                                                                        1 20
                                                                                                                                                         ,1
                                                                                                                                                                                   739
                        0




                                                                                                               1.3.26+interserver
                                                                                                                           1.3.xx
                                      1.3.4-dev


                                                               1.3.7-dev




                                                                                                                                                                             2.0.40-dev
                                                                                        1.3.15-dev



                                                                                        1.3.21-dev
                                                                                                                      1.3.23-dev
                                                                                                                      1.3.24-dev




                                                                                                                                                                             2.0.37-dev
                                                                                       1.3.17-HOF
                             1.2.6


                                          1.3.0
                                          1.3.1
                                          1.3.2


                                                                   1.3.4

                                                                  1.3.11


                                                                                            1.3.17




                                                                                                                                    2.0.16
                                                                                                                                    2.0.18
                                                                                                                                                2.0.28
                                                                                                                                                2.0.32
                                                                                                                                                               2.0.35
                                                                                                                                                               2.0.36
                            1.3b6




                             Ap a c h e V e r s io n
Common Apache
Versioning
                               Common Apache Versions found on Google
                                            query: intitle:"Index of" "Apache/[ver] Server at"


                    1.000.000,00                                                                         896.000
Number of Servers




                     800.000,00

                     600.000,00                                            495.000

                                                                 353.000
                     400.000,00    300.000
                                                       260.000                       259.000                                                     256.000
                                            159.000                                            171.000             151.000             203.000
                     200.000,00                                                                                              119.000

                            0,00
                                   1.3.12

                                              1.3.14

                                                        1.3.19

                                                                  1.3.20

                                                                            1.3.22

                                                                                      1.3.23

                                                                                                1.3.24

                                                                                                          1.3.26




                                                                                                                                                  2.0.39
                                                                                                                    1.3.3

                                                                                                                              1.3.6

                                                                                                                                        1.3.9
                                                                           Apache Server Version
Intuitive Searches


Finding Files
test-cgi

           Intitle:”Index of”
           test-cgi
ws_ftp.log

             Intitle:”Index
             of” ws_ftp.log
Secring.pgp

              Intitle:”Index of”
              secring.php
config.php

             Intitle:”Index
             of” config.php
administrators.pwd




             Intitle:”Index of”
             administrators.pwd
ws_ftp.ini

                                                               Intitle:”Index
                                                               of” ws_ftp.ini




Tip: Got to http://www.hispasec.com/directorio/laboratorio/Software/ws_ftp.html
.htpasswd

            Intitle:”Index
            of” .htpasswd
.htpasswd

            Intitle:”Index
            of” .htpasswd
/etc/shadow

              Intitle:”Index of”
              etc shadow
Advanced
Techniques

Googlescan
Googlescan

 With a known set of file-based web
  vulnerabilities, a vulnerability scanner
  based on search engines is certainly a
  reality.
Googlescan
 …
 /scancfg.cgi
 /cgi-bin/CrazyWWWBoard.cgi        Armed with a list
 /cgi-bin/pals-cgi                 of cgi exploits
 /ROADS/cgi-bin/search.pl          from any
 /way-board/way-board.cgi          common CGI
 /cgi-bin/replicator/webpage.cgi   scanner…
 /cgi-bin/auktion.pl
 /cgi-bin/webspirs.cgi
 /cgi-bin/ipf/etc/gfw/ui/pwd.dat
 /cgi-bin/hsx.cgi
 /cgi-bin/mailnews.cgi
 /cgi-bin/adcycle
 /cgi-bin/post-query
 /cgi-bin/ikonboard/help.cgi
 /cgi-bin/webspirs.cgi
 …
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
Googlescan.sh

 A simple shell script presents an html-
  formatted list of potentially vulnerable or
  interesting web servers.
Googlescan.sh output
Niktoogle.exe output
http://johnny.ihackstuff.com/googledorks.shtml
Advanced
Techniques

Rise of the Robots
Rise of the Robots

  Michal Zalewski wrote a great article for
   Phrack (57/10) which presented the idea
   of the use of autonomous search robots
   in server exploitation
Rise of the Robots

      “Consider a remote exploit that is able to
     compromise a remote system without
     sending any attack code to his victim.
     Consider an exploit which simply creates
     local file to compromise thousands of
     computers, and which does not involve any
     local resources in the attack. Welcome to
     the world of zero-effort exploit techniques.
     Welcome to the world of automation,
     welcome to the world of anonymous,
     dramatically difficult to stop attacks
     resulting from increasing Internet
     complexity.” –Michal Zalewski
The Concept
 Web robots crawl a web page indexing files it is
  allowed to find.

 Any links that are found on the indexed pages
  are followed as well.

 Instead of standard web links, create a payload
  of “exploit” links for the crawlers to consume.
Simple 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...
Simple Example

 The robots followed all the links as
  written, including connecting to non-http
  ports.

 The robots followed the “attack links,”
  performing the attack completely
  unaware.
Think Big
  Michael goes on to postulate that randomly
   generated, massive lists would cause much
   more of a problem.

  A simple PERL or CGI script randomly
   generating attack links in the thousands and
   teens of thousands would create a huge
   problem!

  Who would be liable?
Google doesn’t stop
  Tomorrow there will be even more sofisticated
   features…try this:

  http://labs1.google.com/cgi-bin/gviewer.cgi?q=
   intitle%3Aindex.of.private&delay=8&start=0

  http://labs.google.com/sets?hl=en&q1=password&
   passwd&q3=shadow&q4=etc&q5=&btn
   =Large+Set
Pr evention

Locking it down
Advice

 Google says it isn’t Google’s fault.
 Google is very happy to remove
  references. See
  http://www.google.com/remove.html.
 Follow the webmaster’s advice found at
  http://www.google.com/webmasters/
 Get smarter.
/misc: “Google Hacks”
      There is this book.
      And it’s an O’REILLY book.
      But it’s not about hacking.
      It’s about searching.
Google Hotspots
 Google APIs:
   http://www.google.com/apis/
 Google voice search: http://labs.google
  .com/gvs.html
 Google sets: http://labs.google.com/sets
 Google catalog search: http://catalogs.
  google.com/
 Google news search: http://news.google
  .com
 Google weblog: http://google.blogspace
  .com/
EOF

 Watch googleDorks.
 Questions?

More Related Content

What's hot (20)

PDF
Google Search Operators: Power Tips
Granit Doshlaku
 
PPTX
Google search techniques
Nirav Ranpara
 
PPTX
Google operators
Islamic University of Lebanon
 
DOCX
Search engines coh m
cpcmattc
 
PPTX
Google Search Operators
jjs1981
 
PDF
Amrapali builders -- google cheatsheet.pdf
amrapalibuildersreviews
 
PPTX
IS Audit Course- Final Project ppt
Shahzeb Pirzada
 
PPT
Mpl brownbag sept2011
Jason Coleman
 
PPS
Google Search Presentation
WFL Tech Trainer, Jen Farr
 
DOC
FII News
Florin Floria
 
PPTX
Search Engine
Ram Dutt Shukla
 
PPTX
Google like a Pro
Anna Mortelliti Call
 
PPT
The Many Faces of Google
Joel May
 
PPTX
What is Google search operators
AK DigiHub
 
PPTX
Zotero Competencies Workshop
John Pell
 
PPTX
How to google
mahajanmanu
 
PDF
Medical informatics
Hanaa Said
 
PPT
Internet Search Slideshow
lockyerj
 
PPTX
Search engines
Sahiba Khurana
 
PPT
Effective search on_google
Nipu Singh
 
Google Search Operators: Power Tips
Granit Doshlaku
 
Google search techniques
Nirav Ranpara
 
Search engines coh m
cpcmattc
 
Google Search Operators
jjs1981
 
Amrapali builders -- google cheatsheet.pdf
amrapalibuildersreviews
 
IS Audit Course- Final Project ppt
Shahzeb Pirzada
 
Mpl brownbag sept2011
Jason Coleman
 
Google Search Presentation
WFL Tech Trainer, Jen Farr
 
FII News
Florin Floria
 
Search Engine
Ram Dutt Shukla
 
Google like a Pro
Anna Mortelliti Call
 
The Many Faces of Google
Joel May
 
What is Google search operators
AK DigiHub
 
Zotero Competencies Workshop
John Pell
 
How to google
mahajanmanu
 
Medical informatics
Hanaa Said
 
Internet Search Slideshow
lockyerj
 
Search engines
Sahiba Khurana
 
Effective search on_google
Nipu Singh
 

Viewers also liked (20)

PPT
Google hacking 2015
gopartheredbuff
 
PDF
El Information Security Forum
Conferencias FIST
 
PPTX
Composición básica de dorks
Tensor
 
PDF
Black Hat 2011 - Pulp Google Hacking: The Next Generation Search Engine Hacki...
Rob Ragan
 
PPT
The Web, The User and the Library (and why to get in between)
Guus van den Brekel
 
PPT
Phishing-Updated
Jayaseelan Vejayon
 
PDF
Sample exam information_security_foundation_latin_american_spanish
edu25
 
PPT
TYPES OF HACKING
SHERALI445
 
PPTX
Google Dorks
Adhoura Academy
 
PDF
Phishing As Tragedy of the Commons
amiable_indian
 
PPTX
Circular Economy - And Open Source + Hacking As Paths To It
Lars Zimmermann
 
PPTX
Dangerous google dorks
Witgie Solutions
 
PDF
Google Hacking Basics
amiable_indian
 
PPTX
How To Be A Hacker
Paul Tarjan
 
PDF
Hacking For Innovation Delhi
Christian Heilmann
 
PDF
Athens Bullseye Meetup #1
GrowthRocks
 
PDF
2010: A Web Hacking Odyssey - Top Ten Hacks of the Year
Jeremiah Grossman
 
PDF
Hacking For Innovation
Christian Heilmann
 
PDF
Offensive cyber security: Smashing the stack with Python
Malachi Jones
 
PPTX
Google Dorks and SQL Injection
Mudassir Hassan Khan
 
Google hacking 2015
gopartheredbuff
 
El Information Security Forum
Conferencias FIST
 
Composición básica de dorks
Tensor
 
Black Hat 2011 - Pulp Google Hacking: The Next Generation Search Engine Hacki...
Rob Ragan
 
The Web, The User and the Library (and why to get in between)
Guus van den Brekel
 
Phishing-Updated
Jayaseelan Vejayon
 
Sample exam information_security_foundation_latin_american_spanish
edu25
 
TYPES OF HACKING
SHERALI445
 
Google Dorks
Adhoura Academy
 
Phishing As Tragedy of the Commons
amiable_indian
 
Circular Economy - And Open Source + Hacking As Paths To It
Lars Zimmermann
 
Dangerous google dorks
Witgie Solutions
 
Google Hacking Basics
amiable_indian
 
How To Be A Hacker
Paul Tarjan
 
Hacking For Innovation Delhi
Christian Heilmann
 
Athens Bullseye Meetup #1
GrowthRocks
 
2010: A Web Hacking Odyssey - Top Ten Hacks of the Year
Jeremiah Grossman
 
Hacking For Innovation
Christian Heilmann
 
Offensive cyber security: Smashing the stack with Python
Malachi Jones
 
Google Dorks and SQL Injection
Mudassir Hassan Khan
 

Similar to Google as a Hacking Tool (20)

PPTX
Web searching
ITOCA
 
DOCX
Internet Searching
Webmaster
 
DOCX
Tips on Searching for files on the Internet
Webmaster
 
PPT
Google and google scholar
Joelle Pitts
 
PPT
Google and google scholar
Joelle Pitts
 
PPTX
Wk5 contextualized onlinesearchandresearchskills
Resty Aldana
 
PPT
Google and Beyond
emaslyukova
 
PPT
Google and Google Scholar
jopitts
 
PPT
Google and Google Scholar
jopitts
 
PPTX
Unit3advgoogle
cdelson
 
PPTX
Google power search
Muhammed Shokr
 
PPTX
Google search techniques
Nirav Ranpara
 
PPT
Advanced google
nayanthakur
 
PPT
Google Search: Features and Capabilities
CRRC-Armenia
 
PDF
Pdfsamplefile-aacb4
bernard bernard
 
PDF
Pdfsamplefile
Testing Spammer
 
PDF
Google guide by Company Chargers blog
som sek
 
PPT
Extreme Googling: Tips & Tricks For Expert Searching
Martha Hardy
 
PDF
Google Search Cheat Sheet
Tiffany Hamburg Hamburg
 
PDF
Cheatsheet: Google Search
Kasper de Waard
 
Web searching
ITOCA
 
Internet Searching
Webmaster
 
Tips on Searching for files on the Internet
Webmaster
 
Google and google scholar
Joelle Pitts
 
Google and google scholar
Joelle Pitts
 
Wk5 contextualized onlinesearchandresearchskills
Resty Aldana
 
Google and Beyond
emaslyukova
 
Google and Google Scholar
jopitts
 
Google and Google Scholar
jopitts
 
Unit3advgoogle
cdelson
 
Google power search
Muhammed Shokr
 
Google search techniques
Nirav Ranpara
 
Advanced google
nayanthakur
 
Google Search: Features and Capabilities
CRRC-Armenia
 
Pdfsamplefile-aacb4
bernard bernard
 
Pdfsamplefile
Testing Spammer
 
Google guide by Company Chargers blog
som sek
 
Extreme Googling: Tips & Tricks For Expert Searching
Martha Hardy
 
Google Search Cheat Sheet
Tiffany Hamburg Hamburg
 
Cheatsheet: Google Search
Kasper de Waard
 

More from Conferencias FIST (20)

PDF
Seguridad en Open Solaris
Conferencias FIST
 
PDF
Seguridad en Entornos Web Open Source
Conferencias FIST
 
PDF
Spanish Honeynet Project
Conferencias FIST
 
PDF
Seguridad en Windows Mobile
Conferencias FIST
 
PDF
SAP Security
Conferencias FIST
 
PDF
Que es Seguridad
Conferencias FIST
 
PDF
Network Access Protection
Conferencias FIST
 
PDF
Las Evidencias Digitales en la Informática Forense
Conferencias FIST
 
PDF
Evolución y situación actual de la seguridad en redes WiFi
Conferencias FIST
 
PDF
Criptografia Cuántica
Conferencias FIST
 
PDF
Inseguridad en Redes Wireless
Conferencias FIST
 
PDF
Mas allá de la Concienciación
Conferencias FIST
 
PDF
Security Metrics
Conferencias FIST
 
PDF
PKI Interoperability
Conferencias FIST
 
PDF
Wifislax 3.1
Conferencias FIST
 
PDF
Network Forensics
Conferencias FIST
 
PDF
Riesgo y Vulnerabilidades en el Desarrollo
Conferencias FIST
 
PDF
Demostracion Hacking Honeypot y Análisis Forense
Conferencias FIST
 
PDF
Security Maturity Model
Conferencias FIST
 
PDF
Cisco Equipment Security
Conferencias FIST
 
Seguridad en Open Solaris
Conferencias FIST
 
Seguridad en Entornos Web Open Source
Conferencias FIST
 
Spanish Honeynet Project
Conferencias FIST
 
Seguridad en Windows Mobile
Conferencias FIST
 
SAP Security
Conferencias FIST
 
Que es Seguridad
Conferencias FIST
 
Network Access Protection
Conferencias FIST
 
Las Evidencias Digitales en la Informática Forense
Conferencias FIST
 
Evolución y situación actual de la seguridad en redes WiFi
Conferencias FIST
 
Criptografia Cuántica
Conferencias FIST
 
Inseguridad en Redes Wireless
Conferencias FIST
 
Mas allá de la Concienciación
Conferencias FIST
 
Security Metrics
Conferencias FIST
 
PKI Interoperability
Conferencias FIST
 
Wifislax 3.1
Conferencias FIST
 
Network Forensics
Conferencias FIST
 
Riesgo y Vulnerabilidades en el Desarrollo
Conferencias FIST
 
Demostracion Hacking Honeypot y Análisis Forense
Conferencias FIST
 
Security Maturity Model
Conferencias FIST
 
Cisco Equipment Security
Conferencias FIST
 

Recently uploaded (20)

PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 

Google as a Hacking Tool

  • 1. First Improvised Security Testing Conference Madrid, 8th August 2003 Advanced Google Sear ching Google as a hacking tool Author: Johnny Long [email protected] http://johnny.ihackstuff.com Speaker: Vicente Aceituno
  • 2. Why Google?  Google caches all crawled web pages  Google provides instant response  Google provides document translations  Google provides language translation  Google provides web, news, catalog and ftp searches  Google is cool
  • 3. Index Google Searching Default Web pages Directory listings Finding files Googlescan tools Rise of the Robots Prevention
  • 4. Google Searching  Google provides a great deal of information about using it’s search engine in it’s fullest capacity.  The following tables are copied verbatim from Google’s usage documents
  • 5. Basic Searching Special Query Example Query Description Capability If a common word is essential to getting the results you Include Query Star Wars Episode want, you can include it by putting a "+" sign in Term +I front of it. You can exclude a word from your search by putting a Exclude Query bass -music minus sign ("-") immediately in front of the term you Term want to exclude from the search results. Search for complete phrases by enclosing them in quotation marks or connecting them with hyphens. Words marked in this way will appear together in Phrase Search "yellow pages" all results exactly as entered. Note: You may need to use a "+" to force inclusion of common words in a phrase. Google search supports the Boolean "OR" operator. To Boolean OR vacation london OR retrieve pages that include either word A or word Search paris B, use an uppercase OR between terms.
  • 6. Filtering/Exclusion The query prefix "filetype:" filters the results returned to include only documents with the extension specified immediately after. Note there can be no space Google filetype:doc OR File Type Filtering between "filetype:" and the specified filetype:pdf extension. Note: Multiple file types can be included in a filtered search by adding more "filetype:" terms to the search query. The query prefix "-filetype:" filters the results to exclude documents with the extension specified immediately after. Google -filetype:doc - Note there can be no space between "- File Type Exclusion filetype:pdf filetype:" and the specified extension. Note: Multiple file types can be excluded in a filtered search by adding more "- filetype:" terms to the search query.
  • 7. Filtering site/date If you know the specific web site you want to search but aren’t sure where the information is located within that site, you can use Google to search only within a specific web site. Do this by entering your query followed by the Site Restricted admission site:www.stanford.edu string “site:” followed by the host name. Search Note: The exclusion operator (“-“) can be applied to this query term to remove a web site from consideration in the search. Note: Only one site: term per query is supported. 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 Date Restricted Star Wars daterange:2452122- <start_date> = Julian date indicating the start of Search 2452234 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.
  • 8. Title searching 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 Title Search (term) intitle:Google search 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. Starting a query with the term "allintitle:" Title Search (all) allintitle: Google search restricts the results to those with all of the query words in the title.
  • 9. URL Searches If you prepend "inurl:" to a query term, Google search restricts the results to documents containing that word in the result URL. Note there can be no space between the "inurl:" and the following word. Note: "inurl:" works only on words , not URL components. In particular, it ignores URL Search (term) inurl:Google search punctuation and uses only the first word following the "inurl:" operator. To find multiple words in a result URL, use the "inurl:" operator for each word. Note: Putting "inurl:" in front of every word in your query is equivalent to putting "allinurl:" at the front of your query. Starting a query with the term "allinurl:" restricts the results to those with all of the query words in the result URL. Note: "allinurl:" works only on words, not URL components. In particular, it ignores punctuation. Thus, "allinurl: foo/bar" restricts URL Search (all) allinurl: Google search the results to pages with the words "foo" and "bar" in the URL, but does not require that they be separated by a slash within that URL, that they be adjacent, or that they be in that particular word order. There is currently no way to enforce these constraints.
  • 10. Text/Link Searching Starting a query with the term “allintext:” allintext: Google restricts the results to those with all of Text Only Search (all) search the query words in only the body text, ignoring link, URL, and title matches. Starting a query with the term “allinlinks:” allinlinks: Google restricts the results to those with all of Links Only Search (all) search the query words in the URL links on the page.
  • 11. Link Searches The query prefix "link:" lists web pages that have links to the specified web page. Note there can be no space between Back Links link:www.google.com "link:" and the web page URL. Note: No other query terms can be specified when using this special query term. The query prefix "related:" lists web pages that are similar to the specified web related:www.google.co page. Note there can be no space Related Links m between "link:" and the web page URL. Note: No other query terms can be specified when using this special query term.
  • 12. Translation service Google offers a very nice language translation service.
  • 13. Tricks  When www.google.com is not available, try www2.google.com or www3.google.com.  Reading the google’s cache can prevent filters to know what page are you seeing.  You can get the same result we trick an english-to-english translation. http://translate.google.com/translate (main URL) ?u=http://www.defcon.org&langpair=en|en (options)
  • 15. Windows-based default server intitle:"Welcome to Windows 2000 Internet Services"
  • 16. Windows-based default server intitle:"Under construction" "does not currently have"
  • 17. Windows NT 4.0 intitle:“Welcome to IIS 4.0"
  • 18. OpenBSD/Apache (scalp=) “powered by Apache” “powered by openbsd"
  • 19. Apache 1.2.6 Intitle:”Test Page for Apache” “It Worked!”
  • 20. Apache 1.3.0 – 1.3.9 Intitle:”Test Page for Apache” “It worked!” “this web site!”
  • 21. Apache 1.3.11 - 1.3.26 "seeing this instead" intitle:"Test Page for Apache"
  • 22. Apache 2.0 Intitle:”Simple page for Apache” “Apache Hook Functions”
  • 23. Apache Version Info Apache Number of Version Servers 1.3.6 119,000.00 1.3.3 151,000.00 1.3.14 159,000.00 1.3.24 171,000.00 Google told 1.3.9 203,000.00 us all this. 2.0.39 256,000.00 We’ll discuss 1.3.23 259,000.00 how in the next section. 1.3.19 260,000.00 1.3.12 300,000.00 1.3.20 353,000.00 1.3.22 495,000.00 1.3.26 896,000.00
  • 25. 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.
  • 26. Directory Example Intitle:”Index of” This query serves as the basis for all directory searches…
  • 27. Directory Info Gathering Some servers, like Apache, generate a server version tag.
  • 28. Esoteric Apache Versioning Esoteric Apache Versions found on Google query: intitle:"Index of" "Apache/[ver] Server at" Number of Servers 80000 69,300 64,200 65,000 70000 60,500 62,900 60000 45,200 50000 40000 27,300 30000 20000 9,400 10000 33 30 245 310 5 207 93 74 61 3 9 20 2 1 30 474 ,1 1 20 ,1 739 0 1.3.26+interserver 1.3.xx 1.3.4-dev 1.3.7-dev 2.0.40-dev 1.3.15-dev 1.3.21-dev 1.3.23-dev 1.3.24-dev 2.0.37-dev 1.3.17-HOF 1.2.6 1.3.0 1.3.1 1.3.2 1.3.4 1.3.11 1.3.17 2.0.16 2.0.18 2.0.28 2.0.32 2.0.35 2.0.36 1.3b6 Ap a c h e V e r s io n
  • 29. Common Apache Versioning Common Apache Versions found on Google query: intitle:"Index of" "Apache/[ver] Server at" 1.000.000,00 896.000 Number of Servers 800.000,00 600.000,00 495.000 353.000 400.000,00 300.000 260.000 259.000 256.000 159.000 171.000 151.000 203.000 200.000,00 119.000 0,00 1.3.12 1.3.14 1.3.19 1.3.20 1.3.22 1.3.23 1.3.24 1.3.26 2.0.39 1.3.3 1.3.6 1.3.9 Apache Server Version
  • 31. test-cgi Intitle:”Index of” test-cgi
  • 32. ws_ftp.log Intitle:”Index of” ws_ftp.log
  • 33. Secring.pgp Intitle:”Index of” secring.php
  • 34. config.php Intitle:”Index of” config.php
  • 35. administrators.pwd Intitle:”Index of” administrators.pwd
  • 36. ws_ftp.ini Intitle:”Index of” ws_ftp.ini Tip: Got to http://www.hispasec.com/directorio/laboratorio/Software/ws_ftp.html
  • 37. .htpasswd Intitle:”Index of” .htpasswd
  • 38. .htpasswd Intitle:”Index of” .htpasswd
  • 39. /etc/shadow Intitle:”Index of” etc shadow
  • 41. Googlescan  With a known set of file-based web vulnerabilities, a vulnerability scanner based on search engines is certainly a reality.
  • 42. Googlescan … /scancfg.cgi /cgi-bin/CrazyWWWBoard.cgi Armed with a list /cgi-bin/pals-cgi of cgi exploits /ROADS/cgi-bin/search.pl from any /way-board/way-board.cgi common CGI /cgi-bin/replicator/webpage.cgi scanner… /cgi-bin/auktion.pl /cgi-bin/webspirs.cgi /cgi-bin/ipf/etc/gfw/ui/pwd.dat /cgi-bin/hsx.cgi /cgi-bin/mailnews.cgi /cgi-bin/adcycle /cgi-bin/post-query /cgi-bin/ikonboard/help.cgi /cgi-bin/webspirs.cgi …
  • 43. 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
  • 44. Googlescan.sh  A simple shell script presents an html- formatted list of potentially vulnerable or interesting web servers.
  • 49. Rise of the Robots  Michal Zalewski wrote a great article for Phrack (57/10) which presented the idea of the use of autonomous search robots in server exploitation
  • 50. Rise of the Robots “Consider a remote exploit that is able to compromise a remote system without sending any attack code to his victim. Consider an exploit which simply creates local file to compromise thousands of computers, and which does not involve any local resources in the attack. Welcome to the world of zero-effort exploit techniques. Welcome to the world of automation, welcome to the world of anonymous, dramatically difficult to stop attacks resulting from increasing Internet complexity.” –Michal Zalewski
  • 51. The Concept  Web robots crawl a web page indexing files it is allowed to find.  Any links that are found on the indexed pages are followed as well.  Instead of standard web links, create a payload of “exploit” links for the crawlers to consume.
  • 52. Simple 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...
  • 53. Simple Example  The robots followed all the links as written, including connecting to non-http ports.  The robots followed the “attack links,” performing the attack completely unaware.
  • 54. Think Big  Michael goes on to postulate that randomly generated, massive lists would cause much more of a problem.  A simple PERL or CGI script randomly generating attack links in the thousands and teens of thousands would create a huge problem!  Who would be liable?
  • 55. Google doesn’t stop  Tomorrow there will be even more sofisticated features…try this:  http://labs1.google.com/cgi-bin/gviewer.cgi?q= intitle%3Aindex.of.private&delay=8&start=0  http://labs.google.com/sets?hl=en&q1=password& passwd&q3=shadow&q4=etc&q5=&btn =Large+Set
  • 57. Advice  Google says it isn’t Google’s fault.  Google is very happy to remove references. See http://www.google.com/remove.html.  Follow the webmaster’s advice found at http://www.google.com/webmasters/  Get smarter.
  • 58. /misc: “Google Hacks” There is this book. And it’s an O’REILLY book. But it’s not about hacking. It’s about searching.
  • 59. Google Hotspots  Google APIs: http://www.google.com/apis/  Google voice search: http://labs.google .com/gvs.html  Google sets: http://labs.google.com/sets  Google catalog search: http://catalogs. google.com/  Google news search: http://news.google .com  Google weblog: http://google.blogspace .com/

Editor's Notes

  • #47: Esta herramienta usa búsquedas de palabras individuales en un dominio determinado.