start	end	text
0	1020	Alright.
10670	12830	Alright, so we finally made it.
12830	17130	I want to give a big thanks to my mate Alex who flew over from Europe.
17130	21750	He road-tripped the ATMs with me in an Escalade from San Jose to here.
21770	25870	The whole time I'm thinking, please don't get pulled over, please don't get pulled over.
26490	31630	Two ATMs in the back of an Escalade and about 6,000 notes of novelty currency.
31630	33470	What are you boys up to, mate?
34630	37630	We made it, we got into the casino, so we're all good.
38030	41370	The attraction to target ATMs is fairly obvious.
41370	42890	I mean, they're full of cash.
42970	46770	But for myself, it's kind of part of a bigger picture and a bigger plan.
46770	52590	And that's to explore systems that, when compromised, have direct and immediate consequences.
52770	55910	You know, society relies on various proprietary systems,
55910	60510	whether they be ATM machines, medical devices, smart meters, parking meters,
60510	62730	or the computer system in a vehicle.
62730	64750	It's important to research these systems.
64750	67810	Particularly, they're often not designed with a secure methodology.
67950	72610	As a result of that research, we can use that knowledge to design better and safer products in the future.
73830	75050	So, my goal.
75150	81990	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.
82030	86070	The goal definitely isn't to give a cookbook recipe on how to hack ATMs.
87210	91010	I find the process of finding vulnerabilities a little bit more interesting anyway.
91010	92690	The journey, not the destination.
92690	96130	Although, the destination is pretty cool in this one.
96390	102490	And I hope to change the way people look at devices that, from the outside, are seemingly impenetrable.
104090	105710	So, current attacks.
105710	108390	The skimmer, which is certainly a fan favorite.
108770	112550	A small overlay that slides over the card slot and the pin pads.
112610	117370	Manufactured to blend seamlessly with whatever particular ATM it's manufactured for.
117370	121350	Designed to both capture the track data on the cards as well as the pin numbers.
121650	124090	And, you know, technology in some of these is no joke.
124090	126150	Data that gets transmitted over GPS.
126370	128270	Some even have tamper protection.
128310	132270	They wipe themselves and find out and send the remaining data back to the attacker.
132990	134590	Physical theft and ram raids.
134590	144710	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.
144710	150210	Not the most subtle of attacks, but that's ninja status compared to some of the other ones.
150610	152990	And we have card trapping and card snooping.
153030	164470	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.
164470	170310	Often combined with shoulder surfing to get your pin, or they'll get your pin in ways that may not be quite as friendly.
170310	175550	Then safe-cutting and frontal attacks, basically going at the ATM with a pair of pliers and a blowtorch.
176610	180230	Explosives, which is surprisingly popular, which I find a bit odd.
180450	185610	The attacker's literally tying a bunch of explosives to an ATM and blowing the crap out of it.
185930	192070	Now, you'd think blowing up an ATM would be somewhat counterproductive, but this is bigger than Australia, so go figure.
192570	193870	Sorry, Australians.
196930	202810	And data breaches. Hacking the backend, so hacking the bank processor, harvesting the card data.
202810	207630	An example of this would have been the compromise of the Royal Bank of Scotland's Wellpay backend.
207750	211710	Certainly the safest and was the most technically sophisticated attack that I've seen.
211710	214310	I think about 9 million was stolen during that attack.
215690	217890	And then I guess we have miscellaneous.
219190	224170	Other. So there would have been the default passcode attack from a couple of years back,
224170	227390	where if the operator password was left unchanged on the machines,
227390	233510	you could reprogram the ATM to think there was a lower denomination in the machine than there actually was.
233510	237130	So you could probably think it's full of $5 notes, but it's really full of 20s.
237130	239890	And I'll be adding some more to the other category.
239930	243930	Practical attacks, which in my opinion blow John Connor's mind right out of order.
245810	250270	So I've picked standalone ATMs, and there's a few reasons for that.
250270	252750	First off, they're pretty easy to get a hold of.
252750	256630	You jump online, and like anything on the internet, you just add to cart.
257770	261670	Getting the ATMs delivered to your house, though, is actually quite interesting.
261990	266070	I had the ATM delivery guy literally wheel in one of the ATMs.
266950	270090	And he came in, he's like, why on earth do you need an ATM in your house for?
270090	276950	And I was feeling a little bit cheeky at the time, so I just looked at him like,
276950	278970	oh, I don't like the transaction fees, mate.
283710	286590	And he just kind of shook his head and went on his way.
288550	292450	But also, they're everywhere, you know, every bar, convenience store, market,
292450	296510	and they're often in secluded areas, you know, they'll be out by the restroom, tucked away in corners.
296510	301970	But I will be discussing attack methods for both stand-alones and hole-in-the-wall ATMs.
302050	306850	I'll go over walk-up style attacks, but then I'll shift focus to a far more important vector,
306850	308270	and that's remote attacks.
308350	311990	And particularly what an attacker can leverage through a successful remote compromise.
312210	315930	And when I say remote, I mean remote default, because that's the only way to roll, really.
317490	321050	So just to get an idea of how popular these ATMs are,
321050	324370	this is just one block on my street from a bit of a pub crawl.
326510	330490	I must say my favorite is the guy who owns a Mexican restaurant here,
330490	333430	holding his bottle of Tapatio over the top of the ATM.
333850	336470	It doesn't exactly look chuffed to be there, though.
340610	344970	So this is standard specs of a new model retail-style ATM.
344970	347670	Generally Windows CE running an ARM processor.
347810	352650	Our new models support both TCPIP and dial-up by default, optional wireless.
352650	356070	When I say wireless, I mean CDMA, not 802.11.
356070	359370	So no drive-by ATM attacks, unfortunately.
359370	362890	Though it would be kind of cool to ride by and just have ATMs spit out cash.
363450	366530	Although maybe the Grug could possibly do something with this.
367290	369990	SSL support and a triple-desk encrypted PIN pad.
369990	373710	So the PIN pad performs all the encryption within the device itself,
373710	378650	has anti-tampering mechanisms, and I may talk a bit more about that beast a little later.
380270	383070	So this is a typical ATM internals.
383070	386450	A bit hard to see, but there's a receipt printer over to the right, a card reader,
386450	390490	and there's a serial interface that leads down to the safe, which is wired to the dispenser.
390890	395530	And there's various motherboard inputs, multiple USB, SD cards,
395530	398490	the network connection, and some debugging ports.
398570	401970	On this one, there's actually a cover in there that's protecting the circuit board.
401970	404230	I simply just removed it for photo purposes,
404230	408910	but I guarantee both of these ATMs are completely untouched and completely unmodified.
408910	414090	Now, funnily enough, all the ways that an ATM could possibly be disrupted,
414090	417110	it was actually almost my cat who took it down for me.
417290	421290	I had a USB keyboard plugged in and he was chasing a moth or something,
421290	425510	and he ripped out the USB port and then pulled out the processor plug-in at the same time,
425510	429930	but luckily the only damage was the USB plug that was easily soldered back in.
429930	431370	But anyway, bad kitty.
433870	439430	So in my opinion, a presentation shouldn't really be a full-blown technical tutorial.
439710	446250	So I'll be following up later with a white paper that goes into more technical details.
446250	449470	But rather than digging deep into the ins and outs of C internals,
449470	453450	I thought I'd sum up the security hurdles I faced with this quote.
453570	457030	We were concerned about protection, but not about security.
457030	460250	We weren't trying to design an airtight system like Windows NT.
460250	466110	And this is from Thomas Fenwick, who was the creator of the Windows CE kernel.
466110	469010	And this quote came from a book called Inside Windows CE,
469010	472270	which is interviews with the core developers of CE.
472350	475310	And it's an interesting read on the design approach that was taken,
475310	478550	but essentially there were not many roadblocks.
478550	482030	The technical information I think lends itself better to a white paper,
482030	483490	which I'll be following up with.
484890	489810	So before we can even think about giving that dude from Terminator 2 a run for his money
489810	492110	and actually start devising attacks,
492110	496750	the first step is to be able to interface with the ATM and gain access to the file system.
496910	500070	So once we have access to the file system, we can then pull the executables
500070	502050	and be able to do some reverse engineering.
502650	506830	Now unfortunately, when the ATM boots, it boots directly to its own proprietary application,
506830	508330	so there's no explorer shell.
508450	510790	And we need a shell to be able to make things easier.
510890	514590	Originally, I suppose naively, I thought I could just plug in a keyboard and alt-tab,
514590	516670	but of course that wasn't to be the case.
516670	520510	But to get a shell, we'll need to have explorer execute at boot time.
522570	526410	So the CE application boot sequence is fairly straightforward.
526410	529970	The kernel nkexe runs filesys.exe,
529970	532510	filesys sets up the registry and file system,
532510	537450	and then it executes the applications that are listed in the registry key, hklm, and that.
537450	541530	So the trick is to patch the application we want, execute it into that boot list.
542990	545370	So of course we want to get explorer into the boot list,
545370	547030	and there's two approaches basically.
547030	551310	The first approach assumes you have a copy of the CE ROM image.
551710	555870	The registry file can then be extracted, modified, recompiled into the image.
555870	557710	This requires a way to rewrite the flash,
557710	560310	whether it be serial, ethernet, JTAG, or what have you.
560610	563870	The other approach is to patch in explorer while you're debugging.
563890	566230	And this of course requires some sort of debugging capability,
566230	568030	JTAG, ethernet, serial, et cetera.
569030	571250	So I decided to go with JTAG,
571250	574070	because it's a fairly straightforward way to accomplish our goals.
574270	576270	JTAG is a hardware debugging interface,
576270	579730	which essentially gives you unrestricted debugging access to the processor core.
579990	582370	Now the hardware to do this used to be pretty pricey,
582370	586370	but these days with OpenOCD and some of the open source projects,
586370	588810	you get the needed hardware for less than a hundred bucks.
589130	592310	Now with JTAG access, you can remotely debug with GDB,
592310	594490	debug the kernel, the boot loader, and so on.
594490	596190	Now JTAG has been talked about to death,
596190	597230	and I won't dwell on it.
597230	599690	There's a lot of resources online with a lot more information.
600830	603990	So here's just the hardware debugger connected to the motherboard.
603990	606370	Now it's probably obvious, but the use of hardware debuggers
606370	609130	and things of that nature have absolutely nothing to do
609130	611250	with the ATM attacks that I'll be demonstrating.
611250	614070	They're simply used to initially gain access
614070	617230	so we can then go on to find real vulnerabilities.
621110	623970	Speaking of JTAG, I actually learned a valuable lesson
623970	626090	when I was messing with one of the ATMs.
626090	628530	I had the JTAG hooked up and I was screwing around
628530	631550	and I accidentally wiped out a massive chunk of the firmware
631550	635590	and overwrote all the ATM files on it.
635670	638450	Now at the time I couldn't get a hold of the software to reflash it
638450	640990	because I wasn't an ATM distributor.
641070	644130	So I actually had to call a licensed ATM technician
644130	645990	to come around to my house.
648330	651410	Now three guys arrive and of course they ask again,
651410	653210	you know, why are these ATMs in your house?
653210	655130	And I say, oh, I haven't moved them into my store yet
655130	656330	and all this type of thing.
657030	659950	But anyway, see, what happened? How did you remove all this?
659950	662750	Oh, I had it on a card, I was trying to change a splash screen,
662750	663750	it all just wiped out.
663750	666290	He's like, yeah, no, they'll do that, they'll do that.
668790	671770	You know, so he starts going to work on the ATM.
671770	673790	I'm like, firmware, what is that, mate?
674090	675710	Acting completely stupid.
676070	679050	He ends up teaching me a hell of a lot about hacking ATMs.
679050	681310	I got his business card, we kept in touch.
681310	683770	Unfortunately, after this presentation,
683770	685850	that relationship may be severed.
687950	691550	Oh yeah, so the lesson is always back up the firmware first.
693610	696890	So now that we can debug, we need a way to inject.
696910	698270	With the debugger connected,
698270	700910	simply set a breakpoint on create process.
702030	704490	And the opposite was found by simply dumping the memory
704490	706530	from the ATM and just doing a byte compare
706530	708630	to an offline version of Core DLL.
708890	710910	Now when working with the ARM processor,
710910	712810	the parameters when they pass the function
712810	716150	are passed in registers before they utilize the stack.
716150	718010	So R0 will have the first parameter,
718010	720570	which is the executable, what you want to execute.
720570	721950	We simply replace that string
721950	724810	with what would normally be the ATM executable
724810	727450	and overwrite it with explorer.exe.
727450	730230	Now if explorer doesn't exist on the image,
730230	732650	then you can just put a copy of explorer on a removable drive
732650	736170	and pass that full path to create process.
737290	739990	And so then you get a shell on the ATM.
739990	742510	When I first was playing around with the ATMs,
742510	744790	I was quite excited just to have a little shell on them,
744790	746810	so I had them playing movies and whatnot.
747110	749630	But not really surprisingly,
749630	752430	ATMs are pretty crap for playing movies.
753070	755670	Slow frame rate and the 6-inch screen,
755670	758170	so it will not be replacing the flat screen.
760470	761930	So now with Explorer,
761930	764290	we can plug in a USB drive and a keyboard
764290	766950	and copy off the files for reverse engineering.
766950	770170	Then we can modify the registry so Explorer will always boot.
770370	773130	Now remote debugging with JTAG over GDB
773130	776270	is not the ideal way to debug a Windows machine,
776270	779270	so the next step is to set up a better debugging environment.
779330	781910	And there's a way to debug Windows CE applications
781910	784370	without having ActiveSync installed,
784370	787090	and that's to debug with Visual Studio over Ethernet.
787090	788950	So you simply build an empty project,
788950	790890	overwrite the local executable with the executable
790890	792810	from the device that you want to debug,
792810	795130	set the correct TCP settings,
795130	797590	copy the file over, run it under the debugger,
797590	799870	and you have application debugging with Visual Studio.
799990	801670	So now finally we have everything in place
801670	803110	to be able to reverse engineer the software
803110	804810	to locate vulnerabilities,
804810	808070	but to also test any software that we create for the ATM.
809410	811170	So planning an attack.
811170	813950	There's a fairly limited attack surface really.
813950	815610	We have the card reader,
815610	817090	but assuming we have an overflow
817090	820310	or some other string-based attack via the card tracks,
820310	821730	there's a limited amount of characters
821730	823730	and a very restricted character set.
823730	825590	So I'm not going to say it's not possible,
825590	826850	but I will say it would be unlikely
826850	828730	to be practical or reliable.
829190	830970	The keypad, another long shot,
830970	832910	but maybe there's possible master passwords
832910	835010	or backdoors left in by the developers.
835310	837790	Then the network, so any open ports,
837790	839090	an answering phone line,
839090	840990	any options for a remote attack.
841470	842750	And we also have the various inputs
842750	843990	on the motherboard itself,
843990	846410	but of course this requires access to the motherboard.
848210	850030	So of course progress is never really made
850030	852010	without a few failures along the way,
852010	855450	and in my attempt to come up with a Terminator 2 SCAC,
855450	857090	I made this little device.
857170	858970	It's basically an electromagnet
858970	861930	wired up to an amp which is connected to a media player,
861930	863950	and you create a web file which is created
863950	866250	to simulate the data on a magnetic stripe.
866290	869330	The electromagnet, plug into the ATM,
869330	871770	flick the switch, play the web file,
871770	874610	and the ATM will think of magnetic stripes being read.
874610	875670	Technically it works fine,
875670	877350	but it was actually bugger all help.
880050	881790	So the goal, of course,
881790	883990	is to execute code on the ATM.
884590	886790	So I'll talk about these walk-up attacks first.
886810	889810	Now the cash dispenser is housed at the very least by a safe,
889810	891450	if you take the cheapest option.
891450	893970	If you spend a bit more, you can get even more heavy-duty protection.
894090	895590	The motherboard, on the other hand,
895590	899710	is protected by a one-key-fits-all lock.
901730	905990	And this is actually standard practice across the boards,
906310	909270	and these keys, like almost everything else on the internet,
909270	911890	are easily available to add to cart.
912670	915410	And, funnily enough, there used to be Diebold keys,
915410	917070	last year when I was looking,
917070	918190	but they've since vanished,
918190	920850	but I'm sure with a little creativity they could be found.
920890	925390	As you can see, most manufacturers take this approach.
927650	929150	So, the walk-up attack.
929150	930490	So now with your master key,
930490	933670	you have access to the USB slots and what other inputs.
933670	935710	So you can pop open the motherboard compartment,
935710	937870	insert a USB key in a couple of seconds,
938130	940210	a lot faster than installing a skimmer, right?
940510	942670	Now, even though the attack time here is short,
942670	945110	there's still the possibility of being detected.
945270	946370	But, you know, I suppose that's a great thing
946370	949130	about these retail and stand-alone type ATMs.
949130	950510	They're out by the restrooms,
950510	951610	they're out of sight,
951610	953390	off by the SIGGY machine or something.
953730	955870	And I suppose then there's that psychological aspect
956750	957950	of using an ATM machine.
957950	960550	It's kind of considered rude to look over someone's shoulder.
961090	962590	Unless, of course, you're a criminal,
962590	964830	and then he would probably learn a trick or two anyway.
965450	967170	Now, all ATMs need a way
967170	968670	to upgrade their firmware.
968750	972190	And this is most often leveraged via their removable drives.
972190	973310	So the ATM application
973310	975410	checks the drive for a valid upgrade,
975410	976890	the valid firmware is found,
976890	980010	upgrades, install whatever we decide to add in there.
980130	981270	Now, of course, the firmware
981270	983870	is typically a proprietary format.
984130	985550	There are checksums,
985550	987070	encryption,
987070	988990	and the algorithms are easily figured out
988990	991590	by reversing the code on the ATM side.
991910	993330	So once you can create your own
993330	996130	firmware package that adheres to the correct format,
996130	997610	well, then you can upgrade.
997610	1000370	But upgrade with a few modifications, of course.
1001830	1003510	Now, the most important
1003510	1006070	attack is the remote attack.
1006070	1007290	Now, most, if not all,
1007290	1009490	ATMs that run on a Windows-based OS
1009490	1011590	support some form of remote monitoring
1011590	1013290	or remote configuration.
1013610	1015390	So this allows you to log
1015390	1017450	into your ATM remotely, review
1017450	1019790	or change the settings, get stats,
1019790	1021730	change the splash screens, and so on.
1021730	1023350	Another quite useful feature is
1023350	1026250	the ability to remotely upgrade the software.
1026350	1028170	Now, this is sometimes a feature,
1028170	1029490	but always something you can leverage
1029490	1030910	if you have a vulnerability.
1031210	1033230	Now, obviously, authentication is required
1033230	1035210	to be able to do anything useful.
1035470	1037430	With the particular model I'll be demonstrating,
1037430	1039430	both a serial number and a remote password
1039430	1041510	are required, and they're both made up
1041510	1043810	of a combination of numbers and letters,
1043810	1045550	and a five-second delay is forced
1045550	1047110	after each connection attempt.
1047110	1049570	So a brute force is basically out of the question.
1049570	1051390	So we require vulnerability within
1051390	1052970	the authentication process,
1053410	1055230	and it just so happens.
1055890	1057830	So let me introduce Dillinger.
1057990	1059390	Dillinger is my remote
1059390	1061910	ATM attack or administration tool,
1061910	1063470	whatever way you want to look at it.
1063470	1066050	Dillinger named after the bank robber, of course.
1066730	1067450	So we've
1067450	1069230	talked about loading code on a local
1069230	1071730	ATM machine with a master key and a flash drive
1071730	1073330	and the correctly formed firmware,
1073330	1075270	you're basically set. But the obvious
1075270	1077130	drawback here is you have to interact
1077130	1079330	with the machine itself. So the ultimate
1079330	1081310	win would be able to execute code
1081310	1083230	or load code remotely, and that's
1083230	1084850	where Dillinger comes in.
1085090	1087270	So Dillinger takes advantage of a fairly severe
1087270	1089110	vulnerability in the ATM management
1089110	1091050	capability. And
1091050	1093190	interestingly, although most operators don't
1093190	1095170	use the remote monitoring, it's
1095170	1097250	enabled by default on this
1097250	1098730	particular manufacturer, so
1098730	1100930	shushing! Now,
1100930	1103270	typically to log into the machine remotely
1103270	1105070	we require the knowledge
1105070	1107130	of the serial number and the password,
1107130	1109150	but due to an awesome vulnerability, I can bypass
1109150	1111170	all authentication on the device.
1111590	1113070	And the remote attack is 100%
1113070	1115370	reliable. So Dillinger
1115370	1116910	supports TCP IP
1116910	1118970	and it supports dial-up as well.
1119130	1121010	And I heard through a fairly knowledgeable
1121010	1123190	source that most of these stand-ups,
1123810	1125570	stand-alones,
1125570	1127050	about approximately 95%
1127050	1129370	of them are still on a dial-up connection.
1129470	1131070	Now, of course, back in the day, finding an
1131070	1133090	ATM over the phone line would be a long
1133090	1135070	process of nights and nights
1135070	1137050	of wall dialing, but thanks to tools
1137050	1139030	like H.G. Moore's Wallbox, you can map
1139030	1141550	out modems on exchange in a matter of hours.
1141550	1142870	Then write a custom tool
1142870	1145090	to find the ATM responses and you're
1145090	1145750	away.
1147970	1149370	So, Dillinger features.
1149370	1151150	So Dillinger will allow you to manage an unlimited
1151150	1153570	amount of ATMs through its interface.
1153710	1155030	You can add a group, say you
1155030	1157050	add a city, under the city you
1157050	1158910	add each individual ATM, either
1158910	1160890	its IP address or its phone number.
1160890	1162870	Now, the heart of the tool, of course, is the
1162870	1165110	authentication bypass that it exploits.
1165110	1167090	And this is the stepping stone to be able to do anything
1167090	1168890	useful. So, one
1168890	1170910	feature in Dillinger is to be able to test
1170910	1173210	the bypass in a way which confirms the vulnerability
1173210	1174810	but doesn't actually modify
1174810	1177410	the remote ATM in any way or leave any trace.
1178050	1178930	So, the obvious problem
1178930	1180990	with finding a remote ATM is that you have no
1180990	1183030	idea of the location. So, Dillinger
1183030	1185210	can pull the ATM settings from the device
1185210	1187130	which includes all the master passwords
1187130	1188930	but it also includes the receipt data.
1188930	1190810	And you know when you use an ATM at the bottom of the
1190810	1193010	receipt, it always has the location or the name
1193010	1193950	of the business.
1194670	1196830	So, even if it doesn't have the exact
1196830	1198450	location, it will have the name of the business.
1198950	1201090	And, of course, the best feature is
1201090	1202770	to upload my rootkit.
1203190	1205170	Again, bypasses all authentication,
1205170	1206790	initializes the software, uploads
1207630	1208930	the rootkit, and then
1208930	1210990	basically lets me overwrite
1210990	1212650	the entire firmware of the device.
1213370	1214970	So, in general, someone is going to need to be
1214970	1216890	at the ATM if you want to get any sort of
1216890	1218450	payout. So, again, I
1218450	1220810	added a feature so it would be possible to carry out an
1220810	1222770	attack without ever visiting the ATM
1222770	1225250	at all. So, when someone inserts a card,
1225250	1226630	the track data is captured
1226630	1228930	and saved and I can then retrieve
1228930	1230550	that track data remotely.
1231050	1232830	And finally, the remote jackpot, which
1232830	1234510	kind of speaks for itself.
1236650	1239090	So, Scrooge is the ATM rootkit
1240150	1241190	developed specifically
1241190	1242830	for ATMs running on
1242830	1245030	Windows CE. Scrooge implements
1245030	1247130	the typical rootkit technology
1247130	1249090	you'd expect. Hides itself and its
1249090	1251130	friends by various CE system
1251130	1252970	hooks. Hides itself from the
1252970	1254970	process list. Hides itself from the file
1254970	1256850	system by hooking syscalls and filtering
1256850	1259150	the results. And there's a hidden pop-up
1259150	1260950	menu which can be activated by
1260950	1262830	both a special key sequence on the ATM
1262830	1265170	or by inserting a card with custom
1265170	1267050	track data. Now,
1267050	1269650	it'll run on any ARM or XScale based ATM,
1269650	1271270	Intel with a few tweaks.
1271270	1273030	Originally, I was designing for both Intel and
1273030	1274670	ARM, but it turns out that
1274670	1276910	CE on x86 is actually pretty
1276910	1278970	rare and basically non-existent in the ATM
1278970	1281090	world. So, the code
1281090	1282890	for interfacing the ATMs has to be customized
1282890	1284990	for the different ATMs as they all use
1284990	1287070	different peripherals and kind of non-standard
1287070	1288430	ways of communicating.
1289710	1291110	So, Scrooge's hidden menu.
1291110	1293050	I just use a standard set windows hook
1293050	1294950	filter to capture the side buttons on
1294950	1297030	the ATM. Although set
1297030	1298570	windows hook is actually undocumented
1298570	1301110	in CE, it still exists and it works
1301110	1302970	as expected. So, a combination
1302970	1304990	of keys will trigger the hidden menu and it's
1304990	1307110	varied enough not to be launched by accident,
1307110	1309070	but maybe if there's a kid playing around with the
1309070	1311390	ATM, he may end up scoring big, who knows.
1312270	1313090	And the card
1313090	1315230	reader is hooked by an inline detour
1315230	1316990	style patch. So, this is where you
1316990	1319230	essentially patch a branch instruction into a
1319230	1321250	piece of code you'd like to intercept, the
1321250	1323470	branch jumps to your code, your code
1323470	1326010	executes, then returns the original function.
1326010	1327390	Now, with the hook in place, there's a check
1327390	1329090	on the read buffer for track data
1329090	1331010	that matches gimme the loot,
1331010	1333170	and if it matches, the menu is brought up
1333170	1335350	in that way as well. So, the menu functions
1335350	1337090	are fairly standard for what you'd expect. You can
1337090	1338930	dispense from each cassette, print out
1338930	1341030	stats, which include the remaining bill count,
1341030	1341970	and you can exit.
1344010	1345050	So, yeah, to add
1345050	1346970	my own functionality, I've added a few inline
1346970	1347710	patches.
1349170	1351090	Essentially, you can patch a small assembler stub
1351090	1352790	into the functions you want to hook.
1352910	1355590	The stub then calls a function external DLL,
1355590	1357550	overwrites any overwritten instructions,
1357550	1359210	and then continues as normal.
1359390	1361670	This could be done dynamically, but the fact
1361670	1363410	that the ATM vulnerabilities allow me to
1363410	1365550	replace the executables entirely, we can
1365550	1367470	make these patches permanent, which is actually far more
1367470	1369450	reliable. And it's also a lot easier
1369450	1371530	on ARM, as every instruction is 32 bits long
1371530	1373470	as well. So, I place hooks at
1373470	1375590	the card reader, the pinpad, and the parser
1375590	1377350	that handles remote configuration
1377350	1379450	commands. So, with those hooks, I can now
1379450	1381490	add my own handy features, so I
1381490	1384210	can save the track data, capture the pinpad,
1384210	1385330	have a few custom remote
1385330	1387730	commands. So, pull the track data, sure.
1387890	1389590	Remote jackpot, might as well.
1390830	1391490	Alright.
1391730	1393410	So, there's going to be quite a lot of
1393410	1395430	demos, so I went through that a bit
1395430	1397350	quick, because I think there's probably
1397470	1399390	a good 25 or so minutes of demos.
1399390	1401550	So, I might as well put my money where my mouth is,
1401550	1403830	or the ATM's money where its mouth is, I guess.
1432730	1434710	Okay, so this is Dillinger's
1434710	1435650	interface.
1438740	1440600	I can add a group, so we'll say
1441020	1441740	blackhat.
1445510	1446350	Add an
1446350	1447670	ATM.
1448950	1450890	Barnaby's ATM.
1453900	1456000	Location, onstage
1456000	1457340	at blackhat.
1459040	1459900	And Dillinger
1459900	1461740	supports both dial-up and
1461740	1463460	TCPIP, so
1463460	1465940	in this case, I'm using TCPIP
1465940	1467180	of course.
1468000	1469420	By the way, just to
1469420	1471920	reiterate, this is by default
1474120	1474920	remote functionalities
1474920	1475960	enabled on all of these
1475960	1477520	ATMs as they ship out.
1478260	1480220	This one here at least, not the other one.
1486440	1488000	Okay, so
1488000	1490120	now I can right-click on my ATM,
1490120	1492240	I can then test the bypass,
1492240	1494140	upload the rootkit, reset
1494140	1496160	to default, get the track settings, get ATM
1496160	1497260	settings, etc.
1498020	1500160	So, let's see, I'm trying to think
1500160	1502020	if we should switch to the ATM.
1502900	1504440	You know, not just yet, okay.
1504440	1506000	So, I can test the bypass,
1506000	1508320	connects to the ATM, testing
1508320	1510660	ATM authentication bypass success,
1511000	1512800	and it disconnects.
1514960	1516260	Now, we'll actually blow up the
1516260	1517500	ATMs in a sec, but
1518680	1520200	all that shows on the
1520200	1523160	ATMs is just RMS process.
1523420	1524320	I have to wait till that
1524320	1525520	goes away.
1527720	1528320	So, it's
1528320	1530060	nothing too noticeable, you know, if you're
1530060	1532080	if you see this ATM.
1536030	1537410	Actually, if someone close
1537410	1539030	to the thing could let me know when it's
1540030	1541770	gone? Okay.
1542290	1543390	So, now,
1543390	1545290	the most important feature, of course,
1545290	1547030	is to upload the rootkit.
1548310	1549810	So, we'll upload
1549810	1553950	Scrooge, the final version,
1553950	1555750	connects,
1555750	1557490	sends a bypass successful,
1558250	1559630	initiates upload,
1559630	1561930	and it's uploading it to the ATM now.
1561930	1563650	This is bypassing all authentication
1563650	1565630	in the ATM, and by
1566010	1566410	default.
1571400	1572940	Now, even though it's over the network,
1572940	1574760	it takes a little while, because they have their own
1574760	1576640	proprietary protocol, which
1576640	1578800	acknowledges each packet, and then has a small
1578800	1580460	delay, and so on.
1581140	1582840	Proprietary protocol, of course, has its own
1582840	1584780	proprietary encryption, and you all know what
1584780	1587060	happens when people implement proprietary encryption.
1587920	1588800	It's fairly easy
1588800	1589940	to make your own.
1597460	1598260	Okay, so,
1598260	1600060	when it finishes uploading, the ATM
1600060	1601680	should reboot, and if we could
1601680	1604120	flick to the ATM now, on the
1604120	1604780	screen.
1620390	1621790	Takes a little while, Windows
1621790	1623810	CE, you know, it's not the fastest
1623810	1624910	beast out there.
1639380	1640560	Yeah, if we could just pan
1640560	1642020	out just a bit, too.
1649220	1650180	If we could get the
1650180	1651860	screen and the dispenser.
1658830	1659570	Yeah, that's
1659570	1660210	cool.
1664520	1665520	What's that?
1667320	1668660	Oh, they'll be spitting money,
1668660	1669920	don't worry about that.
1678100	1679060	Okay.
1680740	1681600	Let me make sure
1681600	1683540	I have my little card here.
1686540	1687140	So, as
1687140	1688640	I said, there's two ways
1689520	1691200	to get the remote menu
1691200	1693140	or the hidden menu to pop up. One
1693140	1695180	is with special cards with the track
1695180	1697140	data. So, if we insert...
1701100	1702060	Okay.
1703300	1704080	I always say
1704080	1706060	it's 100% reliable, and why doesn't it
1706060	1706720	work?
1710140	1711940	There we go. Okay, so
1711940	1714180	that card now has popped up my hidden menu.
1714620	1715900	You can dispense 50
1715900	1717980	bills from A, B, C, or D,
1717980	1720200	which are the four cassettes in the dispenser.
1720400	1722020	You can print statistics, which give
1722020	1724180	you the master passwords and so on,
1724180	1726040	or you can exit. So, I'll just
1726540	1727820	dispense 50 from
1727820	1729500	the first cassette.
1748070	1749990	So, these are million
1749990	1752070	dollar bills, but it will...
1752790	1754050	probably not much use at
1754050	1755250	the craps table.
1758680	1759760	The other one
1759760	1761700	will spit out a bit of currency.
1764340	1766260	Okay, so now we can exit,
1766260	1767900	and I said there was a
1767900	1769900	key sequence, which you could also enter to pop
1769900	1775220	up their menu.
1775220	1776160	These buttons are
1776160	1777120	a bit bugged.
1781260	1781920	Let's try
1781920	1782900	that again.
1784000	1785720	I've obviously pressed these
1785720	1788060	buttons a fair few times. There we go.
1788060	1789540	So, we can exit from that too.
1790060	1790840	Okay.
1792520	1793740	So, can we cut
1793740	1795620	back to the computer?
1797940	1799080	Okay, and
1801060	1802020	it would
1802020	1803520	be nice to know where this ATM
1803520	1805540	actually is as well. So, we can
1805540	1807580	retrieve the ATM settings.
1807580	1809600	It connects,
1809600	1811800	retrieves the settings,
1811800	1813640	and saves them to disk.
1818780	1819380	Now,
1819380	1821440	you can see, so
1821440	1823440	up here are the passwords to the
1823440	1824880	ATM itself.
1825080	1827120	I don't actually live on 123
1827120	1829160	Kiwi Street, by the way,
1829160	1831200	but I do live in San Jose.
1831200	1833300	And then it has the phone numbers as well as the
1833300	1835060	IP addresses and
1835060	1837740	the receipt coupons and all that type of thing.
1840640	1841420	Now,
1842000	1843160	of course,
1843160	1845340	one of the greatest things about this
1845340	1847140	is the fact that you can
1847140	1848980	retrieve track data from people who insert
1848980	1851860	cards. So, would anyone like to volunteer?
1855040	1856980	Is Brandon here?
1858420	1859740	There he is.
1859740	1861240	Brandon, I think, has a custom
1861240	1863300	credit card especially for this.
1876550	1877270	So, can we
1877270	1879150	flick to the ATM again, please?
1886270	1886990	Can we cross
1886990	1887930	to the ATM?
1889810	1890750	Okay, so just
1890750	1893530	insert your card as you normally would use an ATM.
1900150	1902050	Alright, thank you, sir.
1902370	1904470	So, back to the computer, please.
1905510	1906550	So, now,
1906550	1908470	let's see if we can get the track data that
1908470	1909750	he just inserted.
1911610	1912650	Connects,
1912650	1913770	retrieves the stripe card
1913770	1916630	data, saves it to disk.
1918490	1919850	Okay, so you can
1919850	1921870	actually see from the
1921870	1923670	first one was the gimme the loot
1923670	1925430	where I actually had
1925970	1927790	my demo card.
1927950	1929930	And then the next track data, this doesn't
1929930	1931810	look like a credit card, Brandon.
1932390	1933970	Doctorate of the Bustacardi
1933970	1936830	with the card leet-leet-leet-leet-leet-leet-leet-leet-leet.
1944100	1946200	But, of course, it will capture any
1946200	1948880	credit card that's entered into the machine.
1950700	1951100	And
1952200	1953400	finally,
1953860	1955900	the remote jackpot, which is
1955900	1958080	always handy. So, go back
1958080	1959380	to the ATM.
1964650	1965830	Issue the jackpot
1965830	1966870	command.
1967470	1968910	We have a winner!
1989020	1989620	Now,
1989620	1991620	before I... I'm not going to
1991620	1993960	let the other one get off scot-free.
1994440	1995340	So, I will
1995340	1998000	quickly demo the walk-up style attack.
1998000	1999700	Now, I'm not as fast as this as I should
1999700	2001400	be, but I will try it anyway.
2002480	2003700	So, remember, the walk-up
2003700	2005620	attack is simply popping open the
2005620	2007700	cabinet, inserting a USB, and
2007700	2008800	restarting it.
2016720	2018720	Right, so that's the attack done. I wouldn't
2018720	2020740	be spotted if I was out by the restroom.
2026290	2027910	I think, just for...
2028970	2029990	just to make it
2029990	2031830	look a little better on stage, I might just
2031830	2034110	open the cabinet here. Not opening the safe,
2034110	2035470	of course, just the cabinet.
2041450	2041930	So,
2041930	2044030	the other attack was somewhat practical.
2044030	2045890	This one, you'd probably end up on
2045890	2047890	World's Dumbest Criminals, as you'll probably see
2047890	2049950	soon. Okay, so
2049950	2051890	it boots. Right now, it should be reading
2051890	2054670	the firmware off that USB drive.
2068060	2069660	It copies the firmware over
2070560	2071960	as it initializes
2071960	2073860	the little BlackHat logo floating around
2073860	2076060	the screen. Obviously,
2076060	2077880	in the real world, it would be a rootkit, not
2078040	2079180	a BlackHat logo.
2081400	2081900	So, I
2081900	2083940	kind of tailored this for both BlackHat and
2083940	2086220	for Vegas, as you'll see.
2103910	2106650	ARM 9 processes are not the fastest.
2123940	2124420	...
2154940	2155420	...
2156800	2157280	...
2157280	2157840	I just want to see
2157840	2159880	how long it actually takes to dump
2159880	2161600	its entire dispenser.
2165490	2166110	It will
2166110	2168130	start with million dollar bills and it's going to
2168130	2170070	switch to IOActive currency, which
2170070	2172470	also doubles as invites for the party.
2172470	2173830	So,
2180280	2181920	I want there to be a big pile
2181920	2182980	at the end.
2183460	2183480	...
2183480	2184060	...
2215410	2215970	...
2215970	2218150	It still hasn't got to the IOActive currency.
2218150	2220210	I should have put that first, I guess.
2220590	2220970	...
2245900	2247380	There we go.
2247680	2248160	...
2256780	2259180	Okay, we can probably flick back to the
2259180	2260980	presentation now.
2262260	2262820	...
2269560	2272040	Okay, so, countermeasures.
2274040	2274600	...
2274600	2275020	...
2275020	2276500	The obvious physical...
2277020	2279140	I may just disconnect the sounds
2279140	2280620	really quick.
2280860	2281580	...
2292150	2292870	...
2293910	2294270	...
2294630	2295210	...
2308320	2310500	So, the obvious physical countermeasure
2310500	2312460	to prevent the walk-up attack is to
2312460	2315420	offer upgrade options on the locks themselves.
2315420	2316520	So, there's a unique
2316520	2318840	key for each ATM.
2318840	2321260	Now, of course, if you want to take this into your own hands,
2321260	2323000	just drill a hole and throw a padlock
2323000	2323840	on it.
2324880	2325320	...
2327100	2327540	...
2329600	2330040	...
2333500	2333940	...
2333940	2334460	...
2335560	2336000	...
2338760	2339200	...
2339200	2339740	...
2340760	2341200	...
2342060	2342500	...
2342500	2343260	...
2345620	2346500	...
2349160	2350560	...
2350560	2350960	...
2354780	2356180	...
2356180	2357040	...
2357040	2357060	...
2357060	2357120	...
2359140	2360540	...
2360540	2362560	...
2362560	2362900	...
2362900	2362980	...
2362980	2366520	And finally, it's time to give these devices a rehaul.
2366600	2370940	There hasn't been a secure development in methodology in from the get-go.
2370940	2374800	So there's a need to play catch-up, have the code audited, have penetration tests,
2374800	2377360	and implement best practices from here on out.
2379680	2385300	So there's been a noticeable surge in the community of researching proprietary devices like ATMs.
2385340	2388840	And the simple fact is that the companies who manufacture the devices aren't Microsoft.
2388840	2392100	They haven't had 10 years of continual attacks against them.
2392100	2398360	So the software that Microsoft got forced into a secure development, they've gotten where they are today.
2398360	2402680	We're talking about devices that were developed without secure principles in mind.
2402680	2407760	I think it's important to dig in, research these devices, find vulnerabilities, find solutions,
2407760	2410600	and ultimately ensure a more secure future.
2410600	2412180	So, cheers.
