1 00:00:00,350 --> 00:00:01,290 Alright. 2 00:00:01,990 --> 00:00:03,410 Are we ready? 3 00:00:04,650 --> 00:00:08,250 So today's talk is called mutual authentication is optional. 4 00:00:08,270 --> 00:00:15,750 And it's going to get into how we can get past HID I class SE readers that are enforcing secure credentials. 5 00:00:15,750 --> 00:00:20,190 We'll also go over a technical overview of all the other I class credentials. 6 00:00:21,150 --> 00:00:22,890 So who am I? 7 00:00:22,930 --> 00:00:24,650 So my name is Xavier. 8 00:00:25,010 --> 00:00:29,770 And I like all things physical security and I am a RFID researcher. 9 00:00:29,770 --> 00:00:32,290 I'm a HID credential enthusiast. 10 00:00:32,290 --> 00:00:33,750 I like NFC. 11 00:00:34,090 --> 00:00:35,890 So yeah, that's me. 12 00:00:39,100 --> 00:00:42,520 So today we're going to cover a few things in our agenda today. 13 00:00:42,520 --> 00:00:51,100 We're going to go over cloning, downgrading, emulation, and we're going to get into buildings enforcing secure credentials without one. 14 00:00:52,200 --> 00:01:01,060 So we're going to go over a few ways to get an exploit HID I class credentials to gain unauthorized access into a facility. 15 00:01:01,860 --> 00:01:05,920 So we're going to go over four different attacks today in varied degrees of complexity. 16 00:01:06,260 --> 00:01:13,300 So the most simple one attack we're going to go over is cloning, which is going to be the least complicated attack. 17 00:01:14,540 --> 00:01:26,320 Most I class legacy credentials use the standard authentication key, which has been obtained in the heart of darkness paper in 2010. 18 00:01:26,960 --> 00:01:31,540 Now, if you've not read this legendary paper yet, you should go, it's totally worth a read. 19 00:01:32,800 --> 00:01:40,760 If the systems are not standard key, those keys can be extracted using a attack called low class. 20 00:01:42,440 --> 00:01:45,980 Overall, these credentials are fairly trivial to make a copy of. 21 00:01:45,980 --> 00:01:49,140 It's been, it's, it's, it's been done for over a decade now. 22 00:01:49,140 --> 00:01:51,560 So nothing much to write home about. 23 00:01:51,940 --> 00:01:54,620 But we're going to have to cover it anyways. 24 00:01:55,420 --> 00:02:04,020 Our next attack we're going to go over is a downgrade attack, where we're going to take a secure credential, we're going to move the payload over to a insecure credential. 25 00:02:04,160 --> 00:02:09,440 So for example, this would be turning an SE credential into a legacy credential. 26 00:02:10,960 --> 00:02:13,520 We're also going to cover emulation today. 27 00:02:14,400 --> 00:02:17,400 So what if that downgrade didn't work? 28 00:02:17,400 --> 00:02:21,520 We're going to do something by emulating a virtual credential. 29 00:02:21,560 --> 00:02:26,260 So this can be done with like electronic tools such as the Proxmark 3 or the Flipper 0. 30 00:02:26,520 --> 00:02:32,760 This exploits the HID present transitional credentials, also known as SR. 31 00:02:34,400 --> 00:02:48,160 And finally, the fun part of today's talk is going to be exploiting the bugs in reader firmware to gain access to facilities that only only enforce using a secure credential. 32 00:02:50,540 --> 00:02:56,540 So we're going to go over some background tech today so you guys sort of know what we are talking about. 33 00:02:56,920 --> 00:03:00,520 So you guys are all familiar with physical access control systems, right? 34 00:03:02,240 --> 00:03:05,420 You probably interact with one without thinking twice. 35 00:03:05,580 --> 00:03:09,560 There are a ton of those HID rev e-readers scattered around this convention floor today. 36 00:03:11,760 --> 00:03:19,360 Uh, weekend protocol. 37 00:03:19,380 --> 00:03:22,940 That is the signaling protocol between the reader and the controller. 38 00:03:23,360 --> 00:03:26,160 Simple signaling protocol over two wires. 39 00:03:26,160 --> 00:03:27,340 Really old actually. 40 00:03:27,340 --> 00:03:29,840 Developed by John Wiegand in 1975. 41 00:03:29,960 --> 00:03:32,760 Still used today in the majority of installations. 42 00:03:33,480 --> 00:03:38,280 It is basically just binary data that is being transmitted to the reader to the door controller. 43 00:03:38,460 --> 00:03:41,360 And it is up to the controller to determine access. 44 00:03:41,360 --> 00:03:43,580 The reader is just there to read the credential. 45 00:03:44,200 --> 00:03:50,360 These are usually padded with a preamble to tell the controller what bit length the uh, the credential is. 46 00:03:50,380 --> 00:03:55,240 And also has a uh, checksum to ve- verify the data integrity. 47 00:03:56,920 --> 00:04:01,580 You know, access control systems, access control controllers are pretty dumb. 48 00:04:02,020 --> 00:04:05,840 They can't tell what type of credential is presented for the most part. 49 00:04:06,420 --> 00:04:08,420 So they only read credentials. 50 00:04:08,420 --> 00:04:12,500 So in the case of my class, it is going to read any credential that has the same key. 51 00:04:12,500 --> 00:04:15,740 And we know, well the cards have the same key for the most part. 52 00:04:16,160 --> 00:04:27,020 This just doesn't cover like, special functions such as readers in key rolling or any uh, and they're just gonna, it's up to the controller to determine access. 53 00:04:27,020 --> 00:04:29,520 Whether to allow or deny the access. 54 00:04:30,380 --> 00:04:32,520 And finally, card cloning. 55 00:04:32,760 --> 00:04:36,860 That is just gonna be making a physical copy of a credential onto another credential. 56 00:04:36,860 --> 00:04:38,340 Just a direct copy. 57 00:04:39,260 --> 00:04:42,980 Card emulation would be to make a digital copy of a physical credential. 58 00:04:43,160 --> 00:04:47,620 With the, and emulating that with a device, like a Proxmark 3 or a Flipper 0. 59 00:04:48,000 --> 00:04:55,100 A real world use case for this would be the HIV transitional credentials called SR, I-class SR. 60 00:04:55,560 --> 00:05:08,320 And uh, those have a unique part where these uh, the secure part of the credential, the secure identity object is actually s- is actually cryptographically bound to the card's serial number. 61 00:05:08,720 --> 00:05:17,860 And since there are no uh, serial number changeable I-class cards, you're unable to make a uh, direct copy, which means we're going to emulate those. 62 00:05:19,900 --> 00:05:23,800 Here are just an overview of all the different uh, HIV credential types. 63 00:05:23,800 --> 00:05:25,100 Starting with Prox. 64 00:05:25,100 --> 00:05:28,920 It's a bit out of scope for today's topic, but we have a reader here anyway. 65 00:05:30,220 --> 00:05:32,400 It's a, it's a low frequency credential. 66 00:05:32,720 --> 00:05:37,980 And then moving on to around 2000, we have I-class Legacy that first came out. 67 00:05:38,220 --> 00:05:43,940 And uh, those were unique because those were actually encrypted with a 64-bit key. 68 00:05:44,500 --> 00:05:55,480 These were broken in 2010 by a Milos Mariak during the Heart of Darkness attack, where two readers were actually destructively attacked in a way to dump the firmware to derive the master identification keys. 69 00:05:56,840 --> 00:06:05,020 Going on to around the 2010s, we have the uh, we have I-class SE, also known as the SIO-enabled. 70 00:06:05,120 --> 00:06:08,040 SIO meaning secure identity object. 71 00:06:09,900 --> 00:06:16,520 And SEOS would still be the uh, flagship credential from HID up to today. 72 00:06:17,960 --> 00:06:21,040 So we're going to go over a few possible attack vectors. 73 00:06:21,340 --> 00:06:26,680 So we're going to go over card-only attacks, and card and reader attacks. 74 00:06:26,720 --> 00:06:32,580 Card-only attacks are very simple because it involves one thing, the physical credential itself, and that's it. 75 00:06:32,580 --> 00:06:35,900 But you can only do a limited things with um, with just a card. 76 00:06:36,380 --> 00:06:45,220 One attack that's possible is just a downgrade to IPOC Legacy, because they would just send the same PAX payload on a different type of media. 77 00:06:46,180 --> 00:06:51,140 You can think of cards as just an encrypted storage device, like a USB stick, but crappier. 78 00:06:51,920 --> 00:06:55,740 Since you can just read the distance from quite a distance in the case of I-class. 79 00:06:56,840 --> 00:07:06,580 The power efficiency, simple cryptography, and the ISO 15693 protocol all contribute to enhanced read ranges, using long-range readers. 80 00:07:09,440 --> 00:07:12,620 This is when card and reader attacks come in. 81 00:07:12,820 --> 00:07:21,060 Card and reader attacks are very fun, because you would think the reader on the building is there to secure the, secure the building, right? 82 00:07:22,320 --> 00:07:31,320 But we're going to use that exact reader that's outside the building, and use that to compromise the security of the building, which we'll get into a bit later. 83 00:07:36,270 --> 00:07:39,470 So how secure are each of these HID credentials? 84 00:07:40,430 --> 00:07:45,850 So starting with the least secure one that is broken for over a decade now, we have I-class Legacy. 85 00:07:46,530 --> 00:07:49,730 The cryptography is completely broken, keys are leaked. 86 00:07:49,890 --> 00:07:55,750 Card's serial number is not relevant in the PAX payload, which means cloning is extremely trivial. 87 00:07:56,570 --> 00:08:00,610 And elite keys are recoverable by low-class attack. 88 00:08:01,190 --> 00:08:07,970 PAX payload is easily transferable by copying block six to nine to another card. 89 00:08:08,830 --> 00:08:20,350 We have I-class SR, which is a transitional conditional, and the application instruction area on the card is going to tell the reader that it has a secure identity object. 90 00:08:21,170 --> 00:08:28,690 This is good for transitioning between buildings that have SE, secure readers, and legacy readers. 91 00:08:28,690 --> 00:08:37,590 And these are easily downgradable to I-class Legacy, or you can emulate this credential with the correct card's serial number for a complete clone. 92 00:08:38,770 --> 00:08:48,530 Going to I-class SE, standard key and the key deprivation function are not leaked, and the keys are not recoverable by low-class. 93 00:08:49,010 --> 00:08:53,090 Currently we still do not have the master authentication key for SE. 94 00:08:53,090 --> 00:09:11,910 These can be standard, elite keyed, or custom keyed, and these can also be duplicated if it's an open format, like HID 26-bit, and you'll be able to use a HID encoder to create another SE card, actually a legit copy, because they are freely encodable. 95 00:09:11,910 --> 00:09:13,090 It's an open format. 96 00:09:13,770 --> 00:09:22,010 These are also downgradable to Legacy or SR, and these can also be emulated, which we'll get into, and it will work on most readers. 97 00:09:23,250 --> 00:09:29,630 So we're going to get, so how are we going to get past HID readers that are enforcing secure credentials? 98 00:09:29,630 --> 00:09:31,550 The first would be a downgrade. 99 00:09:31,550 --> 00:09:36,250 So using official HID hardware against their credentials to perform downgrade attacks. 100 00:09:36,250 --> 00:09:55,690 So we're going to use a HID Omni-key reader, which is the official HID hardware that plugs into a computer, acts like a keyboard , and we're just going to configure it to spit out the payload data, along with the commands in the Proxmark 3 to just make another copy without ever typing on the computer. 101 00:09:55,990 --> 00:09:58,010 We have a quick demo of this here. 102 00:10:11,850 --> 00:10:15,150 And one of the cards is SE and one of the cards is Legacy. 103 00:10:15,150 --> 00:10:21,510 We're just going to put the Legacy card on the Proxmark, and we're going to read the SE card on the HID reader. 104 00:10:24,460 --> 00:10:28,320 Types out the command, and there you go. 105 00:10:28,320 --> 00:10:29,620 The downgrade is done. 106 00:10:39,220 --> 00:10:46,700 Like this person, said, like the cheapest way isn't even to use the flipper with that add-on board to downgrade the SE cards anymore. 107 00:10:46,700 --> 00:10:56,480 You can literally just buy that HID reader on Amazon for about $130, load up that config, and it's ready to downgrade any amount of standard keyed SE credentials. 108 00:10:59,380 --> 00:11:01,760 So now we're going to get into iClass SR. 109 00:11:01,760 --> 00:11:03,100 We have another way. 110 00:11:03,240 --> 00:11:08,880 So we're going to emulate an iClass SR with the correct card serial number and the secure identity object. 111 00:11:09,140 --> 00:11:15,900 And to accomplish this, we're going to actually need to do something special, which is dump the SIO, the secure identity object. 112 00:11:17,740 --> 00:11:29,540 So here in this example, we're going to get the publicly accessible parts of the card, which is the uh, the card serial number, the EPRS, and the application instruction area from that iClass SE card. 113 00:11:29,660 --> 00:11:33,900 And we're going to populate those values in a dump file and get them ready to emulate. 114 00:11:33,960 --> 00:11:39,840 And that those bytes 0006 instructs the reader that, hey, there is an SIO. 115 00:11:39,900 --> 00:11:49,600 We're going to use the reader on the building that's supposed to secure against, secure the building against, like attackers, to generate a successful challenge to dump the card. 116 00:11:51,940 --> 00:11:56,440 So once you have emulated that partial card against that reader, you're going to gather a trace. 117 00:11:56,440 --> 00:12:01,100 So that's what the reader is, that's what the reader is sending to the card and we're intercepting that data. 118 00:12:01,220 --> 00:12:07,320 And we see here, where we underline here, as that there is a MAC that we got. 119 00:12:07,320 --> 00:12:12,500 A message authentication code and that is what we're going to use to generate a successful challenge to dump that credential. 120 00:12:14,820 --> 00:12:21,440 So, after we have got, gotten that, we're going to run that standard dump command and what, what you got? 121 00:12:21,440 --> 00:12:25,100 The card just puked out all of its secure contents that's supposed to be secure. 122 00:12:25,900 --> 00:12:30,720 So manual dumping of that SIO is possible on the command line. 123 00:12:31,140 --> 00:12:38,900 But to build on that recently, Eric Betts, Betsy, also implemented NRMAC dumping on the Flipper Zero very recently with a very intuitive workflow. 124 00:12:39,020 --> 00:12:43,660 And this allows reading the publicly accessible parts of the card without authentication. 125 00:12:43,660 --> 00:12:50,840 Emulating that on the reader and, and using that to generate a successful challenge to dump the card. 126 00:12:51,700 --> 00:13:11,880 This as a side effect also allows users of the Flipper Zero who do not have a NARD add-on board or the secure access module to dump the credential, send it to someone who has that reader and to use that, to use that and use that to decrypt the copy and make a logical copy off-site. 127 00:13:12,840 --> 00:13:19,680 So, we're going to prepare our traditional, transitional credential by just transferring those over to the, to another card. 128 00:13:19,680 --> 00:13:32,380 Like we see here, those, the blue blocks are transferred under the, under the legacy payload and there we go, we have the SR credential already done. 129 00:13:38,030 --> 00:13:43,530 So, now we're going to get into the readers that enforce secure credentials. 130 00:13:43,850 --> 00:14:00,810 So, now we do have, since we have a full dump of that SE card already, we can emulate the high security SIO only secure credential using a bug in reader firmware that was originally discovered by NVX about a year and a half ago and also ported over to the Flipper Zero by editing some code. 131 00:14:01,850 --> 00:14:11,870 So, these actually work on signal readers, revision uh, on firmware 10.0, 5.6 or older and REV-E readers are still not patched at the moment. 132 00:14:11,870 --> 00:14:18,430 And you can also use reader manager to inspect those signal readers without even being close to them and you can verify what firmware they are running. 133 00:14:27,420 --> 00:14:32,460 So, we can make, we can make installations more secure in a few ways. 134 00:14:32,480 --> 00:14:36,040 By using a high security key set, such as standard two. 135 00:14:36,280 --> 00:14:39,380 Elite custom keys for SE installations. 136 00:14:39,920 --> 00:14:41,460 Updating firmware. 137 00:14:41,660 --> 00:14:47,920 Disabling or disabling all legacy technologies that issue secure credentials, such as SEOS, Desfire, mobile credentials. 138 00:14:49,060 --> 00:14:51,260 And now we're going to get into some fun stuff. 139 00:14:51,260 --> 00:14:52,560 What not to do. 140 00:14:52,980 --> 00:14:59,080 Over the years I've seen a lot of terrible installations of secure credentials being issued to clients. 141 00:14:59,080 --> 00:15:00,840 Such as this one here. 142 00:15:01,340 --> 00:15:03,800 You can see this is a very popular vendor in Canada. 143 00:15:03,800 --> 00:15:05,080 They're located in BC. 144 00:15:05,120 --> 00:15:08,060 And they have all the latest signal readers on all their buildings. 145 00:15:08,740 --> 00:15:15,960 But um, all their readers are pro- all their credentials are programmed with the same facility code as laid out in their official documentation that's available publicly online. 146 00:15:18,960 --> 00:15:20,060 And what do you know? 147 00:15:20,060 --> 00:15:23,560 All the, all the legacy technologies are enabled on that reader too. 148 00:15:23,560 --> 00:15:25,460 So, yeah. 149 00:15:25,680 --> 00:15:28,400 You can just, they are easily downgradable. 150 00:15:28,820 --> 00:15:31,120 And that's not even the worst part. 151 00:15:31,320 --> 00:15:34,680 Is that you don't even need the credential to make a copy. 152 00:15:34,680 --> 00:15:44,200 Because since we know that the facility code is the same, we can just uh, if the numbers aren't rubbed off on the back yet, we can just uh, take those numbers and just encode another one. 153 00:15:44,200 --> 00:15:45,640 And it's going to work. 154 00:15:48,180 --> 00:15:52,520 So given what we know, we can literally make a copy of that FOB in that picture there. 155 00:15:52,700 --> 00:15:59,040 And we can make a logical copy that is going to work on all of those readers from this specific integrator. 156 00:16:01,990 --> 00:16:04,470 And that concludes my presentation for today. 157 00:16:04,470 --> 00:16:08,150 I want to say I have a special thanks for the RFID hacking community. 158 00:16:08,430 --> 00:16:17,510 Uh, Eric Betts, also known as Betsy, has the uh, pretty good documentation on all the uh, I-class uh, credentials and how the data is laid out. 159 00:16:18,890 --> 00:16:32,650 NBX, who discovered, originally discovered the authentication bypass bug, which allows working uh, allows um, working I-class SE emulation, as well as the people class emulation code for the Flipper Zero. 160 00:16:33,770 --> 00:16:46,110 Kate, or Miss Steel Dev, genius on all things HID, and have to thank her for uh, taking in my uh, HID readers that I have ricked by bad firmware updates. 161 00:16:46,530 --> 00:16:55,430 And Iceman, and I wouldn't be here without Iceman urging me to do this talk on uh, I-class SE today. 162 00:16:57,290 --> 00:17:01,630 So if you have any questions, I'll be at the NFC table in the RF village. 163 00:17:02,970 --> 00:17:05,170 And thank you for attending.