Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.



Published on

Published in: Technology, News & Politics


  1. 1. Fun with Jeremy Rasmussen 9/23/05 Part 1: Power searches and reconnaissance
  2. 2. I’m feeling lucky <ul><li>The Google interface </li></ul><ul><li>Preferences </li></ul><ul><li>Cool stuff </li></ul><ul><li>Power searching </li></ul>
  3. 3. Classic interface
  4. 4. Custom interface
  5. 5. Language prefs
  6. 6. Google in H4x0r
  7. 7. Language <ul><li>Proxy server can be used to hide location and identity while surfing Web </li></ul><ul><li>Google sets default language to match country where proxy is </li></ul><ul><li>If your language settings change inexplicably, check proxy settings </li></ul><ul><li>You can manipulate language manually by fiddling directly with URL </li></ul>
  8. 8. Google scholar
  9. 9. Google University search
  10. 10. Google groups
  11. 11. Google freeware <ul><li>Web accelerator </li></ul><ul><li>Google earth </li></ul><ul><li>Picasa </li></ul><ul><li>Etc. </li></ul>
  12. 12. Golden rules of searching <ul><li>Google is case-insensitive </li></ul><ul><ul><li>Except for the Boolean operator OR, which must be written in uppercase </li></ul></ul><ul><li>Wildcards not handled normally </li></ul><ul><ul><li>* nothing more than a single word in a search phrase; provides no additional stemming </li></ul></ul><ul><li>Google stems automatically </li></ul><ul><ul><li>Tries to expand or contract words automatically—can’t lead to unpredictable results </li></ul></ul>
  13. 13. Golden rules of searching <ul><li>Google ignores “stop” words </li></ul><ul><ul><li>Who, where, what, the, a, an </li></ul></ul><ul><ul><li>Except when you search on them individually </li></ul></ul><ul><ul><li>Or when you put “quotes” around search phrase </li></ul></ul><ul><ul><li>Or when you +force +it +to +use +all +terms </li></ul></ul><ul><ul><ul><li>Largest possible search? </li></ul></ul></ul><ul><li>Google limits you to a 10-word query </li></ul><ul><ul><li>Get around this by using wildcards for stop words </li></ul></ul>
  14. 14. Boolean operators <ul><li>Google automatically ANDs all search terms </li></ul><ul><li>Spice things up with: </li></ul><ul><ul><li>OR  | </li></ul></ul><ul><ul><li>NOT  – </li></ul></ul><ul><li>Google evaluates these from left to right </li></ul><ul><li>Search terms don’t even have to be syntactically correct in terms of Boolean logic </li></ul>
  15. 15. Search example <ul><li>What does the following search term do: </li></ul><ul><li>Intext:password | passcode intext:username | userid | user filetype:xls </li></ul><ul><li>Locates all pages that have either password or passcode in their text. Then from these, show only pages that have username, userid, or user. From these, it shows only .XLS files. </li></ul><ul><li>Google not confused by the lousy syntax or </li></ul><ul><li>lack of parentheses. </li></ul>
  16. 16. URL queries <ul><li>Everything that can be done through the search box can be done by manually entering a URL </li></ul><ul><li>The only required parameter is q (query) </li></ul><ul><li> foo </li></ul><ul><li>String together parameters with & </li></ul><ul><li> foo &hl= en </li></ul><ul><li>(Specifies query on foo and language of English) </li></ul>
  17. 17. Some advanced operators <ul><li>intitle - search text within the title of a page </li></ul><ul><ul><li>URL: as_occt=title </li></ul></ul><ul><li>inurl - search text within a given URL. Alows you to search for specific directories or folders </li></ul><ul><ul><li>URL: as_occt=url </li></ul></ul><ul><li>filetype - search for pages with a particular file extension </li></ul><ul><ul><li>URL: as_ft=i&as_filetype=<some file extension> </li></ul></ul><ul><li>site - search only within the specified sites. Must be valid top-level domain name </li></ul><ul><ul><li>URL: as_dt=i&as_sitesearch=<some domain> </li></ul></ul>
  18. 18. Some advanced operators <ul><li>link - search for pages that link to other pages. Must be correct URL syntax; if invalid link syntax provided, Google treats it like a phrase search </li></ul><ul><ul><li>URL: as_lq </li></ul></ul><ul><li>daterange - search for pages published within a certain date range. Uses Julian dates or 3 mo, 6 mo, yr. </li></ul><ul><ul><li>As_qdr=m6 (searches past six months) </li></ul></ul><ul><li>numrange - search for numbers within a range from low-high. e.g., numrange:99-101 will find 100. Alternatively, use 99..101 </li></ul><ul><ul><li>URL: as_nlo=<low num>&as_nhi=<high num> </li></ul></ul><ul><ul><ul><li>Note Google ignores $ and , (makes searching easier) </li></ul></ul></ul>
  19. 19. Advanced operators <ul><li>cache - use Google's cached link of the results page. Passing invalid URL as parameter to cache will submit query as phrase search. </li></ul><ul><ul><li>URL: </li></ul></ul><ul><li>info - shows summary information for a site and provides links to other Google searches that might pertain to the site. Same as supplying URL as a search query. </li></ul><ul><li>related - shows sites Google thinks are similar. </li></ul><ul><ul><li>URL: as_rq </li></ul></ul>
  20. 20. Google groups operators <ul><li>author - find a Usenet author </li></ul><ul><li>group - find a Usenet group </li></ul><ul><li>msgid - find a Usenet message ID </li></ul><ul><li>insubject - find a Usenet subject lines (similar to intitle:) </li></ul><ul><li>These are useful for finding people, NNTP servers, etc. </li></ul>
  21. 21. Hacking Google <ul><li>Try to explore how commands work together </li></ul><ul><li>Try to find out why stuff works the way it does </li></ul><ul><li>E.g., why does the following return > 0 hits? </li></ul><ul><li>(filetype:pdf | filetype:xls) -inurl:pdf -inurl:xls </li></ul>
  22. 22. Surfing anonymously <ul><li>People who want to surf anonymously usually use a Web proxy </li></ul><ul><li>Go to and find a willing, open proxy; then change browser configs </li></ul><ul><li>E.g., proxy to (Poland) </li></ul><ul><ul><li>Check it via:,net </li></ul></ul><ul><ul><li>Resets Google search page to Polish </li></ul></ul>
  23. 23. Google searches for proxies <ul><li>inurl:&quot;nph-proxy.cgi&quot; &quot;Start browsing through this CGI-based proxy“ </li></ul><ul><ul><li>E.g., </li></ul></ul><ul><li>&quot;this proxy is working fine!&quot; &quot;enter *&quot; &quot;URL***&quot; * visit </li></ul><ul><ul><li>E.g., </li></ul></ul>
  24. 24. Caching anonymously <ul><li>Caching is a good way to see Web content without leaving an entry in their log, right? </li></ul><ul><li>Not necessarily—Google still tries to download images, which creates a connection from you to the server. </li></ul><ul><li>The “cached text only” will allow you to see the page (sans images) anonymously </li></ul><ul><li>Get there by copying the URL from Google cache and appending &strip=1 to the end. </li></ul>
  25. 25. Using Google as a proxy <ul><li>Use Google as a transparent proxy server via its translation service </li></ul><ul><li>Translate English to English: </li></ul><ul><li> </li></ul><ul><li>Doh! It’s a transparent proxy—Web server can still see your IP address. Oh well. </li></ul>
  26. 26. Finding Web server versions <ul><li>It might be useful to get info on server types and versions </li></ul><ul><li>E.g., “Microsoft-IIS/6.0” intitle:index.of </li></ul><ul><li>E.g., “Apache/2.0.52 server at” intitle:index.of </li></ul><ul><li>E.g., intitle:Test.Page.for.Apache it.worked! </li></ul><ul><ul><li>Returns list of sites running Apache 1.2.6 with a default home page. </li></ul></ul>
  27. 27. Traversing directories <ul><li>Look for Index directories </li></ul><ul><ul><li>Intitle:index.of inurl:”/admin/*” </li></ul></ul><ul><li>Or, Try incremental substitution of URLs (a.k.a. “fuzzing”) </li></ul><ul><ul><li>/docs/bulletin/1.xls could be modified to /docs/bulletin/2.xls even if Google didn’t return that file in its search </li></ul></ul>
  28. 28. Finding PHP source <ul><li>PHP script executes on the server and presents HTML to your browser. You can’t do a “View Source” and see the script. </li></ul><ul><li>However, Web servers aren’t too sure what to do with foo .php.bak file. They treat it as text. </li></ul><ul><li>Search for backup copies of Web files: </li></ul><ul><ul><li>inurl:backup intitle:index.of inurl:admin php </li></ul></ul>
  29. 29. Recon: finding stuff about people <ul><li>Intranets </li></ul><ul><ul><li>inurl:intranet intitle:human resources </li></ul></ul><ul><ul><li>inurl:intranet intitle:employee login </li></ul></ul><ul><li>Help desks </li></ul><ul><ul><li>inurl:intranet help.desk | helpdesk </li></ul></ul><ul><li>Email on the Web </li></ul><ul><ul><li>filetype:mbx intext:Subject </li></ul></ul><ul><ul><li>filetype:pst inurl:pst (inbox | contacts) </li></ul></ul>
  30. 30. Recon: Finding stuff about people <ul><li>Windows registry files on the Web! </li></ul><ul><ul><li>filetype:reg reg +intext:|internet account manager“ </li></ul></ul><ul><li>A million other ways: </li></ul><ul><ul><li>filetype:xls inurl:”email.xls” </li></ul></ul><ul><ul><li>inurl:email filetype:mdb </li></ul></ul><ul><ul><li>(filetype:mail | filetype:eml | filetype:pst | filetype:mbx) intext:password|subject </li></ul></ul><ul><ul><li>… </li></ul></ul>
  31. 31. Recon: Finding stuff about people <ul><li>Full emails </li></ul><ul><ul><li>filetype:eml eml +intext:&quot;Subject&quot; +intext:&quot;From&quot; 2005 </li></ul></ul><ul><li>Buddy lists </li></ul><ul><ul><li>filetype:blt buddylist </li></ul></ul><ul><li>Résumés </li></ul><ul><ul><li>&quot;phone * * *&quot; &quot;address *&quot; &quot;e-mail&quot; intitle:&quot;curriculum vitae“ </li></ul></ul><ul><ul><ul><li>Including SSN’s? Yes…  </li></ul></ul></ul>
  32. 32. Recon: Finding stuff about people
  33. 33. Site crawling <ul><li>All domain names, different ways </li></ul><ul><ul><li> returns 10 thousand pages </li></ul></ul><ul><ul><li> returns 2.8 million pages </li></ul></ul><ul><ul><li> returns 2.9 million pages </li></ul></ul><ul><ul><li> returns nada </li></ul></ul>
  34. 34. Scraping domain names with shell script <ul><li>trIpl3-H> </li></ul><ul><li>trIpl3-H> lynx –dump &quot;; > sites.txt </li></ul><ul><li>trIpl3-H> </li></ul><ul><li>trIpl3-H> sed -n 's/. http://[[:alpha:]]* /p' sitejunk.txt >> sites.out </li></ul><ul><li>trIpl3-H> </li></ul><ul><li>trIpl3-H> </li></ul><ul><li>trIpl3-H> </li></ul>
  35. 35. Scraping domain names with shell script <ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul>
  36. 36. Using Google API <ul><li>Check out </li></ul><ul><li>Google allows up to 1000 API queries per day. </li></ul><ul><li>Cool Perl script for scraping domain names at </li></ul><ul><ul><li>By using combos of site, web, link, about , etc. it kind find a lot more than previous example </li></ul></ul><ul><li>Perl scripts for “ Bi -Directional L ink E xtractor (BiLE)” and “BiLE Weight” also available. </li></ul><ul><ul><li>BiLE grabs links to sites using Google link query </li></ul></ul><ul><ul><li>BiLE weight calculates relevance of links </li></ul></ul>
  37. 37. Remote anonymous scanning with NQT <ul><li>Google query: filetype:php inurl:nqt intext:&quot;Network Query Tool“ </li></ul><ul><li>Network Query Tool allows: </li></ul><ul><ul><li>Resolve/Reverse Lookup </li></ul></ul><ul><ul><li>Get DNS Records </li></ul></ul><ul><ul><li>Whois </li></ul></ul><ul><ul><li>Check port </li></ul></ul><ul><ul><li>Ping host </li></ul></ul><ul><ul><li>Traceroute </li></ul></ul><ul><li>NQT form also accepts input from XSS, but it is still unpatched at this point! </li></ul><ul><li>Using a proxy, perform anonymous scan via the Web </li></ul><ul><li>Even worse, attacker can scan the internal hosts of networks hosting NQT </li></ul>
  38. 38. Other portscanning <ul><li>Find PHP port scanner: </li></ul><ul><ul><li>inurl:portscan.php &quot;from Port&quot;|&quot;Port Range«  </li></ul></ul><ul><li>Find server status tool: </li></ul><ul><ul><li>&quot;server status&quot; &quot;enter domain below&quot; </li></ul></ul>
  39. 39. Other portscanning
  40. 40. Finding network reports <ul><li>Find Looking Glass router info </li></ul><ul><ul><li>&quot;Looking Glass&quot; (inurl:&quot;lg/&quot; | inurl:lookingglass) </li></ul></ul><ul><li>Find Visio network drawings </li></ul><ul><ul><li>Filetype:vsd vsd network </li></ul></ul><ul><li>Find CGI bin server info: </li></ul><ul><ul><li>Inurl:fcgi-bin/echo </li></ul></ul>
  41. 41. Finding network reports
  42. 42. Default pages <ul><li>You’ve got to be kidding! </li></ul><ul><ul><li>– intitle:&quot;OfficeConnect Wireless 11g Access Point&quot; &quot;Checking your browser&quot; </li></ul></ul>
  43. 43. Finding exploit code <ul><li>Find latest and greatest: </li></ul><ul><ul><li>intitle:&quot;index of (hack |sploit | exploit | 0day)&quot; modified 2005 </li></ul></ul><ul><ul><li>Google says it can’t add date modifier, but I can do it manually with as_qdr=m3 </li></ul></ul><ul><li>Another way: </li></ul><ul><ul><li>“ #include <stdio.h>” “Usage” exploit </li></ul></ul>
  44. 44. Finding vulnerable targets <ul><li>Read up on exploits in Bugtraq. They usually tell version number of vulernable product. </li></ul><ul><li>Then, use Google to search for for “powered by” </li></ul><ul><ul><li>E.g., “Powered by CubeCart 2.0.1” </li></ul></ul><ul><ul><li>E.g. “Powered by CuteNews v1.3.1” </li></ul></ul><ul><ul><li>Etc. </li></ul></ul>
  45. 45. Webcams <ul><li>Blogs and message forums buzzed this week with the discovery that a pair of simple Google searches permits access to well over 1,000 unprotected surveillance cameras around the world -- apparently without their owners' knowledge. </li></ul><ul><ul><li>SecurityFocus, Jan. 7, 2005 </li></ul></ul>
  46. 46. Webcams <ul><li>Thousands of webcams used for surveillance: </li></ul><ul><ul><li>inurl:&quot;ViewerFrame?Mode=&quot; </li></ul></ul><ul><ul><li>inurl:&quot;MultiCameraFrame?Mode=&quot; </li></ul></ul><ul><ul><li>inurl:&quot;view/index.shtml&quot; </li></ul></ul><ul><ul><li>inurl:&quot;axis-cgi/mjpg&quot; </li></ul></ul><ul><ul><li>intitle:&quot;toshiba network camera - User Login&quot; </li></ul></ul><ul><ul><li>intitle:&quot;NetCam Live Image&quot; </li></ul></ul><ul><ul><li>camera linksys inurl:main.cgi </li></ul></ul>
  47. 47. More junk <ul><li>Open mail relays (spam, anyone?) </li></ul><ul><ul><li>inurl:xccdonts.asp </li></ul></ul><ul><li>Finger </li></ul><ul><ul><li>inurl:/cgi-bin/finger? &quot;In real life“ </li></ul></ul><ul><li>Passwords </li></ul><ul><ul><li>!Host=*.* intext:enc_UserPassword=* ext:pcf </li></ul></ul><ul><ul><li>&quot;AutoCreate=TRUE password=*“ </li></ul></ul><ul><ul><li>… </li></ul></ul>
  48. 48. So much to search, so little time… <ul><li>Check out the Google Hacking Database (GHDB): </li></ul>
  49. 49. OK, one more… <ul><li>Search on “Homeseer web control” </li></ul>
  50. 50. How not to be a Google “victim” <ul><li>Consider removing your site from Google’s index. </li></ul><ul><ul><li>“ Please have the webmaster for the page in question contact us with proof that he/she is indeed the webmaster. This proof must be in the form of a root level page on the site in question, requesting removal from Google. Once we receive the URL that corresponds with this root level page, we will remove the offending page from our index.” </li></ul></ul><ul><li>To remove individual pages from Google’s index </li></ul><ul><ul><li>See </li></ul></ul>
  51. 51. How not to be a Google “victim” <ul><li>Use a robots.txt file </li></ul><ul><ul><li>Web crawlers are supposed to follow the robots exclusion standard specified at </li></ul></ul><ul><li>The quick way to prevent search robots crawling your site is put these two lines into the /robots.txt file on your Web server: </li></ul><ul><ul><li>User-agent: * </li></ul></ul><ul><ul><li>Disallow: / </li></ul></ul>
  52. 52. Questions