Why everybody on this planet should use pwdhash (or something similar)
Saturday, 9. April 2011 10:38 | Author:Max Amanshauser
Today I received a weird email. Its contents are:
Return-Path: <www-data AT ba-computer.at>
X-Original-To: <<ME>>
Delivered-To: <<ME>>
Received: by mail.lambdalifting.org (Postfix, from userid 65534) id 89B9891D5; Sat, 9 Apr 2011 03:33:55 +0200 (CEST)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on coroutine.lambdalifting.org
X-Spam-Level:
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable version=3.3.1
Received: from www.ba-computer.at (www1.ba-computer.at [85.125.193.130]) by mail.lambdalifting.org (Postfix) with ESMTP id 37E8291D1 for <<ME>>; Sat, 9 Apr 2011 03:33:55 +0200 (CEST)
Received: by www.ba-computer.at (Postfix, from userid 33) id 84FB54FA82CF; Sat, 9 Apr 2011 03:33:54 +0200 (CEST)
To: <<ME>>
Subject: Your deposit temporarily blocked #5633 M. Max.
X-PHP-Originating-Script: 1002:cookie_usage.php(4) : eval()’d code(1) : eval()’d code
Content-type: text/plain
From: BA-Computer Shop <shop AT ba-computer.at>
Message-Id: <20110409013354.84FB54FA82CF@www.ba-computer.at>
Date: Sat, 9 Apr 2011 03:33:54 +0200 (CEST)Your deposit being temporarily blocked until the verification is complete.
This is for security reasons, to help protect against card fraud, but can be inconvenient.
All credits cards used must be in the casino account holders name, and not be lined in any way to a business.More detailed information is available by reviewing the URLs listed in http://inforeseau.net/details/ .
BA-Computer
First thing I did was of course clicking the link (these are the enjoyable things about using a browser/OS combination no malware author could possibly care about). I ended up at www.google.at. I had no idea what this meant and was literally unable to do anything about it, because it was six o’clock in the morning and I just woke up. Three coffees later I’m back to life and start taking a look at it.
This header is what gives away what’s happening:
X-PHP-Originating-Script: 1002:cookie_usage.php(4) : eval()’d code(1) : eval()’d code
If you google for it, you will find many people complaining about PHP’s verboseness here, because this header tells you which script invoked sending the email. In this case though it was very helpful, because the filename cookie_usage.php indicates an OS Commerce installation. If the filename didn’t make it obvious enough that this is not an intentional email from the shop owner, googling for it will bring up a nice exploit description. As stated there, www.yoursite.com/cookie_usage.php?cookies=1 is kind of a status page for the attacker to tell whether the installation is already infected or not. And yep, sure enough http://www.ba-computer.at/cookie_usage.php?cookies=1 shows me the signature of an infection according to the exploit description:
Goog1e_analist_certs
v..1
http://inforeseau.net/details/ really is nothing but a HTTP 302 redirect to www.google.com. No malware or ads there. Either the attacker launched his spam emails too soon, before he could set up his scam/ads/malware (unlikely), or the HTTP redirect was implemented as a quick bandaid by the hoster in reaction to the spam campaign (a bit odd, but OK), or the attacker really just wants to see you connect to his server, record your IP etc. and then send you to google (mind-bogglingly unlikely!). So I’ll settle for the second explanation.
What does all this drivel have to do with pwdhash?
Since the attacker was able to inject his own code into the web application, we have to assume he was able to steal the database the web shop is connected to. This means he’s got my name, address, username, password, etc. There’s not much I can do about the first three items. There is something the website administrator can do about the fourth: Hashing of passwords, and every administrator in his right mind will do just that. Users are lazy, most of them will have one set of username/password, MAYBE two, for all websites they use. Hashing will prevent an attacker from just trying the username/password combination he stole on a large number of websites and get lucky, because he would need to get the unhashed password for that, which is exactly what should be infeasible when using a secure hash function.
There is a downside: Hashing depends on the website administrator’s willingness to do it. There are two reasons he would not do it: Criminal intent to abuse your login information and carelessness. If you think this is rare and could only apply to shady back alley websites, think again: geizhals.at, Austria’s sixth largest website, does not hash your password and stores it plaintext in the database. Maybe go there right now and change your password
. (There is a third, very rare reason why your password is stored unhashed and that is if the purpose of the website is to somehow process your login info on other sites, but even then the password should NOT just be stored plain-text and instead should be stored encrypted and only be decrypted by a separate entity when needed.)
It is very hard to tell accurately whether a website’s owner is criminal or incompetent beforehand, so there is only one thing you can do: Hash your password yourself, before you submit it. This is exactly what pwdhash is doing. It takes your master password, combines it with the domain name of the web site you are on and computes a password by hashing. The domain name is incorporated in generating a hashed password, otherwise all generated passwords would be the same and you end up still having the problem of shared passwords. So, with the master password “foobar” the hashed password for lambdalifting.org would be HP6PbRxg, for heise.de it is M07mLlCO, etc.
There are extensions for all decent web browsers to generate your hashed password automatically. If you’re ever on a computer without the extension installed, you just go to https://www.pwdhash.com/, which hosts a javascript version of the extension. Your master password is never sent over the wire, everything is computed locally.
Remark: OS Commerce should do hashing appropriately, so this specific attack should have no significance either way. It is however comforting that an attacker can never gain a useful password, when you are using pwdhash.
Remark2: There is a plethora of password managers that do not generate a hashed password, but simply generate a random password for every site. The disadvantage is that you absolutely need to keep track of every single password. Typically this is achieved by storing all passwords in a local password database, which is itself encrypted with a master password. If you lose your password database, you lose access to the websites. The advantage is that if, due to some unfavorable circumstances, your master password is stolen, the attacker can not simply generate the passwords as with pwdhash and instead needs to steal the password database as well.
The only one I can recommend is 1passwd, and the reason is not that its security guarantees are any better than pwdhash’s, but instead because it integrates well across Apple devices. Your password database can be synced between your Mac, your iPhone, your iPad, etc. via dropbox, which is pretty comfortable.
Category:english, tech | Comments (4)












