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.

28 of 431 comments (clear)

  1. use deflection in mod_rewrite to keep crawlers out by stonebeat.org · · Score: 3, Informative

    It is always a good iea to kep the robots out of anywhere there is sensitive information. i several methods for added security. robot.txt is a good way, but i also the deflecction technique in apache's mod_rewrite to keep the crawlers out.

  2. 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.
  3. 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

  4. Re:/etc/passwd by arth1 · · Score: 2, Informative

    BZZT, wrong.
    * is a character not allowed in the encrypted 13-character A-Za-z0-9./ password, and as such the account can not be logged in to.
    x is used for shadow passwords.

    Anyhow, I think the original poster aimed for a +1 Funny, and not +1 Insightful. If there's any justice on /., you'll get neither.

    Regards,
    --
    *Art

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

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

    But uhh...from the tcsh manpage (emphasis mine)

    A login shell begins by executing commands from the system files /etc/csh.cshrc and etc/csh.login. It then executes commands from files in the user's home directory: first ~/.tcshrc (+) or, if ~/.tcshrc is not found, ~/.cshrc, then ~/.history (or the value of the histfile shell variable), then ~/.login, and finally ~/.cshdirs (or the value of the dirsfile shell variable) +). The shell may read /etc/csh.login before instead of after /etc/csh.cshrc, and ~/.login before instead of after ~/.tcshrc or ~/.cshrc and ~/.history, if so compiled; see the version shell variable. (+)


    Looks like tcsh has a history file as well, "if so compiled"? Just thought I'd point that out something you might wanna check into?

    also in your /etc/csh.cshrc or /etc/csh.login you *might* wanna just throw in something like the following shellcode:

    # just to make sure the user didn't delete the
    # symlink ...
    if ( -e ~/.history ) then
    rm -f ~/.history
    endif
    ;)

    ln -s ~/.bash_history /dev/null

  6. Big Brother Monitoring software by Anonymous Coward · · Score: 2, Informative

    Anyone familiar with Big Brother knows that it has web access pages that allow you to monitor servers on your network. Of course your suppose to keep these pages private, but lots of people dont. This makes it easy for us to determine what servers are running on a network, and what services are running on each server.

    Try searching google for: red Big Brother Status

    Enjoy ;)

  7. Re:Hacker, not cracker? by Anonymous Coward · · Score: 1, Informative

    Where I come from, a cracker is a crispy salty biscuit. Or a honkey.

  8. Re:robots.txt? by Anonymous Coward · · Score: 1, Informative

    Hey, you must be right! Go tell your friends and relatives. I'll be investing in the tin foil market.

    In the mean time, please note that ALL search engines ALWAYS obey the robots.txt file for a very good reason: it specifies which pages might be dynamic. Maybe your evil "working for The Man" search engine likes to return lists of 4500 ebay auctions which no longer exist, online quizzes filled out with all blanks' results, and other such amazingly useful information but real sites like google are not interested.

  9. Re:My favorite... Searchlores by sICE · · Score: 3, Informative

    If you like this kind of tricks you can find dozen tricks like those ones and betteron Fravia's web site SearchLores.

  10. Re:ICQ by Politburo · · Score: 2, Informative

    If you're lazy and wanted to transfer ICQ information between sites, you might just toss it up on some webspace you have, download it from where you wanted it, and then forget about it forever.

  11. damn it... by edrugtrader · · Score: 2, Informative

    if only slashdots search was as good as googles i could point out this is the third time in a year this "story" has been run.

    --
    MARIJUANA, SHROOMS, X: ONLINE?! - E
  12. A little bit OT by edmz · · Score: 3, Informative

    Not the same kind of "hacks", but more than one might have missed that O'Reilly published recently Google Hacks. Mostly targeted to webmasters or "power users".

  13. Hacking with Google 101 by Shivaji+Maharaj · · Score: 2, Informative
    --
    We do not have a history of profitable operations. Our future SCOsource licensing revenue is uncertain.
  14. 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

  15. Google Hacking Tutorial by hohokus · · Score: 3, Informative
    while randomly googling for "index of" and ".bash_history", i found this, which may be amusing:

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

  16. Re:This happens because of dumb admins, not google by jd · · Score: 2, Informative
    This would be a good way to set up a "slightly more legit" honeypot, in States or countries where "services for the sole purpose of entrapping people" is illegal.


    Set up a virtual machine (user-mode linux might be a good choice) and make sure the root password is in a whole bunch of files that skript kiddies are likely to google for, and in which the root account might reasonably be found (if the admin is stupid, that is).


    Set the login shell to an application which creates a fake shell, and which uses the opportunity to ID the intruder's computer and download a bunch of stress-testing tools. cpuburn might be a good one for this.


    The choice of downloads is important. You've got to be able to show a legit purpose for all of this, and one good purpose is to have a tool you can use to stress-test hardware on a remote machine. If you do freelance tech work, then being able to check the hardware on a machine is self-evidently a legit purpose.


    Once you can show a legit purpose (whether you use it or not), and you can show that you've made a reasonable effort to prevent non-legit users from stumbling into the account (ie: by setting a password), then I can't see any way a person can claim they were suckered in and entrapped.


    It takes a deliberate, concious act of will to perform a search on Google. It takes another deliberate, concious act of will to use that information to connect onto a remote computer. Since the account is not theirs, and they have no reason to believe otherwise, they are guilty of attempting to defraud the computer through identity theft, at the very least. There's no way it could be passed off as "accidently" stumbling onto a service, which could be a valid defence against traditional honeypots.


    Because there's a legit use for the services, and because the attacker has actively carried out an attack on your machine with malicious intent, it would be extremely hard for them to successfully sue you for any damage caused.


    It's not like placing a firecracker in a box marked "open this". It would be closer to placing a revolver in a locked cabinet, and a would-be thief accidently shooting themselves in the foot, after breaking into the cabinet.


    The first case, there's no obvious risk, so the person can claim they've not assumed responsibility for any such risk. Stupidity is not a crime.


    The second case is different. The person is actively performing actions they know to be illegal, and for purposes which can only be malicious. They've passed the point where they can claim they're just an innocent bystander.


    Likewise, a traditional honeypot - especially one that causes damage - might well be considered in the first category. A person may well accidently stumble on it, and then any damage is the responsibility of the person setting the trap. (Don't even think of telling me you've never mis-typed an IP address.)


    However, a dual-purpose service, behind a password-protected account, where the username of that account makes it self-evident that this is not a public area, cannot even remotely be placed in that category. The intruder cannot claim innocence or lack of awareness. As such, any damage they suffer is their problem. They've assumed the risks involved, knowingly of their own free will. At that point, if your utils turn their machine into scrap metal, it's not your problem.


    Note: Law-enforcement types are authorized to break into machines and plant all sorts of sniffers, etc, on them, without approval and without the machine or owner having to have anything to do with any investigation. It is not clear if frying their computers, even if it could be shown that it was self-inflicted and that the software was dual-use, would be considered acceptable.


    Because of this, the information above is hereby defined as being for academic interest only. If you choose to use the information, and Joe FBI gets burned, that is beween you and 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)
  17. Re:This happens because of dumb admins, not google by Anonymous Coward · · Score: 1, Informative

    Google Search: inurl:bash_history

  18. Re:robots.txt by UncleOlethros · · Score: 3, Informative
    According to my experience with my webservers, Google will request robots.txt frequently as it spiders a site. And yes, they do remove pages from their cache based not only because of new robots.txt entries but new META tags in individual pages.

    If you can't wait until the next time Google crawls your site to have your information removed, you can always use Google's Automatic URL Removal System. Details are available here.

    A few months back I updated all of my web pages to include the NOARCHIVE META tag. I then submitted my site to Google's Removal System and within three days Google had crawled everything and updated their database. The result was that my pages were still searchable, they just weren't cached.

    As you noted, though, there are plenty of robots that do not obey robots.txt. Google may be conscientious, but others are not.

  19. Re:Google file searching.... by darth_silliarse · · Score: 2, Informative

    I've also been searching Google this way for years, it's a good way of getting what you need without having your browser cache clogged with cookies...

    --
    I've noticed that everyone who is for abortion has already been born - Ronald Reagan
  20. Re:Oops by clary · · Score: 3, Informative

    Nope...doesn't pass the LUHN check. See LUHN Check.

    --

    "Rub her feet." -- L.L.

  21. Re:This happens because of dumb admins, not google by Anonymous Coward · · Score: 2, Informative
    It's not even just ~/.bash_history but ~/ itself!

    Do this at a shell;

    1. locate .bash_history

    Notice anything odd? It's entirely likely that .bash_history may end up outside a user's (or root's) home directory depending on where you are when you login to a new account.

    If you want to avoid that, try...

    1. su - USERNAME

    where USERNAME is the account name (or optionally nothing if root).

    The - will make sure that the environment settings will be the current default settings for that account. Login as root, change to another directory, change the environment settings, execute "su -", then check your environment and location. Change directories, and use "su" (no "-"), and see what happens. Exit from the shell a couple times. Nope, that little factoid isn't explicitly in the su man page.

  22. Re:This happens because of dumb admins, not google by klui · · Score: 2, Informative

    By default, your history files are only readable by you and is not group/world readable. Your shell actually sets this up--regardless of your umask--when it first creates the file so only a bozo who manually changes the modes deserves what they get as a consequence.

  23. Re:Entrapment by PenguiN42 · · Score: 3, Informative

    Also, entrapment is only illegal if the law officers used fraud or undue persuasion to cause someone to commit a crime -- so much so, that an ordinarily law-abiding person would be compelled to commit the crime.

    Cops can tempt criminals to commit crimes, and even initiate or plan out the criminal act (ie, buying or selling drugs, offering or buying prostitution, planning a bank robbery heist). None of this is entrapment, unless their actions would have cause a normally law-abiding person to commit the crime.

    If a cop tricks someone into unintenionally breaking the law, or harasses them so much that they eventually cave in and break the law, or threaten them, etc, it may be entrapment. It's actually pretty subjective and up to the jury, usually.

    But a lot of misconceptions of entrapment abount -- ie the ever-popular, "if you ask them if they're a cop, and they say no, then it's entrapment." And also the misconception that entrapment is a crime and can apply to non-law-enforcement. It's not a crime, it's a defense against being charged with a crime. (Well, unless you perform a crime while trying to get someone to perform a crime -- that's still a crime)

    For a somewhat inflammatory discussion, see this: http://www.libertyhaven.com/politicsandcurrenteven ts/nationalbudgetsdefecitsorspending/lawdeceit.htm l

    I had a more objective look at it, written by a lawyer, but I can't find it.

    sorry if this is off-topic.

    --
    The following sentence is true. The preceding sentence was false.
  24. Re:wow by sICE · · Score: 2, Informative

    Hehe, no he didnt disapeared at all. And i can tell you he's alive and kicking. Yet you may find his old data here on the AntiCrack website.

    One question: does WoW stands for Warriors of Wasteland?

  25. Re:This happens because of dumb admins, not google by Leto2 · · Score: 2, Informative

    Actually, I do not link bash_history to /dev/null.

    I've been compromised once, and the attacker went through great length to install a rootkit in /tmp/../foo , grep his IP out of the message logs, etc. etc. The only thing that he forgot to do was remove the bash_history file, and I knew _exactly_ what damage he had done to my system.

    --
    <grub> Reading /. at -1 is like driving through Cracktown in a convertible that is stuck in 1st
  26. Re:This happens because of dumb admins, not google by scottj · · Score: 2, Informative

    The simpler alternative is to just not produce a history file at all. In the .cshrc, add this line: unset history

    --
    .-.--
  27. Not just crackers, Anti-Spammers use this too by zgornz · · Score: 2, Informative

    http://www.theregister.co.uk/content/55/32103.html

    In short, the anti-spammers found a WSFTP.LOG and used it to find zips with email addresses.

    Funny to see this on the register so soon after this slashdot article