Reverse Engineering a Bank's Security Token
An anonymous reader writes "An engineer from Brazil has posted a technical walkthrough of how he was able to reverse engineer his bank's code-generating security token. He found a way to accurately generate his unlock codes with some custom code and an Arduino clone. (Don't worry: his method doesn't give him access to anybody else's codes.) 'Every exception thrown by this piece of code is obfuscated, as well as many of the strings used throughout the code. That is a major roadblock, since exception messages and strings in general are a great way of figuring out what the code is doing when reverse engineering something. Luckily, their developers decided to actually show useful text when a problem occurs and an exception gets thrown, so they wrapped those obfuscated strings with a.a, presumably a decryption routine that returns the original text. That routine is not too straightforward, but it is possible to get a high level understanding of what it is doing.'"
He found a way to accurately generate his unlock codes with some custom code and an Arduino clone.
By itself, this isn't a bad thing. But the fact that they've obscured the crap out of their code suggests to me this wasn't done by a crypto expert, but an insecure programmer forced by management to develop a solution in a field he didn't fully understand, and did it homebrew. The overwhelming, vast, pitifully large, number of attempts made by non-crypto experts to do this result in a house of cards when it comes to security.
There are standard, tested, and amply documented alternatives available. It's just criminal that this bank decided to elect some middle manager with no understanding of the technology and his lackies to impliment such a solution. I'm sure the bank official in question, who we'll call Sir Moron McMoneypants, thought that rolling their own would result in a more secure setup, because afterall... who's going to invest all that time to crack one bank's crypto when all the rest use the standard one?
This is security through obscurity at its worst, and the managers involved should all be rounded up and excommunicated to some remote part of the world where there is no internet, no computers, and no way for them to talk to the outside world and thus give anyone who has money in their pockets any bad advice.
#fuckbeta #iamslashdot #dicemustdie
Ugh. Amateurs! Generate error codes, not descriptive strings! Asshats! Security isn't supposed to reward someone for reverse engineering something. Layers, man. Layers of security!
Uhhh right, because that's so much use to the customer when their security token simply says "error -382".
It's not supposed to be useful for the consumer. If they are running into errors with authentication related processes they need to either get tech support or try again later.
Useful authentication error strings make breaking in a guessing game. You shouldn't even tell them that their password is wrong. "Login Failed!" is more than enough (never confirm they had the correct username but a bad password).
I'm not particularly concerned, so long as I'm not on the hook for any lost funds. It would be nice to know that our banking institutions were competent, but I'm happy so long as dispute resolutions aren't arduous.
Speaking of which, I've disputed charges on my credit card twice, and my credit card provider has made it quite painless. If my bank was that forgiving, I'd probably use my chequing account more than my credit account.
- Nec Impar Pluribus, or so I'm told.
Does this work on Chuck E Cheese tokens too? I need to feed my skee ball addiction.
Better known as 318230.
The code should not need to be hard to reverse engineer. Good cryptographic systems need the secret to be secret and nothing else. Obfuscation can be a layer, but more often it is used to hide shoddy algorithms.
That's security through obscurity, and it can often be extremely detrimental...
When a piece of code runs on a device the user controls, it's not a case of *if* it can be reverse engineered, but simply a case of how long it takes and wether anyone is sufficiently motivated.
So given that, what's more important is that the algorithm itself has no flaws, and the seed/key values it uses cannot be compromised, neither of which should ever depend on the code being obfuscated.
However the obfuscation will deter/delay whitehats, and if the bank brings in any external testers (which they should, and in many places are required by law to do), the obfuscation will just increase the cost of testing while providing no security benefit.
Heavy obfuscation also increases development and other testing costs too, makes it more difficult to debug customer problems, and is likely to make the application larger and buggier.
All in all a lot of effort and cost to cause a minor inconvenience to anyone looking to attack the client.
Heavily obfuscated code is also often used to hide serious design flaws, there is quite a lot of software out there that on the surface looks quite secure, but once you start reverse engineering the binary you find severe shortcomings... Making something harder to find doesn't stop it being exploited, it just increases the time before its discovered by a whitehat and fixed.
Something should be secure even against an attacker who knows everything about how it works... Knowledge of the system should not enable any attacks. Common encryption algorithms and protocols are fully documented, and a lot of security critical devices are based on publicly available source code.
http://spamdecoy.net - free throwaway anonymous email - avoid spam!
never confirm they had the correct username but a bad password
My bank must not have got the memo. After I submit my username, the login process presents an image associated with my account to prove to me that it is my bank and not a phishing site before I enter my password. Both GE Capital and Ally do this. Besides, one can verify whether a username corresponds to an account by attempting to register for an account under that username.
Perhaps the obfuscation is there to make it more difficult to extract the secret from the medium on which the secret is stored.
So how do you recommend that someone who currently lives in the United States go about qualifying to work in Canada?
This page states that there are no physicians anywhere in the State of Indiana who are qualified by Canada to perform the medical examination required of people entering Canada. This means I'd have to take a Greyhound motor coach to Chicago and back, somehow find a place to sleep, and figure out how to navigate Transit Chicago. (Or I'd have to go to driving school and buy a car.) What would be the best place for me to learn about these things? Would an employer in Ontario be willing to explain this, or should I seek help elsewhere?
Hopefully with an accompanying paper towel.
The most interesting comment for me was this:
This is not a security vulnerability or even criticism by any stretch. The bank‘s app is (arguably) more secure than Google Authenticator (which keeps secrets around in plaintext), and this article should be seen as praise for the bank’s app, which does things the right way by (mostly) adhering to the TOTP standard, and protects its data as well as technically possible.
Yes, because any TOTP app must be able to read the secrets to generate the OTP, it must have any encryption keys internally, so it can never really be safe from cloning (unless it relies on a hardware encryption component which the phones don't have). Still, storing in plaintext makes grabbing the token data particularly easy.
administrators/developers are users too. I'd prefer to have the error code AND the description.
You shouldn't tell them their PIN is wrong and that if they get it wrong 2 more times, then their card is going to be blocked? Riiiiight....
I doubt that the original source code used for development and debugging is obfuscated. Chances are they run it through a script that renames everything and removes and left over debug data. It's a fairly standard thing to do.
In other words I doubt that they are relying on obfuscation for security, it was just a checkbox in the build system that costs them nothing.
const int one = 65536; (Silvermoon, Texture.cs)
SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
FYI: This is not a security breach. The algorithm is not supposed to be the secret. There are lots of android/iphone apps to do this, and most of them use HOTP or TOTP which is an IETF standard algorithm. The security is in the secret key that is generated when you run the app the first time. This key is synchronized between the server and the key generator when it is setup.
I think you got lost somewhere, we weren't talking about entering PINs. Those messages would be okay, because if someone has your bank card they can be pretty sure it is valid, not so with a random username they might have guessed, and I'm sure most crooks know they'd only get three attempts at entering a PIN.
I think that the point is that the developers can have what they want, but after putting the program through it's acceptance and validation tests, the useful (to a reenigne) error descriptions should be stripped out. Really out. It should NOT be left in place for the public-facing code.
Birds are not dinosaur descendants;birds are dinosaurs, for all useful meanings of "birds", "are" and "dinosaurs"