Now, it's my pleasure for the last presentation tonight. Just to get you informed, who attended my presentation two years ago with a demonstration on RF dump? Who was in the audience? Who is using RF dump? Only a few, so let's get started. Our agenda for tonight is, what is RFID? How to exploit and attack RFID systems? We have done some stuff like Melanie does with attacks against the middleware. We added a new feature to RF dump, it's called video emulation or soft tags. Some words about the unexpected risks in the middleware, and some new ways to exploit the system. Okay. But our main focus for tonight will be encrypted RFID tags, like the ISO14443 tags. So a short overview, what is RFID? It stands for radio frequency identification, and it's, in fact, wireless transmission of information between transponders and readers without visibility, and that's it. Most of the time, we have bidirectional transfers. It's a way to read and write, even if they only call it readers, the most of them can write to the tags as well. And we have a transponder or tag, and this can be attached, embedded, or implanted. And the main feature of RFID is the automatic correlation between object and safe data. This can be a garage door or something like this, a human in a bar, or a passport or something like this. So in most times, there are a lot of generic terms, and RFID is often used as a generic term for complete infrastructures. For example, a transponder, also known as RFID ship, tag, label, wireless label, or simple ship. We have the reader, we have some middleware, this connects the reader with the server. Most of the time, we have communication infrastructure, and all this stuff is integrated with server farms, data warehouses, services, and supporting systems. Let's give you a short overview. For our work, we are working on standardized RFID, like ISO 14443 A and B, like mid-range, short-range, and long-range. And I've divided the RFID classes into the reading distance. There are 1356 megahertz and so on. So 125 to 146. This frequency is quite popular if you need to go deep into the material, like tagging humans or animals. The 13 megahertz is popular for VINCity cards, for access control, passports. And the 15693 is most used for normal memory tags used in the supply chain or stuff like that. Okay. Next slide, please. And what different types of transponders do exist? And there are different types of transponders. Some of them are only transmitting a unique ID, something like a serial number. They are only passive. That means they don't need a battery to get powered. They're useful for identification, tracking, like the FastTrack system. And most of them are only using clear text communication. Then we have transponders. That's actually act as a database. Data storage. You can compare this type of transponders like USB sticks, pretty small USB sticks. Most of them are passive. Some of them are active. Electronic product code transponders are an example for this. We have the smart labels. Most of them are also using most time clear text communication. And some of them are using encrypted communication. And we have the smart card interfaces. Most of them are active. Most of them are active. Most of them are active. Some are passive. Best example is ICAO, MRTD, machine readable travel document, it's a biometric passport. Some access control systems, like the Mifare Deathfire. The features of this text is encryption, identification, and encrypted communication. And this will be our main topic for tonight. Some generic attacks to RFID. First, you can sniff it. You can see the communication between the transponder and the reader. So you can counter find the communication. You can try to obtain the user ID, the user data, or the meter data. You can do basic attacks with this type of attack, like attacks on structures, the data structure that's saved onto the, on the tag directly. You can do a replay attack to fully access control system. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. Next slide. And you can try to manipulate the data stored on the transponder, like the manipulation of data, the manipulation of metadata, like swapping objects or logical duplication of objects. So if you go into the store, if you want to buy a new computer, you just wrap a pair of sperm or bubblegum, swap the objects, and now you can buy a new box with an optimized checkout at the price of a bubblegum. There are some other generic attacks, like the deactivation of the transponder. This disables the traceability of objects and the visibility of objects. And you can do it with specific attacks, with your famous home appliances like microwaves. And you can attack the structures in the middle, where the back end is. And the manipulation of the structures, like injecting malware into back ends and middle of our systems. For instance, database worms. You can try to use this injection for manipulation of backend systems. And you can try to run a DOS attack against the infrastructure. We have seen it at the top before, jamming of RFID frequencies. Some of these attacks are known as anti-collision attacks. This type of theoretical paper from Ari Jules from RSA. In fact, the blocker tech was never implemented and never demonstrated. It was only an academic paper on it. You can buy an out-of-the-box police jammer. Those are available over internet or buy it on eBay. And these types of jammers are used to block frequencies where suspects can communicate with their colleagues. Or... They can't communicate or open the garage to escape. So the police have pretty handy boxes. And this one finger-snip with this box, they can block your DSM frequency. They can block your mobile phone frequency, the frequency for your free wireless phone and as well for RFID frequencies. And also the text, preventing reading of the text. It's a simple denier. It's a kind of service against RFID systems. But imagine if someone brings a jammer or something like this into a company or into a plant that's organizing their complete production process with this type of text. So you can shut down production, sales, or even block someone to get into the data center. Two years ago, as we presented RFDump, I got a lot of quotes. So... Oh, okay. But all the texts are unencrypted. The normal EPC is using standard unencrypted communication. The data is not encrypted on top of the RFID tech. And the spokesman from the RFID lobby is telling us, oh, Lucas, it's not true. We will use encrypted text. We will secure it. And with encryption, everything will work fine. So no attacker has a chance to change anything on it. It's just an unencrypted technology. So we did some research on MIFARE. MIFARE is the most used RFID transponder featuring encryption. This is a technology. It's owned by Philips Austria. They actually bought this company. And the technology is based on ISO-14443, like passports or some different other text. And they operated on the 13.56 megahertz frequency. We have... Oh, sorry. We have two different families of MIFARE techs. The MIFARE standard family is operating a priority high-level protocol and proprietary security protocols for authentication and ciphering. We haven't spent so much time on this proprietary stuff because it will be changed to standardized stuff. But I'm pretty sure this proprietary ciphering, if they are not going to release the cipher algorithm so someone can do a cryptanalysis, will be some... Okay. So we have less or more type of sawing with the standard secrets, like all other proprietary ciphers. There are also MIFARE ultralight, the same tech without any encryption. And we have the MIFARE Pro, Pro-X, or SmartMX tech. This family of techs is fully compliant to the ISO-14443 standard. And there are different types of techs offering memory protection. And each sector, each memory block of this tech is protected with two different keys, the A and the B key. And each sector of the techs can be protected with one of these keys. First, we have written a small Perl tool, a small Perl script, trying to make a brute force attack and trying to figure out how long it would take to break it with a brute force. In the worst case, we end up with 22,000 years because you need 25 milliseconds per key. You must reset. You must set an answer to reset back to the key. And it will not work that way. The second chance was, oh, what's happened if we're just clustering it and run 1,000 alpha-D readers? So these techs are quite popular. Okay. There are a lot of companies that are 70% of the world, but there are a lot of companies They have a lot of data. And they're very similar to the ones we have in the US, but they are not as similar to the ones we have in the US. And as we say, they are not the same as the ones in the US. So it should not be a problem. They have one shared secret, one shared key to get 1,000 of these keys. Every student runs an alpha-D reader. But we have still 226 years. So let's find a different way to get this information. Unfortunately, Philips put all information under NDA. And, you know, if you are doing security research, NDAs are not good. For instance, if I would sign an NDA and give a presentation like this, they consume me. So we are not at all interested to sign any type of NDA. Instead, we get some software that's really available, and we need some point to start. So we run the Unix tool strings on it. You know what strings is doing? Yeah. So, actually, it's extracting from executable binaries all zero-terminated strings. And after we got some strings, we start some Google hacking and looking what are the results with strings that could fit as a sector key. And Google helps a lot. It seems like Google desktop searches is very popular at smart card developers' PCs. Look at the results. So without signing NDA, we got all necessary information. We got keys, we got data sheets, we got descriptions, and even sample applications. So we found the following defaults. These are the keys, rather. New cards could be shipped with. And we found about 60 keys from sample applications. And also, there's one specific key that turns off all encryption features. Also, we found a nice document. It calls MAT, and it is really MAT. It calls MIFA application directory. And this helps. If you're doing some investigation. And we've got engineering on this stuff. Because Philips wants to organize the multiple type of use for the crypto R3D chips. So they introduced a directory where each developer can sign up and write into a sector what type of application and what type of data layout he is using for his specific MIFA application. Okay. So in this Google data sheets and documentation, we found a huge amount of examples. So we found examples including different keys, different tech memory layouts, as well as data structures for ticketing, access control, and online payment. And you know, developers are really lazy. Okay. So we checked a couple of these cards. And we succeeded with more than 75% use the default keys. So something like, oh, it's compiled. Let's ship it. And even I cannot believe that the programmers don't understand anything at all. So they are not only using the example layouts from the data sheet, they are also using the keys. Okay. Thank you. Thank you. Thank you. Thank you. Thank you. By the way, are smart card developers here in this room? No one? You know, how can we bring this notice to a smart card developer? It's pretty good if you understand what you are doing, and not only putting the example layouts from the vendor. And oh, it runs. Okay. Let's ship it. Thank you. So, we figured out directory attacks are the best way to get into encrypted RFID. Attacks are possible with default and example keys. The new RFDump version will have a huge dictionary and we are right now working on, you know John the Ripper? With features like John, so you can mutate and apply rules to the dictionary we found. So it's much easier to boot force or to do a smart boot force attack to the RFID tech. And we found some security flaw in the general design. I've never seen something like a lockout or false login counter. So you can try and limit twice. And they're also missing a delay for a false key. Just does not exist. Okay. And this part I want to give you a short demonstration. I run this wonderful operating system in the VMWare here. This is a new version of RFDump. It's actually on the CVS. We add support for the MyFair stuff. I have here a couple of cards. Cards like Cafeteria from the University of Brunswick, Cafeteria from the University of Berlin, and some examples. And we changed RFDump a little bit. So now you can start a scan and it will read the tech at all, completely. It's now scanning for a tech and starts reading the page. Okay. And you can stop it. And you got the famous known version of RFDump with a pretty nice ASCII and hex editor. So if you know the layout, you can just change the amount or doing stuff like this. And we added support for much more readers and much more frequencies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . on my sector, what byte is presenting my day for validity for my ski pass or my amount on my cafeteria card or something like this, or even my access level for my data center. And most of the times, if you are pretty smart, you get two or three of these cards and you can look and you know your access level for your colleague, your access level, and try to div them and figure out how the privileges are organized inside your organization. Now let's come to the second part of my talk. Just let's attack the back end. Now we got the alpha detect, we got access to the auto-encrypted sectors. Now we have something like normal storage. And we can use the storage to transport malware, SQL injections, buffer overruns and stuff like that directly into the back end. We have to know if a tag is read-only and we need to change something on the tag, we just need to clone it. This can be done with rfdump. So you can go and you can load and save the content into a XML file. And with the help of this XML file, it contains the payload of the rfdump. You can load this file into an rfd emulator and change any sector, like the unique ID and stuff like that. And the new version of rfdump can emulate the complete structure. So it can emulate the payload, the administrative block, like the unique ID that's normally not changeable in this way. And it also emulates the reader. So if you want to break in the access control. You just rip off the reader and put your serial, it's most of the times ours, 448 or something like serial TTLP level connection. And you can just connect it with an adapter to your notebook and emulate everything. As well, you can load this saved value and just dump it back into an empty new IP address. And you can load this rfid tag. So we are able to deal as well with read-only rfid. So just write the manipulated data into an empty one. We found out that some of the really clever smart card guys checked some of the tags. They are just moving the unique ID into the user data fields. And if the block is encrypted, once again, the sector key must be blocked. And if the block is not connected, the data will just be broken, like presented. Now let's have a look to the new, pretty new virtual supply chain. We have a central data warehouse. At production time, the product gets registered at the data warehouse. They are tracking the distribution. They have a pretty new feature called life cycle management. Something like, oh, your wallets needs a new battery. Please come to the store. At the point of sales. The data could be. correlated with a customer data like your credit card, your customer record, your loyalty card and stuff like that and they're able to operate customer care. This means all the systems must be connected in a network, must communicate with within and must have some type of relations. So what's possible with this brave new world we can take some of this malware different The most systems have a tool it's called Event Manager, so if an RFID tag get scanned it's coming to the event manager going to the information server or the middleware and ended in your ERP or CRP system and in your back ends. one problem with with our reinforcement is azul. We need to know whichاصn to do this. For example, with this designers, they just want to make the text as cheap as possible. So they just ignored some functions on some rfid text that give you an information if you read up to the end of the rfid tag. Instead what's happened, the page just get flipped and you get a multiply of the page beginning with this address. So you can utilize this feature. Now we have unlimited space on the tag. So you can use rfdump and the tag database and we need to use this tag database to avoid reading over the boundary. Let's have a look to this. Oops. And with this tag database, it's necessary to know the actual size of the rfid tag. If you don't know how many memory sizes or how many memory pages you have and the memory size of the tag, the most readers will just read above them and the most tags gives you a multiply for the original content back. I don't know if it's a bug or a feature. So normally the reading is even driven like a barcode. The barcode starts reading, you get normally introducing it. So you can see the entry of the reading sequence and the end of field sequence. And you know, all this EPC guys are only thinking in barcodes. So, why expand more into one of these features? Let's give you an hour back if you're reading after the end of the tag. We are just implementing an end of field. And like the most new systems, the input is always unchecked in all implementations we have seen. So this is an example. We have here rfid tag with a C structure. And we have this nice feature with a C end of string. So imagine what's possible. Any ideas? Yes, to remove the end of string. And if you remove it, we got unlimited memory. So if the input is even driven, and we got unlimited memory, what's happened? You got a buffer overrun and that's it. By the way, I killed my office physical intrusion detection system by this way. Because I am using a pretty cheap TMS microcontroller and after I've killed this and the service company was unable to repair it, I just disassembled it. I found out they are using a TMS, TI controller, and this controller is not dividing code pages and memory pages. So I got a access card for enabling or disabling the alarm and I cloned this card, removed something, and unfortunately, it gives the error like, error on that, and that was it. So I called the vendor, oh, they have a problem. Our alarm system does not work anymore. I tried to deactivate this, I got the error on that, no alarm sounds, and all doors are open right now. Oh, we don't know this error. Probably something must get wrong. And I found out I just overwritten the actual programming of this microcontroller, and the result was, I just destroyed the programming, no alarm sounds, and the door opens. Unfortunately, the system was tested and approved by the insurance company. And the insurance company telling you, oh, if you buy this specific system, your insurance will go down, because it will raise your level of security. Instead, you have the ultimate tool, just as door opener, and I don't know what's going on, because the service company came and exchanged the microcontroller, and I just want to test their cleverness. So I just put, after the guy from the company, my tech in front, and that was it. And she told me, oh, we have a problem, this is serious. It must be something like your electrical power, or something like this. I'm not sure that pretty even don't know that they're using RFID. They're using some type of transponders. Okay, so now there are some patterns. They are now starting to put direct XML into the RFID. Oh, we can do the same like the C structure. Just put opening text, and at some level, it will crash. The next idea that's coming to RFDump is soft text. So, the readers are pretty expensive, and no one is interested, just use a reader. So, if some of your hardware guys is interested, you can use an Atmel, or something like that, or a small microcontroller with an interface, and this can act as a battery-powered RFID tech and reader. So, we can emulate the whole system, and put any testing data into the back end of the middleware. Our version can read backups, the XML files from RFDump, and we are able to manipulate everything, because we have the full control over the complete system. Okay. Now, is anybody interested to come to the podium with some of his favorite RFID ISO tags, like access control? We can have a nice demonstration. No one? Okay, we can shift to the question hour. Oh, we have one. Okay, I'm not sure is it ISO, so let's check it. No. It's not 14443. Yes? This is an RFID tag you're using in the mystery box challenge. Okay. I'm not sure what that is. Okay. Okay, thank you. It's 14443. Okay. Okay. Oh, ho, ho, ho, ho, ho. Wait. Okay. So, I cannot get it. It's probably not in my tech database, but I have a backup tool with me. Let's check the second one. Go. Sit down. Go. No, it's not 14443. Perhaps the range is not, I cannot select it. It looks like, yeah. But if it's a TI ship, it's, it's probably not. Oh, we got it. You have to put it on the opposite side. The range is not really huge. Okay. Let's try it with RF dump once more. And look what's on it. And it's like this. So, no, it doesn't work. Okay. Okay. It's not working. It's not working. Let's try it again. So, let's try it. Let's try it again. or doing a live demonstration with this. We're using the ACG reader. And yes, it's unsecure. I'm using an auto-login as a root and I'm just starting AFDAMP, so please don't complain about. Okay, now I have to get to avoid this trash in my queue. Okay, we got it. Now I have to hold it directly under. It's hard to get. Oh, we got an unexpected page size. You know the page size of this? Okay, now I got some, I got the ID. Yeah, I need to investigate something about more of the page size. Okay, so I need to apply for American Express card to get unlimited credit. Okay, thank you. Let's have a look to this access card and then we can release you from your pain. No, it's not. If you come to the podium after this, I have a couple of different AFD read-ups with me so we can check it out. Okay, let's start with a question session. First question. There's a microphone in the middle. It would help a lot. No questions? . , we have support for ACG reader. This is a standard Phillips chip and the nice feature for the ACG reader is you know modems with the AT command set. It's a pages command set so you can communicate with this reader with a ASCII command set. You can just open something like a mini-com or a terminal program to punch in commands and try something out if you are a doubt. The most of this are for the readers are designed by the same stupid guys that are designing smart cards. So you have yeah, you have something like you know what nibbling is a bit nibbling and stupid binary commands to send to them. And ACG got so much pressure from the smart card guys. They are now supporting two. versions of this. So you can switch into a complete brain damaged binary protocol and still use a nice ASCII protocol. And if you're interested to get one of this ACG stuff, you can now order it over the RF dump page. We don't make any money with it. You can just check the price and we do also ship to the US, like somewhere else. As well, we have an open API. So if you want to put in your reader into RF dump, there's a C structure. You can put in what type of commands you are sending, what type of feedback you are getting via regular expression and can use our reader API to put new readers into RF dump. Okay, next question please. You know, I'm just curious, have you ever done any work with the military cat card in their RFID system? What type of command? CAC card? CAC, a common access card. I wish I had one to scan for you, but I don't. The problem with all this US military stuff and proprietary US stuff is I feel not comfortable to checking one of these cards here on the podium at the DEF CON. You know, my lawyer taught me what I can say in the US and what I should not say. And if some FET is interested that we are going to do an audit on the software or something like this, we can organize something. But I'm not feeling comfortable to speak about. But I do know that NASA is using MIFARE as access control. And this is one of the biggest customers. So they were like, you want to come back for DEF CON 15, right? You know, they were... I understand. I understand that. But have you been directly threatened then or... Have you been directly threatened then or you just prefer to kind of keep quiet? I just want to avoid some situations. That's cool. I appreciate that. Yeah. The next question. You mentioned that a lot of companies use the default key. When a company deploys in general, will they use a single fixed key or will different RFID tags have different keys? Like for a single company's deployment of a given product? Normally, you have one shared key. So the reader needs to know the key to communicate with the company cards. And some of the companies are clever. There are other solutions. They have set up one key per card. And this is normally not possible. So most companies using one shared key with one fits all. And this shared key is responsible for all sectors that are used by the company. But the MyFair standards allows you to put different sectors. So you can put up to 16 applications. Each application is using a different sector and each application could be protected by its own key. So the application for ticketing does not interfere with the application for access control or for paying your cafeteria. This is the main idea behind this MyFair application directory. Thank you. You were saying that the platform is 16? Yes. 16. Yes. The reason MyFair . . . . . . . . . . . . . . SUBJECT 16. . . . cards can use a desk so I can use unique keys for the communication and they can change the key for the communication for secure channel but to access to the sectors they have one chat key okay so if you have some additional questions feel free and just send me a short email my email address is lucas with k at week with ph dot de okay and enjoy this evening