00:00:00.125-->00:00:03.583 >>My name is Salvador Mendoza and I'm here to talk about how exploit old mag stripe 00:00:03.583-->00:00:09.500 information with new technology. The idea behind this talk is how to implement audio waves on 00:00:09.500-->00:00:14.500 bluetooth connections. A little bit about myself, I'm a security researcher I lecture- I present 00:00:16.625-->00:00:23.042 Samsung pay, tokenized numbers, flaws and issues here in Def Con. At noon today we're going 00:00:23.042-->00:00:28.042 to use Samsung pay tokens yeah it's for the demos. What exactly is mag stripe information? Well, 00:00:30.625-->00:00:37.208 any kind of capability to store mag stripe information, they have this item where its 00:00:37.208-->00:00:44.000 magnetic particles that could be changed implementing magnetism. But how we can relate mag stripe 00:00:44.000-->00:00:49.000 information with audio files? To do that, we need to, in this case in order to transmit mag 00:00:51.042-->00:00:57.250 stripe information into audio we need to be able to mimic the audio waves from the magnetic 00:00:57.250-->00:01:02.250 field changes when you swipe a card. This kind of waves are F2F signals and they contain zeros 00:01:04.958-->00:01:09.958 and ones that the character can interpret like any kind of character. These characters are 00:01:12.208-->00:01:17.500 of course account numbers, names on the cards, all of that kind of information that you're going 00:01:17.500-->00:01:22.500 to have on the cards. This how it looks an audio spoof or audio file we have many different kind 00:01:25.750-->00:01:30.750 of spikes on them, but what that really means? From Major Malfunction Def Con 14 more than 00:01:33.208-->00:01:38.208 10 years ago, he talked about magstripe madness, and that presentation he said that 00:01:40.333-->00:01:47.042 depending of the space there's going to be zeros and ones and these zeros and ones represent 00:01:47.042-->00:01:52.042 the characters. But of course, how we can transmit this kind of information to the card reader? 00:01:55.167-->00:02:01.833 Last year Weston Hecker present how to brute force hotel keys foils implementing mp3 player. 00:02:01.833-->00:02:06.833 But also, he-he present how to send raw magstripe data with an mp3 player too. So I start 00:02:09.458-->00:02:15.500 researching what kind of technology we need to do that kind of thing. If you try to 00:02:15.500-->00:02:20.792 transmit audio files implementing just the audio by itself you're not going to get 00:02:20.792-->00:02:25.542 anything in the card reader or you're going to get some kind of errors. The key in this attack 00:02:25.542-->00:02:30.542 is the amplifier sounds kind of funny get an amplifier to amplify the signal. So the first 00:02:32.958-->00:02:37.958 demo is scout to use Raspberry Pi and uh one coil from this is the cheapest one, 3 dollars from 00:02:41.625-->00:02:46.625 ebay this has a range for 5 volts to 12 volts how you can transmit magstripe information. 00:02:59.500-->00:03:05.917 The set up is very is basic, you connect the audio to the Raspberry output and connect 00:03:05.917-->00:03:12.333 directly to the amplifier, I'm using an external power source to the amplifier so I don't want 00:03:12.333-->00:03:18.167 to damage my Raspberry Pi and I'm using a coil from my last mag spoof that I used for my 00:03:18.167-->00:03:24.292 last talk at here in Def Con I connect a credit card reader directly to my laptop so 00:03:24.292-->00:03:30.167 basically when I run a a audio spoof or audiofile, I get directly the magstripe 00:03:30.167-->00:03:35.708 information into my terminal. So you can see, the credit card reader how the lights detect the 00:03:35.708-->00:03:40.708 signal and send directly to the terminal. So, after this approach, I was thinking about 00:03:48.333-->00:03:53.500 portability, how we can do some kind of thing like that but to be used in different kind of 00:03:53.500-->00:04:00.000 things. Um, the main idea was, what kind of technology we have that can support audio and could 00:04:00.000-->00:04:06.208 be closed platform? Well, we have bluetooth technology I start buying many different kind 00:04:06.208-->00:04:11.208 of speakers try to implement in this kind of attack and this one specifically has a amplifier 00:04:15.292-->00:04:20.292 built on so we don't need a separate amplifier. So I design a tool I call it BlueSpoof. The 00:04:24.875-->00:04:30.292 BlueSpoof is a tool very not kind of similar to the zamykam carmax spoof because that one 00:04:30.292-->00:04:35.917 implements an i-type 85 microchip and also a motor controller, this one implements 00:04:35.917-->00:04:40.917 a bluetooth speaker board and implements audio files and of course a coil. So, the 00:04:43.250-->00:04:48.250 characteristics of this tool it's cheap, bluetooth supported, 3.7 volts, very portable and 00:04:51.083-->00:04:56.083 accurate. So, what about the demo? So, it can be charged directly from 5 volts like any 00:05:00.625-->00:05:05.625 kind of charger that you have for your cell phones. So, in this presentation I'm creating a 00:05:11.292-->00:05:16.583 well file implementing a track 2 form, the the magstripe information I'm using is a 00:05:16.583-->00:05:21.750 Samsung pay token from my Chase account, please don't use it you're not going to be able to 00:05:21.750-->00:05:23.750 it, I hope so. In this case, I'm clearing the Chase spot well file, I'm connecting to the 00:05:23.750-->00:05:25.750 BlueSpoof like normal, uh blue bluetooth speaker after I connect it I'm going to open 00:05:25.750-->00:05:30.042 Audacity, so I can see the well files from the file I just create. After I open the file, 00:05:30.042-->00:05:35.042 what I'm going to do is I'm going to select the output of Audacity to send the data to the 00:05:48.833-->00:05:53.833 BlueSpoof too. So, you can see the waves in this file, how it looks like. Name of the 00:05:56.208-->00:06:01.208 BlueSpoof registered in my computer is Taken. So, I play like loop play in this attack, 00:06:03.542-->00:06:08.708 what I'm, what I'm trying to do is I'm approaching the BlueSpoof to my credit card reader to get 00:06:08.708-->00:06:14.083 some kind of information. So, you can see how its start detecting the signals when I 00:06:14.083-->00:06:19.958 approach this kind of uh tool. What about on other kind of devices? What about a Huawei 00:06:19.958-->00:06:25.625 cheap smartphone? I'm talking about 20 dollars smartphone. It's already connected to a 00:06:25.625-->00:06:31.625 BlueSpoof tool, so I approach this one to the credit card reader and what happened is it 00:06:31.625-->00:06:37.333 started detecting the signals momentarily and after that it just start regis registering 00:06:37.333-->00:06:42.333 like the other kind of tracks. Uh after this, I'm going to implement an Iphone 6 because 00:06:45.417-->00:06:50.167 all them support blue uh bluetooth connection, we can implement on all kind of 00:06:50.167-->00:06:55.167 devices. Uh, it's kind of cool how the iphone sends a magstripe signal because almost all are 00:06:57.750-->00:07:02.750 not detected in the credit card reader. So, I'm going to play the same well file uh I'm 00:07:05.292-->00:07:10.292 implementing a loop to get a better result in the attack. So, you can see how the text signals 00:07:14.458-->00:07:21.083 the credit card reader. What about the Samsung Galaxy's? Well, they work the same, 00:07:21.083-->00:07:26.083 implementing the blue bluetooth connection to and uh like the iphone's result I can detect 00:07:30.375-->00:07:35.375 almost all the tracts sending by the audio spoof. Well, the question is, how can I implement 00:07:39.500-->00:07:45.625 this kind of attack without downloading any kind of file to my computer or my device. So, 00:07:45.625-->00:07:50.625 the sign in I pro- I call violent mag dot com, I was able to create audio spoof from the 00:07:55.333-->00:08:01.208 web browser so thanks to [inaudible] for this idea. The main point here is to create 00:08:01.208-->00:08:07.250 audio files from the, in the bout server and after that, we can create oh to play the well 00:08:07.250-->00:08:12.375 files from the web server without the necessity of allowing any kind of file. So 00:08:12.375-->00:08:17.958 let's say I have uh I'm using an iphone 6 and example, I'm going to play from the web browser 00:08:17.958-->00:08:24.792 implementing html file support, and you can see in the program how the magstripe is detected by 00:08:24.792-->00:08:31.417 the credit card reader. So let's do it to make a payment, I mean that the main idea of this kind 00:08:31.417-->00:08:36.417 of attack? Let's see it really works in the real time on the life, so I'm going to make a 00:08:38.667-->00:08:44.625 payment in this kind of terminal, it's all ready to take the signal very quickly and I 00:08:44.625-->00:08:49.625 can select the product after that it's going to validate it using a Samsung Pay token, that 00:08:52.708-->00:08:57.875 they say they dont they dont cant use on any other device than Samsung Pay devices. But I 00:08:57.875-->00:09:02.292 get a notification from Samsung that I'm using one of his tokens. Of course, after that 00:09:02.292-->00:09:06.500 you're tired of spoofing, you can connect directly to your original speaker and use it like 00:09:06.500-->00:09:11.500 normal [applause]. So, the question is, how we can use this kind of tool to attack different 00:09:21.500-->00:09:25.917 targets? Let's say, let's put the scenario of Weston Hecker that he was trying to put 00:09:25.917-->00:09:32.875 forward different kind of uh doors, door locks on the hotels. How we can send data, let's say 00:09:32.875-->00:09:39.583 we have two locks on the hotel, we have two BlueSpoofs that we can put one in one lock and the 00:09:39.583-->00:09:45.333 other one in another card reader, so we can send data to both of them simultaneously, so 00:09:45.333-->00:09:52.167 we can see which one can open. Um, in the example I'm using, one of the programs from my 00:09:52.167-->00:09:58.542 laptop called audio media set up in my mac, I'm, I'm going to create a multi output device, I 00:09:58.542-->00:10:04.417 already have two devices, two bluespoofs connected to my computer so I can route them to 00:10:04.417-->00:10:09.417 this multi output device. After that, and the output selection in the sound settings, I select 00:10:11.583-->00:10:16.583 the output. So, let's see a demo, of this one. So in this example, I have two computers, 00:10:22.500-->00:10:28.167 with two credit card readers, I have two BlueSpoofs already connected, and I have my laptop 00:10:28.167-->00:10:33.542 that I, that has the same settings I present today. Uh, I'm going to play an audio spoof 00:10:33.542-->00:10:37.583 file, and you will see in the background uh uh these two computers that take a- t the 00:10:37.583-->00:10:44.000 signal simultaneously. Yeah, play again, I'm using a windows one machine, I'm using a Ubuntu 00:10:44.000-->00:10:49.000 on the other one. So, I'm playing the audio and you can see data tags that tracked in 00:10:52.083-->00:10:57.083 two computers simultaneously. Now, the big question is how we can send different data to 00:11:05.750-->00:11:10.750 different BlueSpoofs. It's kinda challenging. First, I try to use salts from terminal to select 00:11:12.833-->00:11:18.333 the output device, but it didn't work in my computer. So, I started searching and I use 00:11:18.333-->00:11:23.500 Python Sound Device library. You're able to connect to multiple devices, and you can 00:11:23.500-->00:11:28.500 control them, implementing python. So, let's tell you a little bit about the background 00:11:30.792-->00:11:35.792 on Samsung Pay Tokens, where you are making a payment in Samsung Pay, your um, you put the cell 00:11:38.042-->00:11:42.208 phone in offline mode, all of the tokens, some of the part tokens are going to incremental 00:11:42.208-->00:11:46.750 and by the cryptogram is going to be studied. The last part of the token is going to be random 00:11:46.750-->00:11:53.667 numbers three digits. How we can brute force these three digits? Because I know they the tok- um 00:11:53.667-->00:11:57.125 the transaction IDs going to incremental so the next one instead of ten is going to be 00:11:57.125-->00:12:02.125 eleven. So, let's try to make a brute force attack. So, in this example, I'm implementing three 00:12:14.375-->00:12:21.083 different BlueSpoofs simultaneously. I'm connecting to my computer, your laptop, in 00:12:21.083-->00:12:28.000 this case the mac, you can connect uh up to seven, but in this particular case I'm 00:12:28.000-->00:12:33.375 connecting three, but yet I'm going to use two of them. I'm going to put them close to the 00:12:33.375-->00:12:39.917 credit card readers, so you can see oh I think I got they don't occur in my windows computer. 00:12:39.917-->00:12:45.250 So, I'm going to put close to the credit card readers and I'm going to play, I'm going to 00:12:45.250-->00:12:49.792 check the output first, the sound device library, to show you the outputs of the 00:12:49.792-->00:12:54.792 sounds-sounds uh boards. So I have three outputs but I'm just going to use it ID's three and 00:12:58.750-->00:13:05.125 five for this time because they have my BlueSpoof tools. So I want to, I'm going to generate a 00:13:05.125-->00:13:11.167 brute force attack. In this case I'm going to use this token sample, that I mentioned, I'm 00:13:11.167-->00:13:16.167 going to create it a wild files from that. So if the token transaction ID is ten in this 00:13:19.000-->00:13:23.708 one, then, the next one has to be eleven and the random numbers I'm going create is from zero to 00:13:23.708-->00:13:30.417 twenty just an example. After that it's going to generate the wi the well files and it's going 00:13:30.417-->00:13:34.792 to start sending depending on the idea of the speakers, different kind of mag stripe 00:13:34.792-->00:13:39.667 information to one another one. You can see in the background how it going to attack the 00:13:39.667-->00:13:46.208 signal as one and the next one. So, they are different tokens in one terminal and the nother one, 00:13:46.208-->00:13:51.208 one has to be even numbers and they random, and the next one has to be odd numbers. So, after 00:13:53.792-->00:13:58.792 is running this attack, I'm going to approach the camera so you can see the tokens to show 00:14:00.917-->00:14:05.917 you the even numbers are the different between one token and the nother one. I'm giving like 00:14:10.667-->00:14:15.667 two seconds of a slip just to not be too fast. So you can see in- in the back part of the 00:14:18.583-->00:14:24.875 token we have threes, ones, fives, sevens; and these ones are fours, sixes, eights, tens, 00:14:24.875-->00:14:30.833 twelves. So they are different tokens, for different kind attacks. A part for the brute 00:14:30.833-->00:14:35.000 force attacks. And this part of the base that we are making in the attack, we have the track 00:14:35.000-->00:14:40.458 numbers, frequency, padding, base, maximum beats and the name of the well file they are 00:14:40.458-->00:14:45.208 implementing. Of course you can see what kind of speaker we are sending any kind of token. After 00:14:48.417-->00:14:53.417 it's completed, you can see how you get the last token is going to be twenty because that was my 00:14:55.917-->00:15:00.917 last part of the token, the last part of the tech. So, uh this Saturday, I'm going to present 00:15:10.958-->00:15:15.583 demo labs this took I call zamykam and our zamykam card. It's about mag stripe 00:15:15.583-->00:15:20.458 information and how to implement BlueSpoof together with this tool, so you are welcome to be 00:15:20.458-->00:15:25.458 there. Thank you to all these guys for support. Please, you have any questions, feel free to 00:15:29.625-->00:15:34.625 ask me. [applause]