Slashdot Mirror


Googling Your Way Into Hacking

knifee writes "New scientist is running an article explaining how hackers can use Google's cache to quickly hunt down sensitive pages, for example, by searching the terms "bash history", "temporary" and "password". Might be worth looking at this tutorial about robots.txt if you think you might be at risk." That's pretty amusing.

38 of 431 comments (clear)

  1. This happens because of dumb admins, not google by mjmalone · · Score: 5, Insightful

    For example, one common filename for passwords is "bash history".

    This guy is a security consultant? Come on, what admin in their right mind would enter a password in cleartext on the command line and allow it to be stored in ~/.bash_history? The first thing I do when I log onto a box is link bash_history to /dev/null, just out of habit. The security problem isn't google's fault, it is stupid admin's who don't know what they are doing.

    1. Re:This happens because of dumb admins, not google by numbski · · Score: 5, Funny

      Wouldn't it be more fun to ln -s ~/.bash_history /dev/random instead?

      Would make for interesting google logs. ;)

      Don't have to worry about that particular problem. Both FreeBSD and MacOS X use tcsh by default anyway, and all of my users are Unix stupid, so they never log into shell.

      --

      Karma: Chameleon (mostly due to the fact that you come and go).

    2. Re:This happens because of dumb admins, not google by Bigby · · Score: 5, Funny

      Even better yet, "rm ~/.bash_history && ln -s /dev/dsp ~/.bash_history". Now everything you type will literally "sound like crap".

    3. Re:This happens because of dumb admins, not google by gooru · · Score: 5, Insightful

      It's not even just ~/.bash_history but ~/ itself! Who in the world would make that world-readable and published on the web?!?!? This isn't even the default for any configuration I've seen. (Does anyone else know differently?) It's one thing to spider ~/public_html or /var/www or whatever you have set up for your webserver...quite another to have ~/ published on the web. I can't believe this is a security problem for people, though I suppose it is a proven possibility.

    4. Re:This happens because of dumb admins, not google by dan14807 · · Score: 5, Informative

      > The first thing I do when I log onto a box is link > bash_history to /dev/null

      unset HISTFILE

    5. Re:This happens because of dumb admins, not google by Zigg · · Score: 4, Funny

      Except that it doesn't work, unless you intended to try to execute /dev/audio.

    6. Re:This happens because of dumb admins, not google by Anonymous Coward · · Score: 5, Funny

      OHMYGOD!! TEH SECURITY RAMIFICATIONS!!1!
      http://custom.lab.unb.br/pub/dc e/.bash_history
      pwd
      ls -l
      ls -l
      ls -la
      whoami

      http://www.mhhe.com/socscience/.bash_history
      vi test1
      ls -l
      who am i
      touch test2
      ls -l
      pwd
      cd ../business/
      ls -l
      vi randomfile
      ls
      ls -l
      cd marketing
      ls -l
      pwd

    7. Re:This happens because of dumb admins, not google by inertia187 · · Score: 5, Interesting
      It's happened to me. My .bash_history has contained passwords. Why? Because I'd type too fast and not look at the screen. For example:
      bash-2.05a$ ssh inertia@whatevre
      ssh: whatevre: no address associated with hostname.
      bash-2.05a$ f33lokihum
      Oops.
      --
      A programmer is a machine for converting coffee into code.
    8. Re:This happens because of dumb admins, not google by Bigbutt · · Score: 4, Funny

      Well, we had a stupid admin who, as a test put the /etc/passwd file into webspace.

      We had another admin who tried to su to root and typed in su [root password]. We check the logs searching for someone typing in a non-user account that looks like garbage and we notify the admin to change their password.

      --
      Shit better not happen!
    9. Re:This happens because of dumb admins, not google by SeanAhern · · Score: 4, Informative

      ln -s ~/.bash_history /dev/random

      Whoops!

      You meant: ln -s /dev/random ~/.bash_history

  2. Google Cache, in case of slashdotting by Anonymous Coward · · Score: 5, Funny
    1. Re:Google Cache, in case of slashdotting by vgaphil · · Score: 4, Funny

      Or go here google

      --
      A clever person solves a problem. A wise person avoids it. -- Einstein
    2. Re:Google Cache, in case of slashdotting by Scott+Hale · · Score: 5, Funny
      Google is not affiliated with the authors of this page nor responsible for its content.

      Now I'm really confused.

    3. Re:Google Cache, in case of slashdotting by SlayerofGods · · Score: 4, Funny

      That is really cool, the whole site is done in it. Someone try to read this and not have your head explode.

      --

      Technology, the cause of and solution to all of life's problems.
    4. Re:Google Cache, in case of slashdotting by joynt · · Score: 4, Funny

      The sad thing is I can read it.

  3. RIAA Logic: by connsmythe96 · · Score: 5, Funny

    Google can be used to illegaly hack into computers (possibly stealing copyrighted information). Google must be shut down and all of its users owe us lots of money.

    --
    if(!cool) exit(-1);
  4. Yea by mao+che+minh · · Score: 4, Funny
    Must be how that guy found out that my phpnuke code had a mySQL injection flaw in the news module. My article about a Hulk doll with big penis wasn't exactly fine journalism, but I would imagine that it was better then 40 lines of "hacked by Stacey 100% brasil LOL" that it was overwritten with.

    Damn script kiddies.

  5. problem with robots.txt tutorial by brlewis · · Score: 5, Interesting

    They should mention that disallowing a URI in robots.txt tells crackers which URIs on your site have sensitive information. What I do is create a top-level /unpub/ URI, and everything sensitive goes underneath it with hard-to-guess names. In robots.txt I disallow /unpub only.

    1. Re:problem with robots.txt tutorial by PetoskeyGuy · · Score: 4, Insightful

      I hope you at least have an .htaccess on the files to put a password on that directory. Hard-to-guess names is good, but making them password protected is better.

      Of course on some of the cheaper web hosting companies out there you can just search the /home/*/web folders. They have to be public so the web server can read them. Stupid I know, but all to common. Config.php for most apps will have all the users passwords in plaintext.

      The HTTPD user should be a member of each users group so you don't have to set world rights to your files. Assuming it's just hosting and no other rights are required.

  6. robots.txt? by Karma+Sucks · · Score: 4, Interesting

    You're kidding right? Putting stuff in robots.txt is the best way to *guarantee* that robots will go specifically for the file/directories you choose to deny.

    Don't be naive about robots.txt... expect to have to do some relatively fancy hacking to actually enforce it.

    --
    (Please browse at -1 to read this comment.)
  7. robots.txt by panaceaa · · Score: 5, Interesting

    Robots.txt only makes well-behaved search engines not index certain portions of your site. You're still going to be vulnerable until you take the sensitive pages off-line completely. But even then, if a passwords list has been indexed by Google, updating your robots.txt file won't remove it from Google's cache until Google spiders your site again. At which time, Google will discover the passwords list doesn't exist and remove it from the cache.

    At least that's how it should work. Is anyone aware of Google requesting robots.txt more often than they spider pages? And then proactively removing pages from their cache based on new robots.txt entries?

    While the article deals with Google specifically, lots of non-well-behaved spiders go through common locations looking for password files regardless of what you've blocked out with robots.txt. The only way to completely protect your data is to remove it from your site.

    1. Re:robots.txt by Jugalator · · Score: 4, Funny

      ROFL -- It's also amusing when the admins don't understand what the file is for!

      Look at IBM:

      http://www.ibm.com/robots.txt

      First comment:

      Date: 19950130
      By: epc
      Reason: finally understood what the file was for!

      At least the admin was honest, but a bit embarrasing for being on ibm.com. :-P

      --
      Beware: In C++, your friends can see your privates!
    2. Re:robots.txt by frodo+from+middle+ea · · Score: 5, Interesting
      Check out Sun's robots.txt

      Part i like best

      # If you do actually go to the trouble of figuring out how to download # the files without registering, what you'll end up with is 1 or 2MB of # stuff that is meaningless to you unless you have purchased an # Ultra AX board from Sun. So, please do purchase an Ultra AX board, # but then you might as well use the URL you'll be given along with it.

      --
      for the last time people, I am "frodo from middle eaRTH", not "middle eaST".
  8. robots.txt by zero-one · · Score: 4, Interesting

    Having a robots.txt is a good idea but it always amuses me when web sites use robots.txt to list all the areas of their site that they don't what people to look at. When robots.txt contains entries like "Disallow: /admin.asp" or "Disallow: /backdoor.asp" it stops being a way of controlling search engines and becomes a site map of all the places hackers might be interested in.

  9. ICQ by bazik · · Score: 5, Interesting

    A friend of mine actually used this to steal ICQ numbers. He wrote a perl script wich googles from "00000001.idx 00000001.dat" to "99999999.idx 99999999.dat" and spits out the result links to a textfile if it gets a full match.

    The ICQ password is stored in one of those two datafiles and there are dozend of free decrypt programms for that out there.

    But if you think about it... how or why does someone put his ICQ directory on a webserver?!

    On the other hand... some people are hosting pr0n sites and dont even know about it ;)

    --


    --
    One by one the penguins steal my sanity...
  10. Forgotten by orange_6 · · Score: 4, Funny

    So if I forgot my password, google can just tell me what it is? Can it tell me my credit card number too?

  11. My favorite... by inertia187 · · Score: 5, Informative
    My favorite Google search phrase is:
    "Index of" "Name Last modified Size Description"
    Then you add file extensions or other things. For example:Anyway, as you can see, it's pretty effective. Sometimes admins wise up, and all you have is the Google cache. But sometimes they don't, and you get to look. Thanks Google!
    --
    A programmer is a machine for converting coffee into code.
  12. Scuse me? by arth1 · · Score: 5, Insightful

    Shouldn't that be bash_history, passwd and tmp?
    Was this written down by a non-techie from an audio interview?

    Regards,
    --
    *Art

  13. Wrong use of robots.txt by vadim_t · · Score: 5, Insightful

    It's supposed to be used to tell bots not to access some parts of your site due to other reasons.

    Common reasons would be that you host a site with a forum on a DSL line and don't want google to index all 5000 threads on it. It's also good for dynamic pages, for example it makes no sense to index a generated page that will be out of date tomorrow. It'll be much better to let it index the archive instead.

    Using this for security is just stupid though, as it'd contain a list of vulnerable places. Maybe it will make harder for people to find your vulnerabilities from google, but it will help a lot whoever wants to attack you specifically.

    Security problems have to be fixed by setting proper permissions and keeping your server up to date, and not by relying on that every spider that comes to your site will be polite enough to follow robots.txt

  14. phpmyadmin same thing by joeldg · · Score: 4, Interesting

    I have seen more phpmyadmin pages wide open on google that anything else.. Not putting things like that under htaccess at least is pure laziness and stupidity.

    Also it seems people put mysql dumps on their webservers as well..
    search for ' "SELECT * FROM credit" + "###" ' and you will see.

    This has been going on since google introduced the site cache.

  15. some guide! by mblase · · Score: 4, Funny

    Long says an obvious combination of search terms would include the terms "bash history", "temporary" and "password".

    Hmph. When I searched for those phrases at Google, all I got were a bunch of Linux technical how-tos and code samples. If this guy wants to teach us how to be hackers using Google, he's going to have to be more helpful than that!

  16. Google Warez Machine by dhodell · · Score: 5, Interesting

    I regarding the ability to use Google as a warez search machine. The article was about Google censorship and the one response to my post pinpointed almost exactly the point that I brought up, which is the point discussed in this article.

    Google has a nice long list of directory lists containing warez (remember the days of l33t FTP searching for filenames? Google for something like, in my last article: "xwin32*.exe * * * * *" "listing of"), serial numbers (Oh, I've found XP's serial number several times in Google's cache) and other "sensitive" information. My question is if other commercial sites are being constantly shut down due to these links (intentional or not), why aren't people targeting Google as well?

    In fact, if I'm *cough*too cheap to buy software*cough* or just want to evaluate some crippleware or such before I buy it, I often skip astalavista and cracks.am and just Google it up. Saves me the porn and pop ups, and I don't have to cripple my browser for this (yes I know it's possible to do in other ways, yes I enjoy javascript, no thanks, I don't want comments about how I'm retarded because I don't do it the right way).

    This is similar for sites such as the Internet Archive's Wayback Machine that contains other sensitive information.

    Because of the academic merit of both of these search mechanisms, I doubt either one will be shut down. Indeed, I highly doubt restrictions will be placed. They're valuable tools for finding more valuable tools. For more information about this sort of stuff, I suggest searching on Fravia+'s web-searching lore. Other information on there relates to "reality cracking", reverse engineering, and other taboo topics. Google's got it all cached. Interested? Just search for (insert topic here) site:searchlores.org.

    Sometimes I don't think the comparison of Google to God is that far off. Pardon my heresy.

    --
    Kind regards, Devon H. O'Dell
  17. Google file searching.... by Rahga · · Score: 4, Interesting

    I honestly know of nobody else who uses this technique, I just figured I would try it back when I was hunting down upgrades for old games like Quake 2 while places like FilePlanet were getting hammered:

    At google, type "index of", followed by the precise name of the file you are looking for.

    I'd say this gives me good results on a fast server 95% of the time.

  18. Re:It's a little harder... by Elminst · · Score: 4, Insightful

    But the third link down gives us this-
    http://216.239.57.104/search?q=cache:p5ouM3 2marEJ: www.necmitsubishi.com/markets-solutions/government /necfiles/Chicago911.doc+%22do+not+distribute%22+p assword&hl=en&ie=UTF-8

    Which at the bottom of the document has-

    Editors Note:
    Product photography is available at http://www.liska.com/necmit.
    Username: necmit
    Password: monitors


    Which seems to prove the point of the search...

    --
    No unauthorized use. Trespassers will be shot. Survivors will be shot again.
  19. Doesn't work by lawpoop · · Score: 5, Funny
    I tried "bash history", "password", and "temporary", hit "I feel lucky" and I didn't get to hack anything.

    I guess I don't have the patience to be a real hacker.

    --
    Computers are useless. They can only give you answers.
    -- Pablo Picasso
  20. SCO Logic: by KillerHamster · · Score: 4, Funny

    Google uses operating systems! All your code are belong to us! Google must be shut down and all of its users owe us lots of money.

  21. Not always dumb... depends on what's there by jd · · Score: 5, Interesting
    #include "IANAL.h"


    You can probably use this to set up "honeypots" which may be legal in States where traditional fake services would be considered illegal as entrapment.


    Simply set up a virtual machine (user-mode linux is a good one for this). Have the root account publicly read/write and somehow "accidently" visible to httpd.


    Have the login shell a program which acts as your honeypot, logging activity, tracing back to the user, etc. All the stuff honeypots do so well.


    Next is to ensure that the root password is visible, plain-text, and in a file that is visible to search engines. Your average skript kiddie is not going to question the apparent generosity of the admin. To get the engine to find the account, you probably want to have your main web page link into your virtual machine's root account - say via an FTP.


    Now, none of this is entrapment, in the sense that the person must pro-actively attempt to present a false identity before the service is accessed. There can be no question that the identity of any user logging in is fake, that the user logging in knows that it is fake, and that there has been a deliberate, pre-meditated attempt to compromise an account.


    If you want to go one step further, have the login shell transfer some goodies, such as cpuburn. Now, these have to have a "legit" use by a "legit" user, as anyone who gets burned is likely to complain. You have to be able to stand your ground and say "hey, I use this service as a convenient way to do hardware tests on remote machines - I locked that account against intruders, so if an intruder gets in, it's not my fault if they get burned."


    (If you leave something dangerous "just lying around", you could probably be held accountable if someone gets hurt, even if they were stupid or malicious. But if you make a "reasonable" attempt to deny access, then it's not your problem.)


    In fact, if you do any freelance tech stuff, you might very well use the service for real as a way of fetching over stress-testing software. It would make it a lot harder for "victims" of your root snare to complain, as you could then prove a legitamate use by legitamate users - the victim not being one of them.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  22. Re:Entrapment by fizbin · · Score: 4, Interesting

    Probably not, but his statement of the situation squares with my experience when I talked to an FBI agent after having discovered (and logged) some IRC kiddies who were constructing a DDOS network out of sub7-infected machines.

    I'd created a sub7 honeypot on my linux box with a little perl script; after that collected the IRC server ip and channel name, I connected with a random username (pretending to be a bot) and just logged the conversation.

    The FBI agent interviewed me very carefully to make certain that my setting up monitoring, etc., was not in any way instigated by a law enforcement officer. (No, I'd just gotten annoyed at random SYN packets) Then, he had no trouble with it. I don't know if this makes the evidence I provided useable legally, but it never came to that. As he explained it, the question was whether I was acting as an agent of the state when setting up the honeypot. Committing entrapment is not anything that non-state actors ever need worry about.

    Not that this lets you off the hook entirely - there may be charges of wiretapping involved; monitoring your own machine should be safe legal ground, but connecting to the IRC network (as I did) is a slight bit more dicey legally, and shouldn't be done if you have any reason to believe that the relevant prosecutor would like to hang something on you as well.