00:00:00.067 --> 00:00:02.970 My name is Craig. I'm a security researcher with Tripwire Work 00:00:02.970 --> 00:00:08.876 Group I write content for IP360 scanner and do a lot of 00:00:08.876 --> 00:00:13.247 vulnerability research in my free time and at work. Today I'm 00:00:13.247 --> 00:00:16.350 going to talk to you not about vulnerabilities but rather how 00:00:16.350 --> 00:00:19.519 to work with some of the tools that are out there for RFID 00:00:19.519 --> 00:00:23.023 hacking. So I accumulated with Bert a number of tools for 00:00:23.023 --> 00:00:27.427 working with high frequency RFID and I've noticed there is not 00:00:27.427 --> 00:00:29.930 really a lot of consistent documentation out there for some 00:00:29.930 --> 00:00:33.233 of these tools. People release patches for adding new 00:00:33.233 --> 00:00:36.370 functionality for various thing bus it doesn't often get a lot 00:00:36.370 --> 00:00:39.840 of documentation for it. You can read through the source code and 00:00:39.840 --> 00:00:42.709 figure things out but I wanted to make things easier for 00:00:42.709 --> 00:00:45.946 people. And then I wanted to look at ways I could use the 3D 00:00:45.946 --> 00:00:49.149 printer that we have to try to enhance some of the practical 00:00:49.149 --> 00:00:53.420 attacks that you have with RFID tools and also look at some of 00:00:53.420 --> 00:00:55.722 the different options that you have or opportunities for 00:00:55.722 --> 00:00:58.992 research through that. What we're going to go through here, 00:00:58.992 --> 00:01:02.195 I'm going to overview the tools that I'm working with for this 00:01:02.195 --> 00:01:06.633 project. Go through some of the basics of how RFID functions, 00:01:06.633 --> 00:01:10.170 some of the basic 3D printing functions and we'll get into 00:01:10.170 --> 00:01:14.775 firmware changes that I made to the Proxmark3 and how these 00:01:14.775 --> 00:01:17.945 changes were made. This is actually documented in a lot 00:01:17.945 --> 00:01:20.180 more detail in a white paper that is going to be available on 00:01:20.180 --> 00:01:23.216 the DEFCON site and then we'll get into the 3D printing stuff 00:01:23.216 --> 00:01:26.420 and look at how you can make antennas and how you can conceal 00:01:26.420 --> 00:01:31.491 different tools with 3D printed objects. These are the tools 00:01:31.491 --> 00:01:35.095 that we have going on for this. You have the RFID tools over 00:01:35.095 --> 00:01:39.967 here. The Proxmark3 is your Swiss army knife for all things 00:01:39.967 --> 00:01:43.870 RFID in the low frequency and high frequency bands at least. I 00:01:43.870 --> 00:01:50.444 have below that the PN533USB stick. It's an NXP set on a USB 00:01:50.444 --> 00:01:54.815 stick. And finally on the bottom there is the RFIDler V22 board 00:01:54.815 --> 00:01:59.319 which I obtained at DEFCON last year. Moving over to the 00:01:59.319 --> 00:02:04.624 embedded computing tools, we have the USB armory which is a 00:02:04.624 --> 00:02:08.395 little thumb stick computer and raspberry pie board that I was 00:02:08.395 --> 00:02:12.199 looking at. Finally, for the 3D printing I was using primarily 00:02:12.199 --> 00:02:17.104 cube probe 3D printer which we acquired in the office. Getting 00:02:17.104 --> 00:02:20.607 right into it. The Proxmark3 for anybody that doesn't know, this 00:02:20.607 --> 00:02:23.744 is a board that was developed as part of a Ph.D. thesis but 00:02:23.744 --> 00:02:26.780 someone who was analyzing the transit cards in their city. As 00:02:26.780 --> 00:02:31.018 I said it does low frequency and high frequency support. At the 00:02:31.018 --> 00:02:34.521 heart of it you have a ZYLINX (ph.) [indiscernible] 2GA. This 00:02:34.521 --> 00:02:37.557 is what's used for doing the precise timings that are needed 00:02:37.557 --> 00:02:41.495 to do effective NFC communication or high frequency 00:02:41.495 --> 00:02:45.966 RFID communication. It also is providing spy interface and NSSP 00:02:45.966 --> 00:02:51.371 interface for transferring data and commands. The heart of that 00:02:51.371 --> 00:02:55.609 -- or the app mill micro controller. Something similar to 00:02:55.609 --> 00:02:58.078 what you might find on an Adwardino (ph.) board. This is 00:02:58.078 --> 00:03:00.981 actually what's handling the communication from the computer 00:03:00.981 --> 00:03:05.419 and relaying commands over the FPGA as needed. And doing 00:03:05.419 --> 00:03:09.623 demodulation and decoding. Most of the heavy lifting happens in 00:03:09.623 --> 00:03:12.359 C code in there. You don't have to worry so much about the 00:03:12.359 --> 00:03:16.697 verilog. It goes on in the FPGA unless you want to do low level 00:03:16.697 --> 00:03:21.034 stuff with changing around the NFC modulator keys. You've got 00:03:21.034 --> 00:03:25.605 an 8-bit ADC, an analog digital converter which gives you a 40 00:03:25.605 --> 00:03:29.309 mega sample per second bit rate on there. And it receives its 00:03:29.309 --> 00:03:32.813 commands over a spy interface. The connectors on the board, 00:03:32.813 --> 00:03:36.383 you've got mini USB that you're using for powering it and also 00:03:36.383 --> 00:03:40.520 for data transfer and you have a high rows connector. This has 00:03:40.520 --> 00:03:43.690 four wires on it. Two for a low frequency coil and two for a 00:03:43.690 --> 00:03:47.894 high frequency coil. And then you've got a number of different 00:03:47.894 --> 00:03:50.664 human interfaces for it. You have a push button that gives 00:03:50.664 --> 00:03:55.368 you input to it and 4LEDs for taking output from it, different 00:03:55.368 --> 00:03:57.871 colors. This tells you the status that the device is in 00:03:57.871 --> 00:04:00.974 while you're working with it. Some of the commands that are 00:04:00.974 --> 00:04:04.144 very helpful for this have been added recently, like the LF 00:04:04.144 --> 00:04:07.347 search and HF search. These give you opportunities for 00:04:07.347 --> 00:04:10.350 identifying a tag that you don't know what kind of tag it .S also 00:04:10.350 --> 00:04:13.153 have the commands here for reading in a wave form for a low 00:04:13.153 --> 00:04:18.358 frequency tag. Reading NFC tags the ISO14A standard. And also 00:04:18.358 --> 00:04:20.861 some commands here for cracking the encryption on my fair 00:04:20.861 --> 00:04:25.766 classic cards. The USB stick that we're talking about here, 00:04:25.766 --> 00:04:30.437 this is one of many LIBNFC compatible USB sticks. It 00:04:30.437 --> 00:04:35.208 supports a wide range of NFC and not a lot to say about that. 00:04:35.208 --> 00:04:37.978 Some commands here that you might find helpful for working 00:04:37.978 --> 00:04:42.749 with LIBNFC. For doing various emulation, reading tags, relay 00:04:42.749 --> 00:04:47.521 attacks and also you can use LIBNFC to do more advanced 00:04:47.521 --> 00:04:50.123 functionality through scripting of course. Sending out 00:04:50.123 --> 00:04:52.125 [indiscernible] messages if you want to do fuzz testing on 00:04:52.125 --> 00:04:55.996 Android. The RFIDler board finally on the RFID tools, this 00:04:55.996 --> 00:05:00.667 is a low frequency tool. You have a lot of LEDs for output, a 00:05:00.667 --> 00:05:05.238 pick 32 is the heart of it. And then you've got two banks, or a 00:05:05.238 --> 00:05:08.642 bank of digital potentiometers which are used for adjusting 00:05:08.642 --> 00:05:11.878 thresholds on the reads. Here are some of the common commands 00:05:11.878 --> 00:05:14.181 that you would find on that. This is of course in the white 00:05:14.181 --> 00:05:18.418 paper as well. A late comer to this project know was the 00:05:18.418 --> 00:05:22.923 chameleon mini. This is a platform for working with an 00:05:22.923 --> 00:05:26.293 emulating contact with smart cards. It was developed at the 00:05:26.293 --> 00:05:29.996 Rohr university in [indiscernible] and recently was 00:05:29.996 --> 00:05:33.200 started shipping from risk Corp. But you can also grab the 00:05:33.200 --> 00:05:36.670 schematics and fab this board yourself. Looks like this. USBs 00:05:36.670 --> 00:05:41.274 for power and data and also you have a reprogramming port, PDI 00:05:41.274 --> 00:05:46.780 headers but you don't generally need to use that so often. On 00:05:46.780 --> 00:05:50.250 the embedded devices, the raspberry pie I think everybody 00:05:50.250 --> 00:05:53.887 in this room is probably familiar with. USB armory is the 00:05:53.887 --> 00:05:57.791 little thumb stick which also has an [indiscernible] host 00:05:57.791 --> 00:06:02.329 adapter so you can use this as a client or a host in the USB 00:06:02.329 --> 00:06:06.333 mode. Now the 3D printer that we have, the cube probe, this is 00:06:06.333 --> 00:06:10.570 one of the larger build areas that I see in the consumer 00:06:10.570 --> 00:06:15.475 market. And it has the ability to go down to 70-micron layers. 00:06:15.475 --> 00:06:18.578 And supports several different materials. When you're working 00:06:18.578 --> 00:06:21.381 with this printer, the first step is going to be you want to 00:06:21.381 --> 00:06:23.516 draw up your model in a CAD program, just like you would 00:06:23.516 --> 00:06:28.355 with any CNC or 3D printing process. But then unlike the 00:06:28.355 --> 00:06:31.391 maker bot for example which many people are familiar with, on 00:06:31.391 --> 00:06:34.094 this one you're going to put down a coating of water-soluble 00:06:34.094 --> 00:06:39.165 glue. You put that into the printer and you have an extruder 00:06:39.165 --> 00:06:43.737 that is going back and forth depositing one layer of whatever 00:06:43.737 --> 00:06:47.107 thickness you wanted onto the board as the build plate moves 00:06:47.107 --> 00:06:50.810 down so that your project moves off from it. In the end you can 00:06:50.810 --> 00:06:54.114 pull it off with some hot water that dissolves the glue. There 00:06:54.114 --> 00:06:56.683 are some problems with 3D printing. You can't just draw 00:06:56.683 --> 00:06:59.819 anything you want and print it. And you do have to worry about 00:06:59.819 --> 00:07:02.322 machine maintenance up here on the screen, that is a picture of 00:07:02.322 --> 00:07:08.962 the extruder or the driver for the extruder on power cube pro. 00:07:08.962 --> 00:07:11.865 There is some debris in there. When you get debris in there it 00:07:11.865 --> 00:07:17.971 can lead to clogs within the print jet which are not fun. But 00:07:17.971 --> 00:07:21.908 RFID, that's what we're here to talk about. So to build a little 00:07:21.908 --> 00:07:25.211 basis of this there is low frequency text. These run around 00:07:25.211 --> 00:07:30.684 125 kilohertz. Primarily access controls, also pet tags, vehicle 00:07:30.684 --> 00:07:34.054 immobilizer technologies that work in this range. And then you 00:07:34.054 --> 00:07:37.457 have the high frequency class. This is where NFC falls in. 00:07:37.457 --> 00:07:41.127 Access control, contactless payment cards, the German 00:07:41.127 --> 00:07:44.664 identification cards, U.S. passports, these all have high 00:07:44.664 --> 00:07:48.501 frequency tags in them. When you open up one of these, what 00:07:48.501 --> 00:07:52.872 you're going to find a coil of wires that is tuned to work and 00:07:52.872 --> 00:07:56.810 make an LC circuit or an LC tank with the little chip that you 00:07:56.810 --> 00:08:00.980 see there in the corner. What this means is that when you put 00:08:00.980 --> 00:08:04.084 this into a field that it's tuned for, like the 125-kilo 00:08:04.084 --> 00:08:06.453 hertz, it's going to draw some power, power up the chip and the 00:08:06.453 --> 00:08:10.190 chip is going to be able to dampen and undampen, open and 00:08:10.190 --> 00:08:13.026 close the circuit so that the reader on the other side is 00:08:13.026 --> 00:08:16.396 going to be able to see modulations in the wave form. 00:08:16.396 --> 00:08:20.400 These are common modulations for many RF applications. Not going 00:08:20.400 --> 00:08:23.636 to get into that. When you want to clone an RFID tag, you're 00:08:23.636 --> 00:08:28.375 going to work with the T55XX tags. These are like, you can 00:08:28.375 --> 00:08:34.013 buy these over in the vendor area. I think you get 10 cards 00:08:34.013 --> 00:08:38.318 for $30 so they're not too expensive. You have a support 00:08:38.318 --> 00:08:41.454 for a couple different modulation schemes. And what you 00:08:41.454 --> 00:08:45.325 also have is pre-programmable EPOMs (ph.). So you're able to 00:08:45.325 --> 00:08:48.261 throw on a configuration for this and tell it what type of 00:08:48.261 --> 00:08:53.066 data rate you want, what type of modulation scheme you want, and 00:08:53.066 --> 00:08:56.302 also how many blocks you're going to use for the demodulated 00:08:56.302 --> 00:09:00.707 buffer. If you want to work with one of these using the Proxmark 00:09:00.707 --> 00:09:04.210 to clone a tag that you don't know, you can start by doing the 00:09:04.210 --> 00:09:06.980 olive search command. It's going to read examples and try to 00:09:06.980 --> 00:09:10.216 demodulate until it finds the tag. When it does find it you'll 00:09:10.216 --> 00:09:13.253 see a report letting you know what the tag format is, the ID, 00:09:13.253 --> 00:09:17.357 you can see here we have an HID tag with dead beef on it. And 00:09:17.357 --> 00:09:20.727 then we can use this print de-Mod buffer command which was 00:09:20.727 --> 00:09:25.465 recently added in the past year to Proxmark. This will give you 00:09:25.465 --> 00:09:29.169 the bytes that the tag is sending out. You can break these 00:09:29.169 --> 00:09:31.871 down and split them up into the blocks that you need to put on 00:09:31.871 --> 00:09:37.076 the T55 tag. And then you still need the block 0. The 00:09:37.076 --> 00:09:40.680 configuration block. So you can obtain this by going through the 00:09:40.680 --> 00:09:44.384 data sheets for the T55 card as well as the tag that you're 00:09:44.384 --> 00:09:48.188 working with or you can try and decipher those values. But you 00:09:48.188 --> 00:09:51.925 generally don't need to do this because the Proxmark forums have 00:09:51.925 --> 00:09:54.828 lots of detailed information telling you the blocks that you 00:09:54.828 --> 00:09:58.231 need to set up for these. So you can see the configuration for 00:09:58.231 --> 00:10:01.901 the HID tag right there. And then now that we have that 00:10:01.901 --> 00:10:04.704 information you do a series of right commands and you have a 00:10:04.704 --> 00:10:08.675 cloned tag. We can read it back in and you see that it is in 00:10:08.675 --> 00:10:13.079 fact cloned. Moving on quickly to the NFC end of things. One of 00:10:13.079 --> 00:10:17.250 the popular formats here is my fare which we're going to work 00:10:17.250 --> 00:10:21.421 on today. These are tags that have some UID, four bytes, 7 00:10:21.421 --> 00:10:25.024 bytes and some amount of data, possibly some security features. 00:10:25.024 --> 00:10:28.428 They get used in all sorts of places. Hotel key cards which 00:10:28.428 --> 00:10:33.766 we'll look at cloning today, payment cards, lots of places. 00:10:33.766 --> 00:10:37.937 For cracking these cards, one of the earliest formats of them 00:10:37.937 --> 00:10:41.808 were my fare classic and it was discovered that you could launch 00:10:41.808 --> 00:10:45.778 an attack where you power up the card and repeatedly get the same 00:10:45.778 --> 00:10:51.017 nods and perform a cryptographic attack on it. Once you've 00:10:51.017 --> 00:10:53.853 recovered one of the keys you can then launch a nested attack 00:10:53.853 --> 00:10:58.191 and actually, you can recover all of the keys for one of these 00:10:58.191 --> 00:11:02.495 cards, like what you might find on a train pass in under a 00:11:02.495 --> 00:11:05.465 minute. And then you can use what are called magic cards 00:11:05.465 --> 00:11:09.202 which are fully reprogrammable to write the data that you found 00:11:09.202 --> 00:11:12.171 and make for all intents and purposes a clone of that 00:11:12.171 --> 00:11:16.543 original card. This is really why you don't want to every use 00:11:16.543 --> 00:11:19.112 an application like that locks in on the table over there 00:11:19.112 --> 00:11:24.918 that's only going to use a UID for validation. If you want to 00:11:24.918 --> 00:11:28.121 clone for example my fare ultra light card, something you might 00:11:28.121 --> 00:11:32.792 see in hotel key cards for example, you can use LIBNFC is a 00:11:32.792 --> 00:11:38.031 very effective tool. Commands up here using an MFCMF ultra light. 00:11:38.031 --> 00:11:41.267 You can also of course scan a tag with your phone and you have 00:11:41.267 --> 00:11:45.505 the bytes from it, you can then enter those bytes into a file, 00:11:45.505 --> 00:11:51.377 write that onto a tag that you want. I was using tags from 00:11:51.377 --> 00:11:55.882 clonemykey.com. Some of the things you can clone, you have 00:11:55.882 --> 00:11:59.118 hotel cards, you've also got as we learned this week at black 00:11:59.118 --> 00:12:02.021 cat, the possibility of being able to use some of these tools 00:12:02.021 --> 00:12:06.826 to clone transactions on the EMD credit cards. Because they have 00:12:06.826 --> 00:12:10.997 some legacy support in there. Also Android smart unlock tags 00:12:10.997 --> 00:12:14.701 and as I mentioned the Samsung NFC locks. These are only 00:12:14.701 --> 00:12:19.772 validating UID so it's very easy to break those. You can see here 00:12:19.772 --> 00:12:23.610 what it looks like if we're using a cloned key card. 00:12:23.610 --> 00:12:29.082 Unmarked. But clearly it opens the door. So now getting into 00:12:29.082 --> 00:12:32.785 the firmware hacking aspects of this project. One of the things 00:12:32.785 --> 00:12:35.622 that I wanted to do is work with both high frequency and low 00:12:35.622 --> 00:12:39.993 frequency and I figured that one of the useful applications for 00:12:39.993 --> 00:12:44.330 me would be working with NFC tags in the stand alone offline 00:12:44.330 --> 00:12:48.501 mode. So I went ahead and worked on writing code for capturing 00:12:48.501 --> 00:12:54.073 the tags and doing a clone to a magic card of the UID. Also 00:12:54.073 --> 00:12:56.943 replaying of the UID. This can be extended fairly easily 00:12:56.943 --> 00:13:02.081 towards data sections on the card as well. So the initial low 00:13:02.081 --> 00:13:06.719 frequency mode of the Proxmark stand alone, this is flowcharted 00:13:06.719 --> 00:13:11.691 out by the Prox group white paper. You hold down a button, 00:13:11.691 --> 00:13:16.663 flash some lights and through holding the button or pushing 00:13:16.663 --> 00:13:19.565 the button you can manipulate whether you're in a play back 00:13:19.565 --> 00:13:25.638 mode or if you're in a clone mode. Cloning to a T55 tag. Now, 00:13:25.638 --> 00:13:27.940 when you look through the source code this is all in the white 00:13:27.940 --> 00:13:30.977 paper of course, but you're going to find that everything 00:13:30.977 --> 00:13:34.013 runs on the arm processor of course for this. There's a 00:13:34.013 --> 00:13:38.317 function SAME run which makes use of variation functions 00:13:38.317 --> 00:13:41.654 available to the arm processer through for the HID 00:13:41.654 --> 00:13:45.358 functionality. When we want to go over to high frequency, 00:13:45.358 --> 00:13:48.161 however, I wanted to try to reproduce as much of that 00:13:48.161 --> 00:13:53.232 functionality as possible with the focus on my fare cards. And 00:13:53.232 --> 00:13:59.138 not just may fare classic of course. The ability to clone the 00:13:59.138 --> 00:14:02.542 UID onto my fare classic was implemented though. Here is some 00:14:02.542 --> 00:14:06.879 of the set up functions that you need for working with high 00:14:06.879 --> 00:14:10.583 frequency tags, selecting them, getting yourself in reader mode 00:14:10.583 --> 00:14:14.420 and then for simulating. The most interesting part of this I 00:14:14.420 --> 00:14:18.991 think was I decided to go ahead with a different work flow for 00:14:18.991 --> 00:14:21.861 how this was going to happen. In the low frequency mode for 00:14:21.861 --> 00:14:25.264 Proxmark, for anybody that used it, you might have noticed that 00:14:25.264 --> 00:14:29.235 you can jump right into the play back mode with uninitialized 00:14:29.235 --> 00:14:32.605 data. You're jumping into the stand alone but then you have to 00:14:32.605 --> 00:14:35.708 hit a button again before you get into read mode. I decided to 00:14:35.708 --> 00:14:40.313 get rid of that and instead jump right into the record mode. And 00:14:40.313 --> 00:14:44.016 when you read a tag, jump into play back mode. Use this as the 00:14:44.016 --> 00:14:47.620 hopping point for your other functions through a button press 00:14:47.620 --> 00:14:51.023 or a button hold and also added in some sanity checks so you 00:14:51.023 --> 00:14:53.860 never use an uninitialized value and you also wouldn't 00:14:53.860 --> 00:14:57.597 inadvertently fill your banks with the same card. I do have a 00:14:57.597 --> 00:15:00.666 demo here of this but I'm going to hold off on doing that 00:15:00.666 --> 00:15:04.537 because I have a lot of slides and not as much time. If there 00:15:04.537 --> 00:15:07.306 is time at the end I'll come back to that. Otherwise if 00:15:07.306 --> 00:15:10.743 anybody would like to see this you can hit me up on Twitter or 00:15:10.743 --> 00:15:15.882 tap me on the shoulder or whatever it might be. The second 00:15:15.882 --> 00:15:19.519 component of my firmware hacking I wanted to add support for a 00:15:19.519 --> 00:15:22.288 firm tag support that wasn't in Proxmark. And let's learn how to 00:15:22.288 --> 00:15:26.025 do that and be able to document this with really editorial like 00:15:26.025 --> 00:15:29.095 examples so that other people would be able to go back and add 00:15:29.095 --> 00:15:31.597 support for other tag formats that they might be interested 00:15:31.597 --> 00:15:36.068 in. In order to do this, I decided I would make the LFA 00:15:36.068 --> 00:15:40.706 wood context for Proxmark. This means cloning most of the 00:15:40.706 --> 00:15:45.778 functionality that you would have in the HID mode. Writing 00:15:45.778 --> 00:15:49.849 things to T55 tags based on the numbers printed on the tag. 00:15:49.849 --> 00:15:54.120 Because if you see here on the printout of that tag, it's 00:15:54.120 --> 00:15:56.522 screen printed with all the information that you need for 00:15:56.522 --> 00:16:00.126 being able to clone it or assimilate it whereas most tags 00:16:00.126 --> 00:16:02.929 you're going to have an ID number but it's not going to 00:16:02.929 --> 00:16:05.464 disclose all of the information that you need like the facility 00:16:05.464 --> 00:16:10.303 code and the card number rather. So since there was no support in 00:16:10.303 --> 00:16:13.506 this one, I started looking. I decided it would be a great 00:16:13.506 --> 00:16:20.112 place to work on. So the AWID26 bit format, that's what I 00:16:20.112 --> 00:16:23.182 specifically targeted. This is comprised of an 8 bit facility 00:16:23.182 --> 00:16:27.720 code and a 16 bit card number. Now that's only 24 bits but the 00:16:27.720 --> 00:16:33.693 other 2 bits come from parody. And the card is going to work 00:16:33.693 --> 00:16:38.831 with the same parameters actually as an HID tag. It's got 00:16:38.831 --> 00:16:43.870 this FSA2A which means RF50 data rate and it's specifying a 00:16:43.870 --> 00:16:46.005 certain number of cycles that you're going to go through with 00:16:46.005 --> 00:16:49.375 the higher frequency to indicate a logical low versus a logical 00:16:49.375 --> 00:16:54.647 high. And then when we want to add the commands into the 00:16:54.647 --> 00:16:57.149 Proxmark you have to understand there is a command table 00:16:57.149 --> 00:17:00.019 structure, things are hierarchical, so you just need 00:17:00.019 --> 00:17:04.056 to add a definition in your new file that you're creating and 00:17:04.056 --> 00:17:07.560 within the functionality that's actually going to be called, 00:17:07.560 --> 00:17:10.229 you're creating a USB command structure and sending that off 00:17:10.229 --> 00:17:14.367 to the FPGA. So you can see here how it looks, this code is all 00:17:14.367 --> 00:17:18.537 by the way in GitHub already. And it's under the master branch 00:17:18.537 --> 00:17:23.309 for Proxmark. You can see here the FSKD mod functionality and 00:17:23.309 --> 00:17:26.312 on the slide here are some of the functions that you need for 00:17:26.312 --> 00:17:30.683 working with that. In order to move beyond this into the clone 00:17:30.683 --> 00:17:34.120 and simulate functions, I needed to develop a function to take 00:17:34.120 --> 00:17:37.790 those numbers printed on the card and convert that into the 00:17:37.790 --> 00:17:43.329 YGAND (ph.). For this, I decided it should stay within the client 00:17:43.329 --> 00:17:46.499 code. Doesn't make sense to have this down on the arm chip where 00:17:46.499 --> 00:17:50.236 it's going to take up space and the arm is never going to know 00:17:50.236 --> 00:17:55.908 anything about these numbers anyway. Or I was then able to go 00:17:55.908 --> 00:17:59.078 right ahead into doing the LFA with clone functionality. Which 00:17:59.078 --> 00:18:03.983 is piggybacking on the T55X commands under the covers and 00:18:03.983 --> 00:18:07.887 also showing to you as you see the blocks that its calculated 00:18:07.887 --> 00:18:12.725 that you need to program onto the card. The simulate function 00:18:12.725 --> 00:18:17.129 also has no purpose within the arm so this lives in the client 00:18:17.129 --> 00:18:20.533 code. And you can see up here the parameters that you need to 00:18:20.533 --> 00:18:24.003 specify and the commands. There is a lot more detail about that 00:18:24.003 --> 00:18:28.507 in the white paper. But now the antenna construction. This is 00:18:28.507 --> 00:18:31.978 where we get into 3D printing and the applications there. When 00:18:31.978 --> 00:18:35.815 I start -- I was always interested in making an antenna 00:18:35.815 --> 00:18:40.252 for my Proxmark and for other tools but I noticed that the DIY 00:18:40.252 --> 00:18:46.492 projects out there felt too artsy-craftsy for me, maybe 00:18:46.492 --> 00:18:49.161 there is a bit of trial and error going on there. I thought 00:18:49.161 --> 00:18:52.965 I might be able to do better with making 3D printed forms for 00:18:52.965 --> 00:18:57.403 that. And that's what I did exactly. So to make a coil for 00:18:57.403 --> 00:19:02.408 the Proxmark you take wire, very thin, thinner than the strand of 00:19:02.408 --> 00:19:06.912 your hair, like 40 gauge wire. And you want to coil that around 00:19:06.912 --> 00:19:12.018 a form to make your coil, or wind it around a coil. So you've 00:19:12.018 --> 00:19:15.554 got some functions that you can find for going between the 00:19:15.554 --> 00:19:17.623 frequency and the inductance that you need based on the 00:19:17.623 --> 00:19:21.360 capacitance in your circuit. You've also got some functions 00:19:21.360 --> 00:19:28.267 or some equations from white paperers out there explaining if 00:19:28.267 --> 00:19:32.972 relationship between the number of turns and the dimensions of 00:19:32.972 --> 00:19:38.844 your form to the inductance. With all of that, I went and 00:19:38.844 --> 00:19:42.648 looked and I saw there was a nice design for an LF badge on 00:19:42.648 --> 00:19:46.352 the Proxmark website but it was using, cutting out CD cases, 00:19:46.352 --> 00:19:49.822 glueing them together, stuff that I didn't really want to go 00:19:49.822 --> 00:19:53.559 through. So I took that design and basically just drew it in 00:19:53.559 --> 00:19:57.229 some cad software, print it out and found that it worked really 00:19:57.229 --> 00:20:03.769 quite well. It took around 87 turns for the Proxmark, about 57 00:20:03.769 --> 00:20:06.839 turns for the RFIDler. But you would find if you wanted to 00:20:06.839 --> 00:20:10.810 reproduce that it's varies a bit due to the nature of the system. 00:20:10.810 --> 00:20:14.513 But all those equations fortunately don't really matter 00:20:14.513 --> 00:20:17.850 all that much as long as you have enough turns, you plug it 00:20:17.850 --> 00:20:21.487 in, you try and tune your thing so you see what frequency it's 00:20:21.487 --> 00:20:24.356 optimal at, what voltages you're getting out of it and then you 00:20:24.356 --> 00:20:27.793 simply unwind it one by one until you get to the frequency 00:20:27.793 --> 00:20:31.731 that you want. You can see here the antenna that came out from 00:20:31.731 --> 00:20:36.268 this, it was, I tuned it exactly for 125-kilo hertz and it 00:20:36.268 --> 00:20:38.938 actually worked better than the commercial antenna that I had 00:20:38.938 --> 00:20:43.642 already paid $60 for. Whereas that antenna was picking up at 00:20:43.642 --> 00:20:49.115 its optimal voltage 29.43 I was getting 31.2. I know you can get 00:20:49.115 --> 00:20:53.352 a lot higher than that even. But in badge worked very effectively 00:20:53.352 --> 00:20:57.690 or this card worked very effectively for me. I then went 00:20:57.690 --> 00:21:03.395 ahead and added a lanyard clip to it. And made something that 00:21:03.395 --> 00:21:07.433 looks like this. This actually broke on me. Word to the wise, 00:21:07.433 --> 00:21:11.303 that those -- that 40 gauge wire, very, very thin, you want 00:21:11.303 --> 00:21:14.607 to do everything you can to reinforce that, hot glue, higher 00:21:14.607 --> 00:21:18.110 gauge wire, these are your friends in this. But in the end 00:21:18.110 --> 00:21:23.282 this was a very inexpensive build even going out through 00:21:23.282 --> 00:21:26.886 shape ways, you can use the model that is on GitHub now and 00:21:26.886 --> 00:21:34.193 have this printed for $7.68 for your shipping and handling. With 00:21:34.193 --> 00:21:38.531 the cube probe printer, it costs maybe $4 to print out the form 00:21:38.531 --> 00:21:42.568 for it. And if you actually had like a maker bot that you can 00:21:42.568 --> 00:21:47.740 feed filament into, you can do this for well under a dollar. 00:21:47.740 --> 00:21:51.243 And then I cut up a lanyard and a cable and made it so I could 00:21:51.243 --> 00:21:53.445 have the cable going down through my shirt into the 00:21:53.445 --> 00:21:57.716 Proxmark in my pocket and out of sight and looking like an actual 00:21:57.716 --> 00:22:02.655 badge with a sticker with my picture on it. The next project 00:22:02.655 --> 00:22:07.693 that I looked at here was the clip Pone (ph.). A lot of people 00:22:07.693 --> 00:22:12.765 talk about using clipboards and pen testing situations for RFID. 00:22:12.765 --> 00:22:17.136 So I decided to see what I could do with the fact that I now have 00:22:17.136 --> 00:22:21.207 three printable antennas that could be kind of fit into my 00:22:21.207 --> 00:22:25.110 thing. And you can see just by printing out some simple shapes 00:22:25.110 --> 00:22:28.881 you're able to make nice spacers to have a very clean covert 00:22:28.881 --> 00:22:34.286 little board. You can hide this with some papers inside there to 00:22:34.286 --> 00:22:39.058 -- in case somebody opens it up, it won't look so suspicious. In 00:22:39.058 --> 00:22:41.961 general if you want to make one of these, there are all sort of 00:22:41.961 --> 00:22:45.264 storage clipboards out there on Amazon. You need to make sure 00:22:45.264 --> 00:22:49.235 that you find something that has enough depth to fit whatever it 00:22:49.235 --> 00:22:56.008 is you're trying to hide in there. So you can also enhance 00:22:56.008 --> 00:23:00.312 this if you wanted to by adding in something like the USB armory 00:23:00.312 --> 00:23:04.316 or a raspberry pie board. Say you had an RFIDler in there, all 00:23:04.316 --> 00:23:09.388 you need to do is connect something that is going to be 00:23:09.388 --> 00:23:13.592 listening with USB serial and logging that data very simply 00:23:13.592 --> 00:23:18.030 and you can walk around all day and then come back and have a 00:23:18.030 --> 00:23:21.634 log of all the UIDs you captures. With the Proxmark you 00:23:21.634 --> 00:23:25.337 can of course take the client code and build this. It's 00:23:25.337 --> 00:23:28.374 already got an arm build for Android. That shouldn't be too 00:23:28.374 --> 00:23:34.380 much work. And then you can also move onto making fake readers 00:23:38.317 --> 00:23:41.820 and doing other things to hide your tools in the field. One of 00:23:41.820 --> 00:23:45.357 the valuable resources for this, you have building information 00:23:45.357 --> 00:23:49.695 models out there. So if you have autocad, they have their seek 00:23:49.695 --> 00:23:52.698 environment which allows you to search for lots of things that 00:23:52.698 --> 00:23:56.602 you would find in different buildings. I found for example 00:23:56.602 --> 00:24:02.875 this HID reader enclosure which if my 3D printer hadn't failed 00:24:02.875 --> 00:24:06.478 on me, I would have printed it out to bring here. But you can 00:24:06.478 --> 00:24:10.816 very easily hide inside of that a custom circuit board or a tool 00:24:10.816 --> 00:24:15.287 with an antenna. And maybe put in an unexpected place. Maybe 00:24:15.287 --> 00:24:19.692 conceal a legitimate reader and use that to try to capture badge 00:24:19.692 --> 00:24:23.395 swipes. So really what we're looking at here is the fact that 00:24:23.395 --> 00:24:27.766 you can make realistic prints of things and you've got models out 00:24:27.766 --> 00:24:31.303 there. Even if you don't, you can use something like a connect 00:24:31.303 --> 00:24:35.341 or even an Android phone or iPhone with the 1, 2, 3D sketch 00:24:35.341 --> 00:24:38.811 app and actually just take pictures and get a very reliable 00:24:38.811 --> 00:24:44.083 3D form out of this. The next thing that I was looking at was 00:24:44.083 --> 00:24:48.987 using a phone case to actually hide an antenna inside of that 00:24:48.987 --> 00:24:52.124 and some of the things that I envision doing with this. You 00:24:52.124 --> 00:24:58.630 could of course do exploits on the Android beam functionality. 00:24:58.630 --> 00:25:01.800 Say somebody thinks it's just a phone but you have more 00:25:01.800 --> 00:25:05.604 sophisticated hardware on there. The initial intent that I had 00:25:05.604 --> 00:25:10.242 for this was being able to eves drop on the NFC communications 00:25:10.242 --> 00:25:15.214 for something like apple pay or Google wallet. And there's so 00:25:15.214 --> 00:25:18.717 many phone cases out there that it really should be trivial to 00:25:18.717 --> 00:25:22.888 take one of those and merge it with the design for a coil in 00:25:22.888 --> 00:25:29.428 such a way it's not going to be obvious. On the embedded side of 00:25:29.428 --> 00:25:33.399 things some of the other things I was looking at were adding in 00:25:33.399 --> 00:25:37.503 the support for the USB armory to be able to log keys, doing 00:25:37.503 --> 00:25:42.107 script able responses, and also being able to do something like 00:25:42.107 --> 00:25:46.111 if you use the ODG adapter on here with a little passive USB 00:25:46.111 --> 00:25:52.851 hub, you can have a wifi adapter in there and have a two-man team 00:25:52.851 --> 00:25:57.122 where one person is going to be using the device but not being 00:25:57.122 --> 00:25:59.825 able to see it, not knowing when it's read something, but 00:25:59.825 --> 00:26:02.661 somebody else maybe a couple hundred feet away is going to be 00:26:02.661 --> 00:26:06.832 able to access it. Monitor what is being scanned, trip it into 00:26:06.832 --> 00:26:10.669 simulate mode when it needs to be. So there are a lot of 00:26:10.669 --> 00:26:14.506 possibilities with that for pen testing. Actually at this point 00:26:14.506 --> 00:26:19.077 I do have some time that I can try and do the demo of how the 00:26:19.077 --> 00:26:25.050 stand alone mode works for NFC. I'm going to take the Proxmark 00:26:25.050 --> 00:26:31.757 out of the clipboard. And plug it into a battery here. And then 00:26:31.757 --> 00:26:39.331 I need my high frequency antenna for this right here. Now, add 00:26:39.331 --> 00:26:45.337 the extra battery back into this. That's to let us know it's 00:26:51.844 --> 00:26:57.850 happy. And we have to lock it. Oops, not so happy. Let me try 00:27:04.823 --> 00:27:10.329 that again. It thinks it's locked. It's not the smartest 00:27:10.329 --> 00:27:16.335 smart lock. So now it is in its locked mode. And if I take this 00:27:21.874 --> 00:27:29.414 card, we can see this one does not open it. This one however, 00:27:29.414 --> 00:27:35.420 will open it. And we'll relock it. This however is a magicking 00:27:39.892 --> 00:27:44.029 to. If I now power up the Proxmark by holding on this 00:27:44.029 --> 00:27:47.833 button. It flashes its lights for me which I'm sure nobody in 00:27:47.833 --> 00:27:53.038 this room can see. I go to the tag that works for it. When I 00:27:53.038 --> 00:27:57.476 touch it down, it is lighting up to let me know it scanned in a 00:27:57.476 --> 00:28:01.580 tag and now it's in play back mode. One of the problems with 00:28:01.580 --> 00:28:05.984 play back mode, either the shape of the antenna or the 00:28:05.984 --> 00:28:09.521 implementation that you see on here isn't always so conducive 00:28:09.521 --> 00:28:15.527 for this. So what we're going to do is try it out. But and this 00:28:19.197 --> 00:28:24.603 did work once earlier today. But, yeah, generally that's not 00:28:24.603 --> 00:28:28.173 happening. So we're going to clone it to a tag by holding 00:28:28.173 --> 00:28:33.045 down the button now and putting it on the field of the tag. When 00:28:33.045 --> 00:28:37.683 I release it, it flashes to let me know it's written it. With 00:28:37.683 --> 00:28:44.623 any luck now ... We can go ahead and -- maybe not. Let's try that 00:28:44.623 --> 00:28:50.629 again. My antenna was lose. The higher Res connector on this is 00:28:58.070 --> 00:29:04.676 not always great for holding in cables. Just put it in stand 00:29:04.676 --> 00:29:10.682 alone mode again. Go ahead and scan in this tag. And then we 00:29:10.682 --> 00:29:14.219 will clone it onto this one, hopefully it hasn't been bricked 00:29:14.219 --> 00:29:19.157 (ph.). One of the risks with working with the magic cards is 00:29:19.157 --> 00:29:22.227 that if you don't have a strong connection to the antenna while 00:29:22.227 --> 00:29:25.998 you're writing to it, you can actually break it which is why I 00:29:25.998 --> 00:29:30.168 stuck to just my fare classic where the tags are cheaper but 00:29:30.168 --> 00:29:35.607 now we do have it working. ...(applause)... so that's 00:29:35.607 --> 00:29:40.512 pretty much what I've got for you. If anybody wants to see any 00:29:40.512 --> 00:29:45.050 of this stuff up close you can definitely come up here or meet 00:29:45.050 --> 00:29:49.388 me outside afterwards. And just -- I want to say thanks for the 00:29:49.388 --> 00:29:54.459 Proxmark development team, marshmallow and ice man, very, 00:29:54.459 --> 00:29:57.929 very great for being helpful for working with this stuff, being 00:29:57.929 --> 00:30:01.099 very patient. And also to my family for putting up with all 00:30:01.099 --> 00:30:05.871 the crazy hours leading up to DEFCON. So yes, thank you. 00:30:05.871 --> 00:30:12.811 ...(applause)... And I guess there are a few minutes for 00:30:12.811 --> 00:30:16.982 questions if anybody has questions now.