WEBVTT

00:00.000 --> 00:01.020
Alright.

00:10.670 --> 00:12.830
Alright, so we finally made it.

00:12.830 --> 00:17.130
I want to give a big thanks to my mate Alex who flew over from Europe.

00:17.130 --> 00:21.750
He road-tripped the ATMs with me in an Escalade from San Jose to here.

00:21.770 --> 00:25.870
The whole time I'm thinking, please don't get pulled over, please don't get pulled over.

00:26.490 --> 00:31.630
Two ATMs in the back of an Escalade and about 6,000 notes of novelty currency.

00:31.630 --> 00:33.470
What are you boys up to, mate?

00:34.630 --> 00:37.630
We made it, we got into the casino, so we're all good.

00:38.030 --> 00:41.370
The attraction to target ATMs is fairly obvious.

00:41.370 --> 00:42.890
I mean, they're full of cash.

00:42.970 --> 00:46.770
But for myself, it's kind of part of a bigger picture and a bigger plan.

00:46.770 --> 00:52.590
And that's to explore systems that, when compromised, have direct and immediate consequences.

00:52.770 --> 01:02.730
You know, society relies on various proprietary systems, whether they be ATM machines, medical devices, smart meters, parking meters, or the computer system in a vehicle.

01:02.730 --> 01:04.750
It's important to research these systems.

01:04.750 --> 01:07.810
Particularly, they're often not designed with a secure methodology.

01:07.950 --> 01:12.610
As a result of that research, we can use that knowledge to design better and safer products in the future.

01:13.830 --> 01:15.050
So, my goal.

01:15.150 --> 01:21.990
The goal of the talk is to spark discussion on the best ways to remediate and prevent the attacks that I'm going to be demonstrating.

01:22.030 --> 01:26.070
The goal definitely isn't to give a cookbook recipe on how to hack ATMs.

01:27.210 --> 01:31.010
I find the process of finding vulnerabilities a little bit more interesting anyway.

01:31.010 --> 01:32.690
The journey, not the destination.

01:32.690 --> 01:36.130
Although, the destination is pretty cool in this one.

01:36.390 --> 01:42.490
And I hope to change the way people look at devices that, from the outside, are seemingly impenetrable.

01:44.090 --> 01:45.710
So, current attacks.

01:45.710 --> 01:48.390
The skimmer, which is certainly a fan favorite.

01:48.770 --> 01:52.550
A small overlay that slides over the card slot and the pin pads.

01:52.610 --> 01:57.370
Manufactured to blend seamlessly with whatever particular ATM it's manufactured for.

01:57.370 --> 02:01.350
Designed to both capture the track data on the cards as well as the pin numbers.

02:01.650 --> 02:04.090
And, you know, technology in some of these is no joke.

02:04.090 --> 02:06.150
Data that gets transmitted over GPS.

02:06.370 --> 02:08.270
Some even have tamper protection.

02:08.310 --> 02:12.270
They wipe themselves and find out and send the remaining data back to the attacker.

02:12.990 --> 02:14.590
Physical theft and ram raids.

02:14.590 --> 02:24.710
You may have all seen those YouTube videos where a couple of good old boys hurl through the front window of a store, attach a chain to an ATM and the other end to their pickup truck and take off with it.

02:24.710 --> 02:30.210
Not the most subtle of attacks, but that's ninja status compared to some of the other ones.

02:30.610 --> 02:32.990
And we have card trapping and card snooping.

02:33.030 --> 02:44.470
Card trapping where someone will insert a small shim, commonly known as a Lebanese loop, into a slot, traps the card, and they're designed in such a way that when the card's read, it'll be read but won't be returned to you.

02:44.470 --> 02:50.310
Often combined with shoulder surfing to get your pin, or they'll get your pin in ways that may not be quite as friendly.

02:50.310 --> 02:55.550
Then safe-cutting and frontal attacks, basically going at the ATM with a pair of pliers and a blowtorch.

02:56.610 --> 03:00.230
Explosives, which is surprisingly popular, which I find a bit odd.

03:00.450 --> 03:05.610
The attacker's literally tying a bunch of explosives to an ATM and blowing the crap out of it.

03:05.930 --> 03:12.070
Now, you'd think blowing up an ATM would be somewhat counterproductive, but this is bigger than Australia, so go figure.

03:12.570 --> 03:13.870
Sorry, Australians.

03:16.930 --> 03:18.710
And data breaches.

03:18.710 --> 03:22.810
Hacking the backend, so hacking the bank processor, harvesting the card data.

03:22.810 --> 03:27.630
An example of this would have been the compromise of the Royal Bank of Scotland's Wellpay backend.

03:27.750 --> 03:31.710
Certainly the safest and was the most technically sophisticated attack that I've seen.

03:31.710 --> 03:34.310
I think about 9 million was stolen during that attack.

03:35.690 --> 03:37.890
And then I guess we have miscellaneous.

03:39.190 --> 03:40.070
Other.

03:40.390 --> 03:53.510
So there would have been the default passcode attack from a couple of years back, where if the operator password was left unchanged on the machines, you could reprogram the ATM to think there was a lower denomination in the machine than there actually was.

03:53.510 --> 03:57.130
So you could probably think it's full of $5 notes, but it's really full of 20s.

03:57.130 --> 03:59.890
And I'll be adding some more to the other category.

03:59.930 --> 04:03.930
Practical attacks, which in my opinion blow John Connor's mind right out of order.

04:05.810 --> 04:10.270
So I've picked standalone ATMs, and there's a few reasons for that.

04:10.270 --> 04:12.750
First off, they're pretty easy to get a hold of.

04:12.750 --> 04:16.630
You jump online, and like anything on the internet, you just add to cart.

04:17.770 --> 04:21.670
Getting the ATMs delivered to your house, though, is actually quite interesting.

04:21.990 --> 04:26.070
I had the ATM delivery guy literally wheel in one of the ATMs.

04:26.950 --> 04:30.090
And he came in, he's like, why on earth do you need an ATM in your house for?

04:30.090 --> 04:38.970
And I was feeling a little bit cheeky at the time, so I just looked at him like, oh, I don't like the transaction fees, mate.

04:43.710 --> 04:46.590
And he just kind of shook his head and went on his way.

04:48.550 --> 04:56.510
But also, they're everywhere, you know, every bar, convenience store, market, and they're often in secluded areas, you know, they'll be out by the restroom, tucked away in corners.

04:56.510 --> 05:01.970
But I will be discussing attack methods for both stand-alones and hole-in-the-wall ATMs.

05:02.050 --> 05:08.270
I'll go over walk-up style attacks, but then I'll shift focus to a far more important vector, and that's remote attacks.

05:08.350 --> 05:11.990
And particularly what an attacker can leverage through a successful remote compromise.

05:12.210 --> 05:15.930
And when I say remote, I mean remote default, because that's the only way to roll, really.

05:17.490 --> 05:24.370
So just to get an idea of how popular these ATMs are, this is just one block on my street from a bit of a pub crawl.

05:26.510 --> 05:33.430
I must say my favorite is the guy who owns a Mexican restaurant here, holding his bottle of Tapatio over the top of the ATM.

05:33.850 --> 05:36.470
It doesn't exactly look chuffed to be there, though.

05:40.610 --> 05:44.970
So this is standard specs of a new model retail-style ATM.

05:44.970 --> 05:47.670
Generally Windows CE running an ARM processor.

05:47.810 --> 05:52.650
Our new models support both TCPIP and dial-up by default, optional wireless.

05:52.650 --> 05:56.070
When I say wireless, I mean CDMA, not 802.11.

05:56.070 --> 05:59.370
So no drive-by ATM attacks, unfortunately.

05:59.370 --> 06:02.890
Though it would be kind of cool to ride by and just have ATMs spit out cash.

06:03.450 --> 06:06.530
Although maybe the Grug could possibly do something with this.

06:07.290 --> 06:09.990
SSL support and a triple-desk encrypted PIN pad.

06:09.990 --> 06:18.650
So the PIN pad performs all the encryption within the device itself, has anti-tampering mechanisms, and I may talk a bit more about that beast a little later.

06:20.270 --> 06:23.070
So this is a typical ATM internals.

06:23.070 --> 06:30.490
A bit hard to see, but there's a receipt printer over to the right, a card reader, and there's a serial interface that leads down to the safe, which is wired to the dispenser.

06:30.890 --> 06:38.490
And there's various motherboard inputs, multiple USB, SD cards, the network connection, and some debugging ports.

06:38.570 --> 06:41.970
On this one, there's actually a cover in there that's protecting the circuit board.

06:41.970 --> 06:48.910
I simply just removed it for photo purposes, but I guarantee both of these ATMs are completely untouched and completely unmodified.

06:48.910 --> 06:57.110
Now, funnily enough, all the ways that an ATM could possibly be disrupted, it was actually almost my cat who took it down for me.

06:57.290 --> 07:09.930
I had a USB keyboard plugged in and he was chasing a moth or something, and he ripped out the USB port and then pulled out the processor plug-in at the same time, but luckily the only damage was the USB plug that was easily soldered back in.

07:09.930 --> 07:11.370
But anyway, bad kitty.

07:13.870 --> 07:19.430
So in my opinion, a presentation shouldn't really be a full-blown technical tutorial.

07:19.710 --> 07:26.250
So I'll be following up later with a white paper that goes into more technical details.

07:26.250 --> 07:33.450
But rather than digging deep into the ins and outs of C internals, I thought I'd sum up the security hurdles I faced with this quote.

07:33.570 --> 07:37.030
We were concerned about protection, but not about security.

07:37.030 --> 07:40.250
We weren't trying to design an airtight system like Windows NT.

07:40.250 --> 07:46.110
And this is from Thomas Fenwick, who was the creator of the Windows CE kernel.

07:46.110 --> 07:52.270
And this quote came from a book called Inside Windows CE, which is interviews with the core developers of CE.

07:52.350 --> 07:58.550
And it's an interesting read on the design approach that was taken, but essentially there were not many roadblocks.

07:58.550 --> 08:03.490
The technical information I think lends itself better to a white paper, which I'll be following up with.

08:04.890 --> 08:16.750
So before we can even think about giving that dude from Terminator 2 a run for his money and actually start devising attacks, the first step is to be able to interface with the ATM and gain access to the file system.

08:16.910 --> 08:22.050
So once we have access to the file system, we can then pull the executables and be able to do some reverse engineering.

08:22.650 --> 08:28.330
Now unfortunately, when the ATM boots, it boots directly to its own proprietary application, so there's no explorer shell.

08:28.450 --> 08:30.790
And we need a shell to be able to make things easier.

08:30.890 --> 08:36.670
Originally, I suppose naively, I thought I could just plug in a keyboard and alt-tab, but of course that wasn't to be the case.

08:36.670 --> 08:40.510
But to get a shell, we'll need to have explorer execute at boot time.

08:42.570 --> 08:46.410
So the CE application boot sequence is fairly straightforward.

08:46.410 --> 08:57.450
The kernel nkexe runs filesys.exe, filesys sets up the registry and file system, and then it executes the applications that are listed in the registry key, hklm, and that.

08:57.450 --> 09:01.530
So the trick is to patch the application we want, execute it into that boot list.

09:02.990 --> 09:07.030
So of course we want to get explorer into the boot list, and there's two approaches basically.

09:07.030 --> 09:11.310
The first approach assumes you have a copy of the CE ROM image.

09:11.710 --> 09:15.870
The registry file can then be extracted, modified, recompiled into the image.

09:15.870 --> 09:20.310
This requires a way to rewrite the flash, whether it be serial, ethernet, JTAG, or what have you.

09:20.610 --> 09:23.870
The other approach is to patch in explorer while you're debugging.

09:23.890 --> 09:28.030
And this of course requires some sort of debugging capability, JTAG, ethernet, serial, et cetera.

09:29.030 --> 09:34.070
So I decided to go with JTAG, because it's a fairly straightforward way to accomplish our goals.

09:34.270 --> 09:39.730
JTAG is a hardware debugging interface, which essentially gives you unrestricted debugging access to the processor core.

09:39.990 --> 09:48.810
Now the hardware to do this used to be pretty pricey, but these days with OpenOCD and some of the open source projects, you get the needed hardware for less than a hundred bucks.

09:49.130 --> 09:54.490
Now with JTAG access, you can remotely debug with GDB, debug the kernel, the boot loader, and so on.

09:54.490 --> 09:57.230
Now JTAG has been talked about to death, and I won't dwell on it.

09:57.230 --> 09:59.690
There's a lot of resources online with a lot more information.

10:00.830 --> 10:03.990
So here's just the hardware debugger connected to the motherboard.

10:03.990 --> 10:11.250
Now it's probably obvious, but the use of hardware debuggers and things of that nature have absolutely nothing to do with the ATM attacks that I'll be demonstrating.

10:11.250 --> 10:17.230
They're simply used to initially gain access so we can then go on to find real vulnerabilities.

10:21.110 --> 10:26.090
Speaking of JTAG, I actually learned a valuable lesson when I was messing with one of the ATMs.

10:26.090 --> 10:35.590
I had the JTAG hooked up and I was screwing around and I accidentally wiped out a massive chunk of the firmware and overwrote all the ATM files on it.

10:35.670 --> 10:40.990
Now at the time I couldn't get a hold of the software to reflash it because I wasn't an ATM distributor.

10:41.070 --> 10:45.990
So I actually had to call a licensed ATM technician to come around to my house.

10:48.330 --> 10:53.210
Now three guys arrive and of course they ask again, you know, why are these ATMs in your house?

10:53.210 --> 10:56.330
And I say, oh, I haven't moved them into my store yet and all this type of thing.

10:57.030 --> 10:58.570
But anyway, see, what happened?

10:58.570 --> 10:59.950
How did you remove all this?

10:59.950 --> 11:03.750
Oh, I had it on a card, I was trying to change a splash screen, it all just wiped out.

11:03.750 --> 11:06.290
He's like, yeah, no, they'll do that, they'll do that.

11:08.790 --> 11:11.770
You know, so he starts going to work on the ATM.

11:11.770 --> 11:13.790
I'm like, firmware, what is that, mate?

11:14.090 --> 11:15.710
Acting completely stupid.

11:16.070 --> 11:19.050
He ends up teaching me a hell of a lot about hacking ATMs.

11:19.050 --> 11:21.310
I got his business card, we kept in touch.

11:21.310 --> 11:25.850
Unfortunately, after this presentation, that relationship may be severed.

11:27.950 --> 11:31.550
Oh yeah, so the lesson is always back up the firmware first.

11:33.610 --> 11:36.890
So now that we can debug, we need a way to inject.

11:36.910 --> 11:40.910
With the debugger connected, simply set a breakpoint on create process.

11:42.030 --> 11:48.630
And the opposite was found by simply dumping the memory from the ATM and just doing a byte compare to an offline version of Core DLL.

11:48.890 --> 11:56.150
Now when working with the ARM processor, the parameters when they pass the function are passed in registers before they utilize the stack.

11:56.150 --> 12:00.570
So R0 will have the first parameter, which is the executable, what you want to execute.

12:00.570 --> 12:07.450
We simply replace that string with what would normally be the ATM executable and overwrite it with explorer.exe.

12:07.450 --> 12:16.170
Now if explorer doesn't exist on the image, then you can just put a copy of explorer on a removable drive and pass that full path to create process.

12:17.290 --> 12:19.990
And so then you get a shell on the ATM.

12:19.990 --> 12:26.810
When I first was playing around with the ATMs, I was quite excited just to have a little shell on them, so I had them playing movies and whatnot.

12:27.110 --> 12:32.430
But not really surprisingly, ATMs are pretty crap for playing movies.

12:33.070 --> 12:38.170
Slow frame rate and the 6-inch screen, so it will not be replacing the flat screen.

12:40.470 --> 12:46.950
So now with Explorer, we can plug in a USB drive and a keyboard and copy off the files for reverse engineering.

12:46.950 --> 12:50.170
Then we can modify the registry so Explorer will always boot.

12:50.370 --> 12:59.270
Now remote debugging with JTAG over GDB is not the ideal way to debug a Windows machine, so the next step is to set up a better debugging environment.

12:59.330 --> 13:07.090
And there's a way to debug Windows CE applications without having ActiveSync installed, and that's to debug with Visual Studio over Ethernet.

13:07.090 --> 13:19.870
So you simply build an empty project, overwrite the local executable with the executable from the device that you want to debug, set the correct TCP settings, copy the file over, run it under the debugger, and you have application debugging with Visual Studio.

13:19.990 --> 13:28.070
So now finally we have everything in place to be able to reverse engineer the software to locate vulnerabilities, but to also test any software that we create for the ATM.

13:29.410 --> 13:31.170
So planning an attack.

13:31.170 --> 13:33.950
There's a fairly limited attack surface really.

13:33.950 --> 13:43.730
We have the card reader, but assuming we have an overflow or some other string-based attack via the card tracks, there's a limited amount of characters and a very restricted character set.

13:43.730 --> 13:48.730
So I'm not going to say it's not possible, but I will say it would be unlikely to be practical or reliable.

13:49.190 --> 13:55.010
The keypad, another long shot, but maybe there's possible master passwords or backdoors left in by the developers.

13:55.310 --> 14:00.990
Then the network, so any open ports, an answering phone line, any options for a remote attack.

14:01.470 --> 14:06.410
And we also have the various inputs on the motherboard itself, but of course this requires access to the motherboard.

14:08.210 --> 14:17.090
So of course progress is never really made without a few failures along the way, and in my attempt to come up with a Terminator 2 SCAC, I made this little device.

14:17.170 --> 14:26.250
It's basically an electromagnet wired up to an amp which is connected to a media player, and you create a web file which is created to simulate the data on a magnetic stripe.

14:26.290 --> 14:34.610
The electromagnet, plug into the ATM, flick the switch, play the web file, and the ATM will think of magnetic stripes being read.

14:34.610 --> 14:37.350
Technically it works fine, but it was actually bugger all help.

14:40.050 --> 14:43.990
So the goal, of course, is to execute code on the ATM.

14:44.590 --> 14:46.790
So I'll talk about these walk-up attacks first.

14:46.810 --> 14:51.450
Now the cash dispenser is housed at the very least by a safe, if you take the cheapest option.

14:51.450 --> 14:53.970
If you spend a bit more, you can get even more heavy-duty protection.

14:54.090 --> 14:59.710
The motherboard, on the other hand, is protected by a one-key-fits-all lock.

15:01.730 --> 15:11.890
And this is actually standard practice across the boards, and these keys, like almost everything else on the internet, are easily available to add to cart.

15:12.670 --> 15:20.850
And, funnily enough, there used to be Diebold keys, last year when I was looking, but they've since vanished, but I'm sure with a little creativity they could be found.

15:20.890 --> 15:25.390
As you can see, most manufacturers take this approach.

15:27.650 --> 15:29.150
So, the walk-up attack.

15:29.150 --> 15:33.670
So now with your master key, you have access to the USB slots and what other inputs.

15:33.670 --> 15:40.210
So you can pop open the motherboard compartment, insert a USB key in a couple of seconds, a lot faster than installing a skimmer, right?

15:40.510 --> 15:45.110
Now, even though the attack time here is short, there's still the possibility of being detected.

15:45.270 --> 15:49.130
But, you know, I suppose that's a great thing about these retail and stand-alone type ATMs.

15:49.130 --> 15:53.390
They're out by the restrooms, they're out of sight, off by the SIGGY machine or something.

15:53.730 --> 15:57.950
And I suppose then there's that psychological aspect of using an ATM machine.

15:57.950 --> 16:00.550
It's kind of considered rude to look over someone's shoulder.

16:01.090 --> 16:04.830
Unless, of course, you're a criminal, and then he would probably learn a trick or two anyway.

16:05.450 --> 16:08.670
Now, all ATMs need a way to upgrade their firmware.

16:08.750 --> 16:12.190
And this is most often leveraged via their removable drives.

16:12.190 --> 16:20.010
So the ATM application checks the drive for a valid upgrade, the valid firmware is found, upgrades, install whatever we decide to add in there.

16:20.130 --> 16:23.870
Now, of course, the firmware is typically a proprietary format.

16:24.130 --> 16:31.590
There are checksums, encryption, and the algorithms are easily figured out by reversing the code on the ATM side.

16:31.910 --> 16:37.610
So once you can create your own firmware package that adheres to the correct format, well, then you can upgrade.

16:37.610 --> 16:40.370
But upgrade with a few modifications, of course.

16:41.830 --> 16:46.070
Now, the most important attack is the remote attack.

16:46.070 --> 16:53.290
Now, most, if not all, ATMs that run on a Windows-based OS support some form of remote monitoring or remote configuration.

16:53.610 --> 17:01.730
So this allows you to log into your ATM remotely, review or change the settings, get stats, change the splash screens, and so on.

17:01.730 --> 17:06.250
Another quite useful feature is the ability to remotely upgrade the software.

17:06.350 --> 17:10.910
Now, this is sometimes a feature, but always something you can leverage if you have a vulnerability.

17:11.210 --> 17:15.210
Now, obviously, authentication is required to be able to do anything useful.

17:15.470 --> 17:27.110
With the particular model I'll be demonstrating, both a serial number and a remote password are required, and they're both made up of a combination of numbers and letters, and a five-second delay is forced after each connection attempt.

17:27.110 --> 17:29.570
So a brute force is basically out of the question.

17:29.570 --> 17:35.230
So we require vulnerability within the authentication process, and it just so happens.

17:35.890 --> 17:37.830
So let me introduce Dillinger.

17:37.990 --> 17:43.470
Dillinger is my remote ATM attack or administration tool, whatever way you want to look at it.

17:43.470 --> 17:46.050
Dillinger named after the bank robber, of course.

17:46.730 --> 17:54.690
So we've talked about loading code on a local ATM machine with a master key and a flash drive and the correctly formed firmware, you're basically set.

17:54.690 --> 17:58.650
But the obvious drawback here is you have to interact with the machine itself.

17:58.650 --> 18:04.850
So the ultimate win would be able to execute code or load code remotely, and that's where Dillinger comes in.

18:05.090 --> 18:10.350
So Dillinger takes advantage of a fairly severe vulnerability in the ATM management capability.

18:10.870 --> 18:20.070
And interestingly, although most operators don't use the remote monitoring, it's enabled by default on this particular manufacturer, so shushing!

18:20.390 --> 18:31.170
Now, typically to log into the machine remotely we require the knowledge of the serial number and the password, but due to an awesome vulnerability, I can bypass all authentication on the device.

18:31.590 --> 18:33.930
And the remote attack is 100% reliable.

18:34.710 --> 18:38.970
So Dillinger supports TCP IP and it supports dial-up as well.

18:39.130 --> 18:49.370
And I heard through a fairly knowledgeable source that most of these stand-ups, stand-alones, about approximately 95% of them are still on a dial-up connection.

18:49.470 --> 18:57.510
Now, of course, back in the day, finding an ATM over the phone line would be a long process of nights and nights of wall dialing, but thanks to tools like H.G.

18:57.510 --> 19:01.550
Moore's Wallbox, you can map out modems on exchange in a matter of hours.

19:01.550 --> 19:05.750
Then write a custom tool to find the ATM responses and you're away.

19:07.970 --> 19:09.370
So, Dillinger features.

19:09.370 --> 19:13.570
So Dillinger will allow you to manage an unlimited amount of ATMs through its interface.

19:13.710 --> 19:20.890
You can add a group, say you add a city, under the city you add each individual ATM, either its IP address or its phone number.

19:20.890 --> 19:25.110
Now, the heart of the tool, of course, is the authentication bypass that it exploits.

19:25.110 --> 19:27.890
And this is the stepping stone to be able to do anything useful.

19:28.470 --> 19:37.410
So, one feature in Dillinger is to be able to test the bypass in a way which confirms the vulnerability but doesn't actually modify the remote ATM in any way or leave any trace.

19:38.050 --> 19:42.390
So, the obvious problem with finding a remote ATM is that you have no idea of the location.

19:42.570 --> 19:48.930
So, Dillinger can pull the ATM settings from the device which includes all the master passwords but it also includes the receipt data.

19:48.930 --> 19:53.950
And you know when you use an ATM at the bottom of the receipt, it always has the location or the name of the business.

19:54.670 --> 19:58.450
So, even if it doesn't have the exact location, it will have the name of the business.

19:58.950 --> 20:02.770
And, of course, the best feature is to upload my rootkit.

20:03.190 --> 20:12.650
Again, bypasses all authentication, initializes the software, uploads the rootkit, and then basically lets me overwrite the entire firmware of the device.

20:13.370 --> 20:17.730
So, in general, someone is going to need to be at the ATM if you want to get any sort of payout.

20:17.730 --> 20:23.590
So, again, I added a feature so it would be possible to carry out an attack without ever visiting the ATM at all.

20:23.590 --> 20:30.550
So, when someone inserts a card, the track data is captured and saved and I can then retrieve that track data remotely.

20:31.050 --> 20:34.510
And finally, the remote jackpot, which kind of speaks for itself.

20:36.650 --> 20:43.950
So, Scrooge is the ATM rootkit developed specifically for ATMs running on Windows CE.

20:44.110 --> 20:48.030
Scrooge implements the typical rootkit technology you'd expect.

20:48.030 --> 20:51.950
Hides itself and its friends by various CE system hooks.

20:52.050 --> 20:54.130
Hides itself from the process list.

20:54.130 --> 20:57.850
Hides itself from the file system by hooking syscalls and filtering the results.

20:58.210 --> 21:06.230
And there's a hidden pop-up menu which can be activated by both a special key sequence on the ATM or by inserting a card with custom track data.

21:06.750 --> 21:11.270
Now, it'll run on any ARM or XScale based ATM, Intel with a few tweaks.

21:11.270 --> 21:19.770
Originally, I was designing for both Intel and ARM, but it turns out that CE on x86 is actually pretty rare and basically non-existent in the ATM world.

21:20.410 --> 21:28.430
So, the code for interfacing the ATMs has to be customized for the different ATMs as they all use different peripherals and kind of non-standard ways of communicating.

21:29.710 --> 21:31.110
So, Scrooge's hidden menu.

21:31.110 --> 21:35.950
I just use a standard set windows hook filter to capture the side buttons on the ATM.

21:36.190 --> 21:42.110
Although set windows hook is actually undocumented in CE, it still exists and it works as expected.

21:42.330 --> 21:51.390
So, a combination of keys will trigger the hidden menu and it's varied enough not to be launched by accident, but maybe if there's a kid playing around with the ATM, he may end up scoring big, who knows.

21:52.270 --> 21:56.090
And the card reader is hooked by an inline detour style patch.

21:56.090 --> 22:05.230
So, this is where you essentially patch a branch instruction into a piece of code you'd like to intercept, the branch jumps to your code, your code executes , then returns the original function.

22:05.750 --> 22:14.270
Now, with the hook in place, there's a check on the read buffer for track data that matches gimme the loot, and if it matches, the menu is brought up in that way as well.

22:14.470 --> 22:16.890
So, the menu functions are fairly standard for what you'd expect.

22:16.890 --> 22:21.970
You can dispense from each cassette, print out stats, which include the remaining bill count, and you can exit.

22:24.010 --> 22:27.710
So, yeah, to add my own functionality, I've added a few inline patches.

22:29.170 --> 22:32.790
Essentially, you can patch a small assembler stub into the functions you want to hook.

22:32.910 --> 22:39.210
The stub then calls a function external DLL, overwrites any overwritten instructions, and then continues as normal.

22:39.390 --> 22:48.170
This could be done dynamically, but the fact that the ATM vulnerabilities allow me to replace the executables entirely, we can make these patches permanent, which is actually far more reliable.

22:48.450 --> 22:52.230
And it's also a lot easier on ARM, as every instruction is 32 bits long as well.

22:52.670 --> 22:58.190
So, I place hooks at the card reader, the pinpad, and the parser that handles remote configuration commands.

22:58.230 --> 23:05.990
So, with those hooks, I can now add my own handy features, so I can save the track data, capture the pinpad, have a few custom remote commands.

23:05.990 --> 23:07.730
So, pull the track data, sure.

23:07.890 --> 23:09.590
Remote jackpot, might as well.

23:10.830 --> 23:11.490
Alright.

23:11.730 --> 23:19.390
So, there's going to be quite a lot of demos, so I went through that a bit quick, because I think there's probably a good 25 or so minutes of demos.

23:19.390 --> 23:23.830
So, I might as well put my money where my mouth is, or the ATM's money where its mouth is, I guess.

23:52.730 --> 23:55.650
Okay, so this is Dillinger's interface.

23:58.740 --> 24:01.740
I can add a group, so we'll say blackhat.

24:05.510 --> 24:07.670
Add an ATM.

24:08.950 --> 24:10.890
Barnaby's ATM.

24:13.900 --> 24:17.340
Location, onstage at blackhat.

24:19.040 --> 24:27.180
And Dillinger supports both dial-up and TCPIP, so in this case, I'm using TCPIP of course.

24:28.000 --> 24:37.520
By the way, just to reiterate, this is by default remote functionalities enabled on all of these ATMs as they ship out.

24:38.260 --> 24:40.220
This one here at least, not the other one.

24:46.440 --> 24:57.260
Okay, so now I can right-click on my ATM, I can then test the bypass, upload the rootkit, reset to default, get the track settings, get ATM settings, etc.

24:58.020 --> 25:02.020
So, let's see, I'm trying to think if we should switch to the ATM.

25:02.900 --> 25:04.440
You know, not just yet, okay.

25:04.440 --> 25:12.800
So, I can test the bypass, connects to the ATM, testing ATM authentication bypass success, and it disconnects.

25:14.960 --> 25:23.160
Now, we'll actually blow up the ATMs in a sec, but all that shows on the ATMs is just RMS process.

25:23.420 --> 25:25.520
I have to wait till that goes away.

25:27.720 --> 25:32.080
So, it's nothing too noticeable, you know, if you're if you see this ATM.

25:36.030 --> 25:40.910
Actually, if someone close to the thing could let me know when it's gone?

25:40.910 --> 25:41.770
Okay.

25:42.290 --> 25:47.030
So, now, the most important feature, of course, is to upload the rootkit.

25:48.310 --> 26:01.930
So, we'll upload Scrooge, the final version, connects, sends a bypass successful, initiates upload, and it's uploading it to the ATM now.

26:01.930 --> 26:06.410
This is bypassing all authentication in the ATM, and by default.

26:11.400 --> 26:20.460
Now, even though it's over the network, it takes a little while, because they have their own proprietary protocol, which acknowledges each packet, and then has a small delay, and so on.

26:21.140 --> 26:27.060
Proprietary protocol, of course, has its own proprietary encryption, and you all know what happens when people implement proprietary encryption.

26:27.920 --> 26:29.940
It's fairly easy to make your own.

26:37.460 --> 26:44.780
Okay, so, when it finishes uploading, the ATM should reboot, and if we could flick to the ATM now, on the screen.

27:00.390 --> 27:04.910
Takes a little while, Windows CE, you know, it's not the fastest beast out there.

27:19.380 --> 27:22.020
Yeah, if we could just pan out just a bit, too.

27:29.220 --> 27:31.860
If we could get the screen and the dispenser.

27:38.830 --> 27:40.210
Yeah, that's cool.

27:44.520 --> 27:45.520
What's that?

27:47.320 --> 27:49.920
Oh, they'll be spitting money, don't worry about that.

27:58.100 --> 27:59.060
Okay.

28:00.740 --> 28:03.540
Let me make sure I have my little card here.

28:06.540 --> 28:12.900
So, as I said, there's two ways to get the remote menu or the hidden menu to pop up.

28:12.900 --> 28:15.920
One is with special cards with the track data.

28:15.920 --> 28:17.140
So, if we insert...

28:21.100 --> 28:22.060
Okay.

28:23.300 --> 28:26.720
I always say it's 100% reliable, and why doesn't it work?

28:30.140 --> 28:31.220
There we go.

28:31.460 --> 28:34.180
Okay, so that card now has popped up my hidden menu.

28:34.620 --> 28:40.200
You can dispense 50 bills from A, B, C, or D, which are the four cassettes in the dispenser.

28:40.400 --> 28:45.300
You can print statistics, which give you the master passwords and so on, or you can exit.

28:45.400 --> 28:49.500
So, I'll just dispense 50 from the first cassette.

29:08.070 --> 29:12.070
So, these are million dollar bills, but it will...

29:12.790 --> 29:15.250
probably not much use at the craps table.

29:18.680 --> 29:21.700
The other one will spit out a bit of currency.

29:24.340 --> 29:30.800
Okay, so now we can exit, and I said there was a key sequence, which you could also enter to pop up their menu.

29:34.760 --> 29:37.120
These buttons are a bit bugged.

29:41.260 --> 29:42.900
Let's try that again.

29:44.000 --> 29:47.360
I've obviously pressed these buttons a fair few times.

29:47.360 --> 29:48.060
There we go.

29:48.060 --> 29:49.540
So, we can exit from that too.

29:50.060 --> 29:50.840
Okay.

29:52.520 --> 29:55.620
So, can we cut back to the computer?

29:57.940 --> 30:04.920
Okay, and it would be nice to know where this ATM actually is as well.

30:04.920 --> 30:07.580
So, we can retrieve the ATM settings.

30:07.580 --> 30:13.640
It connects, retrieves the settings, and saves them to disk.

30:18.780 --> 30:24.880
Now, you can see, so up here are the passwords to the ATM itself.

30:25.080 --> 30:31.200
I don't actually live on 123 Kiwi Street, by the way, but I do live in San Jose.

30:31.200 --> 30:37.740
And then it has the phone numbers as well as the IP addresses and the receipt coupons and all that type of thing.

30:40.640 --> 30:49.660
Now, of course, one of the greatest things about this is the fact that you can retrieve track data from people who insert cards.

30:49.660 --> 30:51.860
So, would anyone like to volunteer?

30:55.040 --> 30:56.980
Is Brandon here?

30:58.420 --> 30:59.740
There he is.

30:59.740 --> 31:03.300
Brandon, I think, has a custom credit card especially for this.

31:16.550 --> 31:19.150
So, can we flick to the ATM again, please?

31:26.270 --> 31:27.930
Can we cross to the ATM?

31:29.810 --> 31:33.530
Okay, so just insert your card as you normally would use an ATM.

31:40.150 --> 31:42.050
Alright, thank you, sir.

31:42.370 --> 31:44.470
So, back to the computer, please.

31:45.510 --> 31:49.750
So, now, let's see if we can get the track data that he just inserted.

31:51.610 --> 31:56.630
Connects, retrieves the stripe card data, saves it to disk.

31:58.490 --> 32:07.790
Okay, so you can actually see from the first one was the gimme the loot where I actually had my demo card.

32:07.950 --> 32:11.810
And then the next track data, this doesn't look like a credit card, Brandon.

32:12.390 --> 32:16.830
Doctorate of the Bustacardi with the card leet-leet-leet-leet-leet-leet-leet-leet-leet.

32:24.100 --> 32:28.880
But, of course, it will capture any credit card that's entered into the machine.

32:30.700 --> 32:37.280
And finally, the remote jackpot, which is always handy.

32:37.280 --> 32:39.380
So, go back to the ATM.

32:44.650 --> 32:46.870
Issue the jackpot command.

32:47.470 --> 32:48.910
We have a winner!

33:09.020 --> 33:13.960
Now, before I... I'm not going to let the other one get off scot-free.

33:14.440 --> 33:18.000
So, I will quickly demo the walk-up style attack.

33:18.000 --> 33:21.400
Now, I'm not as fast as this as I should be, but I will try it anyway.

33:22.480 --> 33:28.800
So, remember, the walk-up attack is simply popping open the cabinet, inserting a USB, and restarting it.

33:36.720 --> 33:38.360
Right, so that's the attack done.

33:38.360 --> 33:40.740
I wouldn't be spotted if I was out by the restroom.

33:46.290 --> 33:47.910
I think, just for...

33:48.970 --> 33:53.110
just to make it look a little better on stage, I might just open the cabinet here.

33:53.110 --> 33:55.470
Not opening the safe, of course, just the cabinet.

34:01.450 --> 34:04.030
So, the other attack was somewhat practical.

34:04.030 --> 34:08.570
This one, you'd probably end up on World's Dumbest Criminals, as you'll probably see soon.

34:09.330 --> 34:10.690
Okay, so it boots.

34:10.690 --> 34:14.670
Right now, it should be reading the firmware off that USB drive.

34:28.060 --> 34:34.920
It copies the firmware over as it initializes the little BlackHat logo floating around the screen.

34:35.440 --> 34:39.180
Obviously, in the real world, it would be a rootkit, not a BlackHat logo.

34:41.400 --> 34:46.220
So, I kind of tailored this for both BlackHat and for Vegas, as you'll see.

35:03.910 --> 35:06.650
ARM 9 processes are not the fastest.

35:23.940 --> 35:24.420
...

35:54.940 --> 35:55.420
...

35:56.800 --> 35:57.280
...

35:57.280 --> 36:01.600
I just want to see how long it actually takes to dump its entire dispenser.

36:05.490 --> 36:12.470
It will start with million dollar bills and it's going to switch to IOActive currency, which also doubles as invites for the party.

36:12.470 --> 36:13.830
So ,

36:20.280 --> 36:22.980
I want there to be a big pile at the end.

36:23.460 --> 36:23.480
...

36:23.480 --> 36:24.060
...

36:55.410 --> 36:55.970
...

36:55.970 --> 36:58.150
It still hasn't got to the IOActive currency.

36:58.150 --> 37:00.210
I should have put that first, I guess.

37:00.590 --> 37:00.970
...

37:25.900 --> 37:27.380
There we go.

37:27.680 --> 37:28.160
...

37:36.780 --> 37:40.980
Okay, we can probably flick back to the presentation now.

37:42.260 --> 37:42.820
...

37:49.560 --> 37:52.040
Okay, so, countermeasures.

37:54.040 --> 37:54.600
...

37:54.600 --> 37:55.020
...

37:55.020 --> 37:56.500
The obvious physical...

37:57.020 --> 38:00.620
I may just disconnect the sounds really quick.

38:00.860 --> 38:01.580
...

38:12.150 --> 38:12.870
...

38:13.910 --> 38:14.270
...

38:14.630 --> 38:15.210
...

38:28.320 --> 38:35.420
So, the obvious physical countermeasure to prevent the walk-up attack is to offer upgrade options on the locks themselves.

38:35.420 --> 38:38.840
So, there's a unique key for each ATM.

38:38.840 --> 38:43.840
Now, of course, if you want to take this into your own hands, just drill a hole and throw a padlock on it.

38:44.880 --> 38:45.320
...

38:47.100 --> 38:47.540
...

38:49.600 --> 38:50.040
...

38:53.500 --> 38:53.940
...

38:53.940 --> 38:54.460
...

38:55.560 --> 38:56.000
...

38:58.760 --> 38:59.200
...

38:59.200 --> 38:59.740
...

39:00.760 --> 39:01.200
...

39:02.060 --> 39:02.500
...

39:02.500 --> 39:03.260
...

39:05.620 --> 39:06.500
...

39:09.160 --> 39:10.560
...

39:10.560 --> 39:10.960
...

39:14.780 --> 39:16.180
...

39:16.180 --> 39:17.040
...

39:17.040 --> 39:17.060
...

39:17.060 --> 39:17.120
...

39:19.140 --> 39:20.540
...

39:20.540 --> 39:22.560
...

39:22.560 --> 39:22.900
...

39:22.900 --> 39:22.980
...

39:22.980 --> 39:26.520
And finally, it's time to give these devices a rehaul.

39:26.600 --> 39:30.940
There hasn't been a secure development in methodology in from the get-go.

39:30.940 --> 39:37.360
So there's a need to play catch-up, have the code audited, have penetration tests, and implement best practices from here on out.

39:39.680 --> 39:45.300
So there's been a noticeable surge in the community of researching proprietary devices like ATMs.

39:45.340 --> 39:48.840
And the simple fact is that the companies who manufacture the devices aren't Microsoft.

39:48.840 --> 39:52.100
They haven't had 10 years of continual attacks against them.

39:52.100 --> 39:58.360
So the software that Microsoft got forced into a secure development, they've gotten where they are today.

39:58.360 --> 40:02.680
We're talking about devices that were developed without secure principles in mind.

40:02.680 --> 40:10.600
I think it's important to dig in, research these devices, find vulnerabilities, find solutions, and ultimately ensure a more secure future.

40:10.600 --> 40:12.180
So, cheers.

