00:00:00.000-->00:00:05.005 >>K welcome to the 3 o’ clock talk at - it’s my accent - talk - at Defcon. It’s gonna be 00:00:09.109-->00:00:16.049 Gabriel Ryan talking about owning the LAN. Give him a big DefCon welcome! Come on! 00:00:16.049-->00:00:22.122 [applause] I can’t hear you! Louder! [applause] >> Thanks. You guys awake yet? 00:00:22.122-->00:00:25.425 [intelligible responses] Fair enough. Alright. Um, got 45 minutes so, like, the first, 00:00:25.425-->00:00:29.396 like, 10 minutes of this is going to be really fast. Um, I wonder if I can back off from 00:00:29.396-->00:00:34.735 this thing. Can you guys still hear me if I do this? >> No. >>No? Okay. Alright so um I work 00:00:34.735-->00:00:38.472 for a company called Digital Silence we’re a pen testing firm in Denver. Um I could talk more 00:00:38.472-->00:00:42.843 but gonna skip that. So um my name is Gabriel Ryan also known in some circles as Solstice. I’m 00:00:42.843-->00:00:47.314 a cofounder and senior security assessment manager at Digital Silence. Um, used to work for a 00:00:47.314-->00:00:50.951 company called Gotham Digital Science before that I worked for a DoD contractor in Virginia 00:00:50.951-->00:00:53.887 called OGSystems. Which between the two of those companies it’s pretty much the best two names 00:00:53.887-->00:00:59.726 in security ever. Like OGSystems that’s f***ing awesome. Um, also, uh, about me, uh, I’m a 00:00:59.726-->00:01:05.766 red teamer, researcher, uh, new dad interestingly enough. Um, hence the dark circles under my 00:01:05.766-->00:01:09.937 eyes. Um, my linkedin- my linkedin handle is kind of interesting it’s ms08067. Got 00:01:09.937-->00:01:15.442 some chuckles out of you. So, um, this is a talk about, uh, bypassing particular port 00:01:15.442-->00:01:20.514 security technology. So before we get started we kind of have to go over some introductory 00:01:20.514-->00:01:25.919 information about 802 dot 1x. Um 802 dot 1x is an authentication protocol that is designed to 00:01:25.919-->00:01:29.156 provide rudimentary authentication to, um, local area networks and also wireless 00:01:29.156-->00:01:33.493 local area networks. Um, the protocol defines an exchange between three parties - the 00:01:33.493-->00:01:36.830 supplicant which is the client device that your gonna try to connect to the network. Uh, the 00:01:36.830-->00:01:39.967 authenticator which is the network device that the device - that the supplicant is 00:01:39.967-->00:01:43.870 connecting to and providing access to the LAN and the authentication server which is a 00:01:43.870-->00:01:49.443 host running deeper inside the network um and it is usually running some time of like Triple 00:01:49.443-->00:01:53.947 A software like RADIUS that actually performs the actual validation. Um, so you can think 00:01:53.947-->00:01:56.817 of the authenticator y’know the authenticator can be like your switch right that the device is 00:01:56.817-->00:01:59.519 connecting to and you can think of it like a gatekeeper like a security guard and the 00:01:59.519-->00:02:03.824 supplicant is gonna connect to it and provide the authenticator with uh some credentials and the 00:02:03.824-->00:02:07.327 authenticator doesn’t really know what to do with the credentials so it just forwards 00:02:07.327-->00:02:10.630 them off to the authentication server which then validates the credentials and then either 00:02:10.630-->00:02:14.234 sends a message back to the authenticator and tells it to either allow this device to 00:02:14.234-->00:02:19.239 access the network or not to. Um, 802.1x is typically a four step process. Um beginning with 00:02:21.308-->00:02:25.712 initialization uh initiation uh then we go to the EAP negotiation and authentication 00:02:25.712-->00:02:31.518 and we’ll talk more about that in a second. So um when we connect to a switchboard that is 00:02:31.518-->00:02:35.155 protected by 802 dot 1x it’s gonna have one of two - it’s going to be one of two states. 00:02:35.155-->00:02:39.626 It’s going to be authorized and when it’s in the authorized state traffic’s going to be 00:02:39.626-->00:02:43.196 completely unrestricted. At least by 802 dot 1x and it’s when it’s in the unauthorized 00:02:43.196-->00:02:48.635 state traffic is restricted to only 802 dot 1x traffic. Um we mentioned the first step of the 00:02:48.635-->00:02:52.572 proc- of the authentication process is initialization and y’know what this means is the 00:02:52.572-->00:02:57.144 supplicant is gonna connect to the switch port uh the device is gonna connect to the switch port 00:02:57.144-->00:02:59.146 and it’s gonna start out disabled. Uh the authenticator is going to detect this new 00:02:59.146-->00:03:02.649 connection and enable the switch port but the switch port is going to start out in an 00:03:02.649-->00:03:06.153 unauthorized state. Uh cuz we haven’t authenticated yet. Um then we move to step two which 00:03:06.153-->00:03:09.156 is initiation. Which we’re initiating the authentication process. Uh the first step of 00:03:09.156-->00:03:12.459 initiation is actually optional. And this has security implications that we’re going to 00:03:12.459-->00:03:15.395 talk about later. Uh the supplicant um is going to uh it’s going to begin with the 00:03:15.395-->00:03:17.798 supplicant sending an EAPOL Start frame to the authenticator. The authenticator 00:03:17.798-->00:03:21.635 is going to receive this and respond with an EAP Request Identity frame um it’s just 00:03:21.635-->00:03:25.338 going to send it back to the supplicant. And y'know at that point that EAP Request Identity 00:03:25.338-->00:03:29.076 frame is going to ask basically who are you and the supplicant’s going to respond with an EAP 00:03:29.076-->00:03:32.646 Response Identity frame which contains the username. Um or an identifier such as the username. 00:03:32.646-->00:03:36.650 Uh the authenticator is going to encaps- encapsulate the EAP Response Identity in a RADIUS 00:03:36.650-->00:03:40.087 Access Request frame because it can’t- it can’t actually validate the stuff itself and 00:03:40.087-->00:03:42.823 it’s going to forward it off to the authentication server and then we are going to move from 00:03:42.823-->00:03:49.029 step two to step three which is EAP negotiation. So um 802 dot 1x actually implements uh 00:03:49.029-->00:03:54.801 authentication using EAP and EAP you can think of it like an API or black box for performing 00:03:54.801-->00:03:58.371 authentication. Uh there’s many ways to implement it but the important part is that there’s 00:03:58.371-->00:04:02.609 going to be a set of inputs y’know kind of like a generic um set of acceptable inputs that 00:04:02.609-->00:04:06.046 you can put into it and you’re going to get a consistent output from it which is either an EAP 00:04:06.046-->00:04:11.251 success or EAP failure or authen- authentication success or authentication failure. Um, 00:04:11.251-->00:04:13.687 so in step three what’s going to happen is that the authentications and the 00:04:13.687-->00:04:16.723 supplicants are going to haggle for a bit until they decide on the EAP method they’re both 00:04:16.723-->00:04:23.096 comfortable with. When they do, then you move to step four, which is authentication. Um, so 00:04:23.096-->00:04:26.500 this is where we actually perform the EAP authentication. The specific details as we 00:04:26.500-->00:04:30.303 mentioned of how this should work are dependant on the EAP method uh that - the EAP method 00:04:30.303-->00:04:34.541 is just a fancy way of saying y’know however you’re choosing to implement EAP. Um it’s 00:04:34.541-->00:04:38.778 dependant on the EAP method chosen by the authentication server and the supplicant. So 00:04:38.778-->00:04:41.848 this will always request in an EAP success of EAP failure message. That’s the important 00:04:41.848-->00:04:46.887 part to remember about this. And if we get an EAP success the port is going to be set to an 00:04:46.887-->00:04:48.889 authorized state and communication is going to be allowed through that port. 00:04:48.889-->00:04:52.792 Otherwise it’s going to either remain unauthorized or a lot of cases they’re just going to kind 00:04:52.792-->00:04:56.663 of shut down the port entirely and go alert someone. Which is bad. If your in MACsec that is. 00:04:56.663-->00:05:02.402 So we’ve been talking a lot about EAP. Um, EAP is short for extensible authentication 00:05:02.402-->00:05:07.007 protocol. Um really like calling it a protocol is like not or like an authentication protocol 00:05:07.007-->00:05:12.279 is kind of misleading. It’s more of like an authentication framework because like it’s only 00:05:12.279-->00:05:15.415 defining message formats. The actual implementation is wrapped up in what’s called an EAP 00:05:15.415-->00:05:19.286 method. And as we mentioned y’know earlier it’s pretty much like a black box for performing 00:05:19.286-->00:05:24.457 authentication. Um just gonna briefly mention some notable EAP methods. Uh we’re gonna talk 00:05:24.457-->00:05:30.430 about them in more detail later but - I should probably hit play on that - um the first of which 00:05:30.430-->00:05:35.669 is EAP MD5. Um, spoiler alert. It’s kind of bad. There are a lot of security issues with it. 00:05:35.669-->00:05:40.674 EAP PEAP. Another EAP method. Also sucks. Um, I know it’s soap but it looks delicious so I just 00:05:42.742-->00:05:48.114 wanted to include it in this presentation. There’s also EAP TLS and traditional school of 00:05:48.114-->00:05:52.519 thought is EAP TLS is a lot better than the other two I just mentioned but um more on that 00:05:52.519-->00:05:57.357 later too. Uh, with that out of the way let’s do a brief history of wired port security just to 00:05:57.357-->00:06:02.028 kind of get ourselves up to speed with what we’re going to talk about today. Um in 2001 uh 00:06:02.028-->00:06:08.034 the y'know IEEE um released um 802 dot 1x 2001. And this standard was created to provide 00:06:08.034-->00:06:11.972 a rudimentary authentication mechanism um for local area networks. The proto- the 00:06:11.972-->00:06:17.143 standard was revised in 2004 with 802 dot 1x 2004 um y’know and this extension was basically 00:06:17.143-->00:06:21.748 designed to facilitate the use of the 802 dot 1x in wireless environments. A year after that 00:06:21.748-->00:06:25.518 happened a researcher named Steve Riley uh figured out that you could actually bypass 802 00:06:25.518-->00:06:30.557 dot 1x 2004 and 2001 as well by inserting a hub between the supplicant and the 00:06:30.557-->00:06:34.327 authenticator. And basically doing this let’s you just passively sniff traffic uh 00:06:34.327-->00:06:38.531 between the two - those two entities. Right? Um you could also interact with a network to 00:06:38.531-->00:06:42.903 a limited degree by injecting UDP traffic um injecting TCP packets would cause a race 00:06:42.903-->00:06:48.241 condition for that wasn’t really feasible. But this was like the first y'know kind of documented 00:06:48.241-->00:06:54.381 uh mention of such a bypass. Fast forward six years to 2011 “Abb” of Gremwell Security 00:06:54.381-->00:06:58.318 created a tool called Marvin. Marvin uh was able to bypass 802 dot 1x by introducing the rogue 00:06:58.318-->00:07:01.955 device directly between the supplicant and the switch so before we were using a hub which 00:07:01.955-->00:07:06.593 by 2011 those were starting to become harder and harder to find. Uh but Abb’s tool was 00:07:06.593-->00:07:09.829 actually able to - it had two network interfaces y’know and it had this rogue device that is 00:07:09.829-->00:07:14.067 inserted between the switch and- and like this authorized workstation and the rogue device 00:07:14.067-->00:07:18.805 has two networks interfaces. One of them is connected to the um to the workstation one of them 00:07:18.805-->00:07:22.609 is connected to the switch and it actually is able to use a- a- a Linux bridge to just kind of 00:07:22.609-->00:07:27.447 forward these packets transparently back and forth and bypass port security uh without 00:07:27.447-->00:07:32.152 using a hub. And also it- you’re able to get full packet- and uh full interaction with the 00:07:32.152-->00:07:36.189 network using packet injection. Uh later that year and- and this is actually probably the most 00:07:36.189-->00:07:41.728 widely used 802 dot 1x 2004 bypass out there um Alva Duckwall introduced um a similar 00:07:41.728-->00:07:47.801 um a similar bypass technique. It was a little simpler which is a really good thing. Um so 00:07:47.801-->00:07:51.004 Albert Duckwall’s implementation also uses a transparent bridge to introduce the rogue device 00:07:51.004-->00:07:55.608 between the supplicant and switch. Uh but unlike Abb’s tool it doesn’t rely on packet injec- 00:07:55.608-->00:07:59.913 injection. Um, instead you interact with the network by creating a source net using IP 00:07:59.913-->00:08:04.384 tables and this lets you basically push packets onto the network and- and make it look as 00:08:04.384-->00:08:09.022 if it’s coming from the um the supplicant device and the authorized workstation that 00:08:09.022-->00:08:15.228 you’re kind of like middling during this process. Uh and actually very recently, 2017, we 00:08:15.228-->00:08:19.165 have Valerian Legrande who created um a tool called Fenrir and it works very similar to 00:08:19.165-->00:08:23.002 Duckwall’s tool but it’s all implemented in Python at a very high level. Uh so you don’t run 00:08:23.002-->00:08:28.007 into some of the kernel patching issues that uh uh Duckwall’s tool is- is kind of affected by. 00:08:28.007-->00:08:32.212 Uh and it’s- it’s- it’s pretty cool. It’s got a modular design and support for a responder. All 00:08:32.212-->00:08:37.550 that good stuff. So um I guess when I started working on this project uh it made sense that 00:08:37.550-->00:08:42.922 the first thing to do should be to uh kind of try to recreate the classic uh Duckwall’s 00:08:42.922-->00:08:47.127 classic 802 dot 1x um 2004 bypass and also see if there’s any ways it can be improved 00:08:47.127-->00:08:51.998 upon. Um so looking at Duckwall’s 802 dot 1x bypass more closely uh we mentioned it 00:08:51.998-->00:08:56.202 used a transparent bridge to silently introduce the rogue device between the supplicant 00:08:56.202-->00:08:59.773 and authenticator. And you achieve network interaction using SourceNet um Another 00:08:59.773-->00:09:03.710 interesting feature of of Duckwalls device. Remember when we- when we’re performing this 00:09:03.710-->00:09:07.447 style of attack we’re- y’know presumably we’re not able- this is gonna be performed on a 00:09:07.447-->00:09:10.917 network in a- in a physical environment like a building or something like that that we do 00:09:10.917-->00:09:14.587 not own and we’re not supposed to be getting into in the first place. Y’know so it’s not like 00:09:14.587-->00:09:17.824 y’know you’re on like a- like a red team or physical security assessment where you can go walk 00:09:17.824-->00:09:21.761 in y’know, set up this device, install like a monitor, and just sit there on the computer 00:09:21.761-->00:09:24.297 interacting with this thing. You have to kind of like get in there hook this thing up and get 00:09:24.297-->00:09:27.700 out. So it’s important when you’re- when you’re doing this kind of thing that whatever- 00:09:27.700-->00:09:31.271 what- however you implement these kinds of attacks you provide yourself with a 00:09:31.271-->00:09:35.909 mechanism of- of reconnecting with this rogue device uh remotely um once you’ve 00:09:35.909-->00:09:40.480 performed the bypass and once you’ve made your egress from the building. So the way Duckwall’s 00:09:40.480-->00:09:44.084 implementation does this well actually it uses two methods. The first is a hidden SSH 00:09:44.084-->00:09:49.856 service that’s created using destination adding and also um uh it has a port for like an 00:09:49.856-->00:09:54.227 outbound SSH channel uh that goes through the- the target network and lets you connect 00:09:54.227-->00:10:01.201 that way. Um so I was able to improve upon Duckwall’s implementation a couple ways. Um 00:10:01.201-->00:10:04.737 y'know back- back when Duckwall’s implementation was first created uh the Linux 00:10:04.737-->00:10:08.575 kernel was not forwarding equal packets over a bridge. It was completely disabled. Uh and as a 00:10:08.575-->00:10:12.378 security feature. Uh so and actually traditionally if you look at most tools that deal 00:10:12.378-->00:10:16.549 with 802 dot 1x 2004 or bypassing it should I say. They deal with this problem in the 00:10:16.549-->00:10:20.253 same way that Duckwall had to which is essentially patching the Linux kernel. Um the 00:10:20.253-->00:10:23.790 exception to this is Fenrir by Valerian Legrand and he just does this completely at a high 00:10:23.790-->00:10:27.127 level using Scapy but it doesn’t really matter you don’t have to rely on the- the kernel 00:10:27.127-->00:10:32.165 patching. Um so this made sense at the time but there are some problems with both of these 00:10:32.165-->00:10:36.002 approaches. And one is that relying on kernel patches can become un- unwieldy. Um at this 00:10:36.002-->00:10:39.138 time there are no longer any publicly available kernel patches or modern ker-kernel 00:10:39.138-->00:10:42.976 versions that will perform this equal bridging. And the reason for that if you think about what 00:10:42.976-->00:10:47.547 it takes to maintain a tool of any kind y'know you constantly have to maintain this kernel 00:10:47.547-->00:10:51.584 patch because if you don’t y'know you can bet that the- the kernel development team is going 00:10:51.584-->00:10:56.122 to keep working on y'know pushing updates to the kernel. And kind of if you think of your 00:10:56.122-->00:11:00.593 like here’s your patch and here’s like the direction that the kernel’s going. Eventually 00:11:00.593-->00:11:05.331 that patch is no longer going to work um after subsequent iterations of the updates to the 00:11:05.331-->00:11:10.036 kernel. And that’s kind of the state we’re in now um and then if you deal with uh high level 00:11:10.036-->00:11:14.040 tools such as Scapy uh they work really well because you don’t have to rely on- on kernel 00:11:14.040-->00:11:17.043 patches but also it can slow down your bridge under heavy loads because it just isn’t able 00:11:17.043-->00:11:21.447 to handle it in the same way that the- the lower level implementations can. So 00:11:21.447-->00:11:24.684 fortunately the situation has dramatically improved since Duckwall’s contribution. In 00:11:24.684-->00:11:29.289 2012, EAPOL bridging actually was- was added to the kernel uh but kind of as an optional 00:11:29.289-->00:11:32.625 feature that you had to enable using the proc file system. The proc file system is pretty cool 00:11:32.625-->00:11:36.629 it’s actually just like an API Linux kernel that you can- that it let’s you reconfigure stuff 00:11:36.629-->00:11:40.033 on the fly and you can just interact with it by setting values and files and stuff like 00:11:40.033-->00:11:44.604 that. So basically you just you- you change the- the value of this file on the proc file 00:11:44.604-->00:11:50.209 system um and you can port epaul packets. So we added that in there. And the other improvement 00:11:50.209-->00:11:54.280 that we added was improvement for side channel interaction. Uh when Duckwall created his 00:11:54.280-->00:12:00.420 original 802 dot 1x bypass um y'know this was 2011. Cellular modems were- were pretty 00:12:00.420-->00:12:03.423 unsophisticated. They were slow they were very expensive. You couldn’t just go down to Best 00:12:03.423-->00:12:08.328 Buy or- or- or whatever and buy yourself like a 15 dollar LTE uh modem with a prepaid plan that 00:12:08.328-->00:12:11.664 you could plug into your rogue device. So this is why you kind of had to rely on the hidden SSH 00:12:11.664-->00:12:16.669 service and the- and the outbound SSH channels. Um this is not a perfect solution though 00:12:16.669-->00:12:19.405 because it relies on the assumption that egress filtering can be bypassed. So if we 00:12:19.405-->00:12:22.775 improve upon it that would be great. Also relies on pushing traffic through the target 00:12:22.775-->00:12:27.313 network creating an opportunity for detection. Um so y'know kind of now that we have the 00:12:27.313-->00:12:31.584 opportunity its several years later at this point so we y'know have the opportunity to leverage 00:12:31.584-->00:12:36.322 some of this newer um cellular technology uh to kind of establish a side channel to our 00:12:36.322-->00:12:39.492 leave behind device. That also let us deal with air gap networks and stuff like that. 00:12:39.492-->00:12:44.964 Um, so y'know the updated implementation it actually relies on a side channel 00:12:44.964-->00:12:47.600 interface to provide the attacker with connectivity rather than the hidden SSH 00:12:47.600-->00:12:51.537 service for the outbound SSH channel. Um we had to mod- modify some firewall rules to 00:12:51.537-->00:12:56.576 get this to work but it’s totally worth it because now you can just connect over LTE. So 00:12:56.576-->00:13:01.514 here’s the demo of- of uh our improved implementation here. Let me figure out how to get 00:13:07.020-->00:13:12.025 this to play. Oh cool. Okay. Cannot fast forward. Interesting. Alright well. 00:13:18.698-->00:13:23.703 Alright the video’s running. I just don’t know how to- ah jeez. Okay alright that seems to be 00:13:28.675-->00:13:33.680 working so I’m not gonna touch it. Okay so um now it’s paused. Okay so what’s happening here 00:13:40.720-->00:13:45.158 right in the- in the left hand side we have the attacker’s device um and on the top right 00:13:45.158-->00:13:50.930 here if you can see my mouse- can you guys see my mouse? Okay. Well pretend there’s a mouse 00:13:50.930-->00:13:55.702 pointing at the top right of the screen. That’s the supplicant. Let’s play pretend. Um and the- 00:13:55.702-->00:13:59.205 and the- and the bottom right that’s the switch we’re connecting to. You notice that 00:13:59.205-->00:14:04.410 we’ve disconnected the device here and we’re running this soft from the left which is setting 00:14:04.410-->00:14:07.613 up the transfer and bridge we were talking about and up its turning yellow in the bottom 00:14:07.613-->00:14:11.517 right so that means it’s reauthenticating and we’re just kind of forwarding that 00:14:11.517-->00:14:16.289 authentication and oh magically the supplicant that’s in the top right is able to communicate 00:14:16.289-->00:14:19.258 with- it’s going to go back to pinging 8 point 8 point 8 point 8 which apparently this is just 00:14:19.258-->00:14:24.397 what this workstation is used for. Um yeah so now we’re going to add the network interaction 00:14:24.397-->00:14:29.602 by running this other command um basically I- you can see all these other flags and other 00:14:29.602-->00:14:35.108 information that we’re passing to it. When we set up the initial transparent bypass we 00:14:35.108-->00:14:40.113 were y’know pushing into position where we could sniff all that. Which is pretty neat. 00:14:42.348-->00:14:48.921 Um. Is it still running? Well long story short. You can- you can scan things with NMap but um 00:14:48.921-->00:14:54.393 just I’ll post the videos on- on- on the accompanying blog post after this so you can go 00:14:54.393-->00:14:58.865 check them out there. Anyways so all tradition 802 dot 1x bypasses are either hub based, 00:14:58.865-->00:15:02.435 injection, or bridge based take advantage of the same fundamental security issues that 00:15:02.435-->00:15:06.873 affect 802 dot 1x 2004. Uh the protocol does not provide encryption and the protocol does 00:15:06.873-->00:15:10.076 not support authentication on a packet by packet basis and that’s why this bridge based 00:15:10.076-->00:15:15.548 bypass works. Um so to kind of mitigate this problem uh y'know another remission to the 00:15:15.548-->00:15:22.188 protocol is introduced called 802 dot 1x 2010. And 802 dot 1x 2010 uh uses MACsec which 00:15:22.188-->00:15:26.659 provides layer two encryption formed on a hop by hop basis and packet by packet integrity 00:15:26.659-->00:15:31.430 checks. So this kind of throws a wrench in the whole bridge based attack scenario that we just 00:15:31.430-->00:15:34.600 talked about. Um interestingly enough it also allows network administrators with the means to 00:15:34.600-->00:15:38.004 inspect data in transfer. So because the encryption is only performed y'know on a hop by hop 00:15:38.004-->00:15:43.142 basis you can still inspect traffic which uh is actually a pretty big deal. So 802 dot 1x 00:15:43.142-->00:15:48.214 2010 works in three stages. The first stage is authentication and master key distribution. The 00:15:48.214-->00:15:53.452 second stage is session key agreement and the third stage is the session secure stage. So 00:15:53.452-->00:15:57.623 stage one we mentioned is authentication. I mean that is pretty much the 802 dot 1x 00:15:57.623-->00:16:00.960 authentication process that we talked about before. Um you’re going to perform those four 00:16:00.960-->00:16:05.865 steps that we talked about and then your going to perform EAP authentication um using some EAP 00:16:05.865-->00:16:09.836 method that is selected between the supplicant and the authentication server. And if 00:16:09.836-->00:16:14.440 that succeeds then we’ll move to stage two which is the session- session key agreement. Uh the 00:16:14.440-->00:16:19.078 basically the what's happening in the session key agreement is that the um the authenticator is 00:16:19.078-->00:16:24.183 going to establish that the supplicant is actually capable of supported MACsec and if it is 00:16:24.183-->00:16:27.353 uh then you’re going to install the sac on the supplicant and we’re going to move to step 00:16:27.353-->00:16:32.959 three. Now step three is session secure. So in session secure um basically at this point 00:16:32.959-->00:16:39.532 everything is encrypted at the layer two. Uh your MACsec is fully enabled and this is kind 00:16:39.532-->00:16:44.537 where we’re trying to get to. So I guess like um with this in mind right y'know whenever 00:16:48.574-->00:16:52.845 you're trying to come up with like a way of bypassing or attacking some kind of new 00:16:52.845-->00:16:58.851 technology I think it’s useful to- to kind of look at parallels between whatever you’re 00:16:58.851-->00:17:03.122 currently working with and similar technologies that have been compromised in the past or 00:17:03.122-->00:17:09.795 even recently. And with that in mind this particular section 6 point 6 in the 802 dot 1x 2010 00:17:09.795-->00:17:14.901 standard kind of stuck out at me. And basically it’s comparing it’s basically stating the 00:17:14.901-->00:17:16.903 cryptographic capabilities provided by 802 dot 1x 2010 kind of play the same role as similar 00:17:16.903-->00:17:21.908 y'know cryptographic capabilities provided for wireless networks in 802 dot 11, 00:17:26.279-->00:17:31.284 right? So I think what they’re alluding to here are parallels between macsec and WPA. And 00:17:33.686-->00:17:38.691 actually if you look at y'know why intro- WPA 1 was released back in 2003, well when it was 00:17:40.793-->00:17:45.431 released what it was introducing was layer two encryption between the access point to the station. 00:17:45.431-->00:17:49.335 And this y'know authentication that provided access to this encryption was provided by EAP 00:17:49.335-->00:17:54.340 or using preshared key as a fallback alternative. Um when WPA was released there was a 00:17:56.676-->00:18:00.746 major paradigm shift that had to happen from an attacker’s perspective because y'know prior 00:18:00.746-->00:18:04.083 to WPA injection attacks were all the rage. y'know you could use them. They were very 00:18:04.083-->00:18:09.088 effective against web. They were very effective against open networks. Um but now due to WPA 00:18:09.088-->00:18:13.192 they were no longer possible due to that layer two encryption. So what you saw was a major shift 00:18:13.192-->00:18:17.964 in focus from attacking um the encryption itself to actually attacking the authentication 00:18:17.964-->00:18:22.001 mechanism and not even dealing with the encryption. So that’s where you start to see the WPA 00:18:22.001-->00:18:25.137 handshake captures and dictionary attacks against PSK networks and that’s when you 00:18:25.137-->00:18:29.775 start to see rogue AP attacks against weak EAP methods on wireless networks emerge as 00:18:29.775-->00:18:34.780 well. So you fast forward to 2010 right? 802 dot 1x 2010 has been released and y'know very 00:18:36.949-->00:18:41.654 similarly we are providing hop by hop layer two encryption using MACsec and y'know this is 00:18:41.654-->00:18:46.258 being this encryption is either occurring between the device and the switch or from multiple uh 00:18:46.258-->00:18:49.962 two switches to kind of encrypt the traffic between the two of them. Once again authentication 00:18:49.962-->00:18:54.967 is being provided by EAP or PSK as a fallback. Kind of see where I’m going with this? So I mean 00:19:00.339-->00:19:04.377 the obvious hypothesis here is that it makes sense to start with a hypothesis that you could 00:19:04.377-->00:19:08.214 also perform a similar shift of focus and start looking at attacking authentication 00:19:08.214-->00:19:13.152 mechanism rather than trying to attack MACsec itself because why do things that are hard? Um with 00:19:13.152-->00:19:18.257 PSK um I would venture to speculate that some kind of dictionary attack may be 00:19:18.257-->00:19:23.496 possible although I haven’t really worked on that so I don’t know. Um but in this talk we’re 00:19:23.496-->00:19:29.168 talking about attacks against weak EAP implementations so another spoiler alert there. To 00:19:29.168-->00:19:32.705 kind of more understand this- this- this- these kind of parallels let’s talk very 00:19:32.705-->00:19:37.710 briefly about attacks again WPA 2 EAP right? And um so the most commonly like widely known um 00:19:43.315-->00:19:49.855 weak AP method is uh EAP PEAP and it’s very similar to EAP TTLS um so you can kind of talk 00:19:49.855-->00:19:54.193 about them y'know in the same way. Um the way that EAP PEAP works is that the supplicant and 00:19:54.193-->00:19:57.229 remember we’re talking in a wireless context now- the supplicant s going to make an 00:19:57.229-->00:20:00.332 authentication request to the authentication server which is going to respond with an x509 00:20:00.332-->00:20:04.670 certificate. At this point um basically the role of the certificate is for the 00:20:04.670-->00:20:08.207 authentication server to prove to the supplicant uh that it is who it says it is. That is can 00:20:08.207-->00:20:12.478 be trusted. The supplicant is either going to accept or deny- it’s either going to accept or 00:20:12.478-->00:20:16.048 reject that certificate. If it accepts that certificate it means that trust has been 00:20:16.048-->00:20:18.384 established between the supplicant and the authentication server which 00:20:18.384-->00:20:22.321 moves us from the outer authentication process to the inner authentication process of 00:20:22.321-->00:20:26.826 EAP PEAP. And y'know the inner authentication process happens when the secure tunnel is 00:20:26.826-->00:20:30.329 established between the supplicant and the authentication server and 00:20:30.329-->00:20:36.602 basically transmit your- your identity your username um uh password in the form of hashes 00:20:36.602-->00:20:39.672 uh what have you through this secure tunnel and this tunnel is there to prevent you from 00:20:39.672-->00:20:45.010 sniffing this process passively. So this process does have some security issues because remember 00:20:45.010-->00:20:47.813 we are operating wirelessly. Two researchers name Brad Antoniewicz and Josh Wright um 00:20:47.813-->00:20:52.785 back in 2008 they were able to discover that you could use a rogue um access point attack to 00:20:52.785-->00:20:55.921 force the supplicant to authenticate with a rogue authentication server. Um what 00:20:55.921-->00:21:00.126 do we mean by rogue access point attack. Well basically um you have all these- these- these 00:21:00.126-->00:21:04.263 wireless devices here and you force them to connect to your own access point, establishing a 00:21:04.263-->00:21:09.135 man in the middle. Um there are many ways to implement this uh but that is the general concept 00:21:09.135-->00:21:15.574 that remains the same y'know. So pretty much you force them to connect to you and then you 00:21:15.574-->00:21:18.611 force it to authenticate with your rogue authentication server. To do this you have to 00:21:18.611-->00:21:24.216 send the um you do have to send the target device y'know one of these x509 certificates. It’s 00:21:24.216-->00:21:28.654 probably going to have to be self signed or at least generated by rogue CA but y'know 00:21:28.654-->00:21:31.957 in a lot of cases the supplicant will just automatically accept it or it will be left up to the 00:21:31.957-->00:21:36.662 user to accept it, in which case y'know you’ll always find someone within an organization 00:21:36.662-->00:21:42.001 that’s going to accept that thing so it’s kind of okay. Um making this worse right we 00:21:42.001-->00:21:47.039 talked about inner authentication as being the part that’s happening through that 00:21:47.039-->00:21:50.809 secure tunnel. Well the strongest form of EAP authentication available for EAP 00:21:50.809-->00:21:55.814 PEAP and EAP TTLS is MSCHAPv2 y'know the ones that are widely used. So MSCHAPv2 is interesting 00:21:58.250-->00:22:02.555 because although it provides mutual authentication um it actually is vulnerable to a 00:22:02.555-->00:22:07.626 cryptographic weakness that was discovered by Moxie Marlinspike and David Hulton back in 2012. 00:22:07.626-->00:22:11.830 Um essentially once you capture the um MSCHAPv2 challenge and response that is sent through 00:22:11.830-->00:22:17.436 the secure tunnel Um using the rogue AP attack that we just described uh you can reduce it 00:22:17.436-->00:22:23.008 to 56 bits of DES encryption um using a divide and conquer attack. Which y'know at that 00:22:23.008-->00:22:28.180 point uh Marlinspike and Hulton were able to demonstrate that with a 100 percent success rate 00:22:28.180-->00:22:32.384 regardless of the length of the- of the password they were able to convert it into a NTU 00:22:32.384-->00:22:36.655 password hash which is password equivalent within 24 hours with a 100 percent success rate. Now 00:22:36.655-->00:22:39.725 remember this is back in 2012. Although they were using a hundred thousand dollar cracking 00:22:39.725-->00:22:43.996 rig to do this, if you look at what their cracking rig would cost now it’s somewhere between 00:22:43.996-->00:22:47.866 like ten and twenty thousand dollars which is roughly within the- it’s actually pretty much 00:22:47.866-->00:22:54.139 within the range of most kind of like mid level i guess like the start ups of the criminal world, 00:22:54.139-->00:22:59.144 if you will. Um let alone like a nation state or like an APT. SO let’s go back to 802 dot 1x 00:23:02.615-->00:23:08.587 2010. Um with all this in mind the most important take away about 802 dot 1x 2010 from an 00:23:08.587-->00:23:12.491 attackers perspective is that is still uses EAP to authenticate devices to the network and EAP 00:23:12.491-->00:23:17.730 as we just talked about is only as secure as the EAP method used. So y'know the 802 dot 1x- 00:23:17.730-->00:23:22.835 the 802 dot 1x 2010 standard allows any EAP method so long as it supports mutual 00:23:22.835-->00:23:27.172 authentication, supports derivation of keys that are at least 128 bits in length and 00:23:27.172-->00:23:31.677 generates an MSK of at least 64 octets. There are plenty of commonly seen weak EAP methods 00:23:31.677-->00:23:36.582 that meet these requirements including EAP PEAP, EAP TTLS, et cetera. I think you see where 00:23:36.582-->00:23:42.922 we’re going with this. So this is where we kind of go into the our new contribution where um 00:23:42.922-->00:23:46.825 we’re going to introduce something called a rogue gateway attack which can be used to 00:23:46.825-->00:23:50.796 defeat 802 dot 1x 2010. This slide is kind of misleading because it’s saying defeating 00:23:50.796-->00:23:54.566 MACsec with um using rogue gateways attacks. Um really we’re just avoiding having to 00:23:54.566-->00:24:00.706 deal with MACsec. Um by kind of cutting it off at the authentication process. So the 00:24:00.706-->00:24:04.476 goal of a rogue gateway attack is to force the supplicant to authenticate with the attackers 00:24:04.476-->00:24:08.414 device. Remember we’re on a wired- we’re on a wired network not a wireless network so we’re 00:24:08.414-->00:24:12.785 going to have to get creative in figuring out a way y'know that we can do this. Um once- once 00:24:12.785-->00:24:16.088 you get this device to authenticate with you um you’re able to capture hashes which you 00:24:16.088-->00:24:20.726 crack and then you get credentials and then you can just authenticate with the 00:24:20.726-->00:24:23.929 network directly at that point. Uh so when we talked about bypassing 802 dot 1x 2004 we 00:24:23.929-->00:24:27.866 used a man in the middle style bypass uh so here you see we have this rogue device that is 00:24:27.866-->00:24:31.870 directly between the authenticator and the uh authorized workstation which is 00:24:31.870-->00:24:35.774 the supplicant. Um we’re going to have to do something a bit different with 802 dot 1x 2010. 00:24:35.774-->00:24:39.678 We’re going to have to go over direct access because this isn’t going to work uh due to that 00:24:39.678-->00:24:44.650 layer two encryption. So let’s talk about how we can build a device that can do this. Uh the 00:24:44.650-->00:24:48.053 first set to setting up our bypass is actually to just set up our device. You see this? 00:24:48.053-->00:24:53.625 This is our rogue device here. Kind of our design for it. Um we have a three network interface a 00:24:53.625-->00:24:58.530 side channel interface that’s going to provide us remote access to this device uh via LTE 00:24:58.530-->00:25:02.067 or what have you right? We’re also going to have an upstream interface that’s going to be 00:25:02.067-->00:25:06.672 connected or eventually be connected should I say to the switchboard. Um and we have our- 00:25:06.672-->00:25:10.709 our PHY interface here which is going to be- or P H Y- I don’t know how to say that. I just see 00:25:10.709-->00:25:16.415 it in documents all the time. >>PHY >>PHY. Okay. Cool. Cool. Learn a new things everyday. So 00:25:16.415-->00:25:21.387 we have our PHY interface. And that’s connected to the supplicant. And um the device 00:25:21.387-->00:25:25.324 itself you just use a minicomputer. We use a Intel Nook running Fedora 28. Um so 00:25:25.324-->00:25:30.329 what we’re going to need is a way of diverting traffic to the rogue device. Um so I wanted to 00:25:34.299-->00:25:39.238 take a look at this picture right. This is- this is a set of train tracks and the end of the 00:25:39.238-->00:25:43.375 train tracks here we have this little train station here and we have a switch here and it- 00:25:43.375-->00:25:47.513 depending on which way the switch is configured . If the switch is configured in Mode A 00:25:47.513-->00:25:51.517 it’s going to go directly into the train station. If the switch is configured in Mode B- um 00:25:51.517-->00:25:57.456 Mode- I just misspelled it. In Mode B, uh, the train is just going to bypass the station 00:25:57.456-->00:26:00.793 entirely. It’d be cool if we could do something like that with ethernet right? So you 00:26:00.793-->00:26:06.031 actually can. You buy these little devices off Amazon uh for like ten bucks and it’s a 00:26:06.031-->00:26:11.103 mechanical A/B splitter. Uh you press the A button and your ethernet traffic is diverted 00:26:11.103-->00:26:16.575 mechanically through rogue A uh or to port A. Press the B button and it’s um diverted 00:26:16.575-->00:26:21.647 mechanically through port B. Um this would be cool but y'know since this is a leave- live- uh 00:26:21.647-->00:26:25.984 leave behind device, if we’re going to actually use this we need a way of manipulating that 00:26:25.984-->00:26:30.489 push switch. Um there are a couple- a couple ways you could do this. Theoretically you could 00:26:30.489-->00:26:36.094 use a relay um to do this which essentially you either use y'know high or low current to 00:26:36.094-->00:26:41.433 kind of like effect where the y'know ethernet traffic is going to go. Unless you’re an 00:26:41.433-->00:26:45.003 electrical engineer and that’s definitely not me building something like this is going to 00:26:45.003-->00:26:50.809 lead to impedance issues. Um which is why the better options is to use solenoids. A solenoid 00:26:50.809-->00:26:55.714 is basically a linear motor. Uh you have a rod going through y'know with a coil wrapped 00:26:55.714-->00:26:59.685 around it and you run electricity through the coil and depend- y'know depending is the 00:26:59.685-->00:27:03.655 configuration is push pull or push solenoid or pull solenoid it’s either going to result in 00:27:03.655-->00:27:07.392 that rod y'know kind of like slammed outward or pulled back in. So you can use that to 00:27:07.392-->00:27:12.598 create a pushing motion, which you can use to manipulate those buttons we saw there. So our 00:27:12.598-->00:27:16.935 completed rogue device um is going to look like that. We have a rogue device that’s set up as 00:27:16.935-->00:27:22.040 we saw before. Wh we’re also going to have these physical A/B splitters uh um on either side, 00:27:22.040-->00:27:26.211 our upstream splitter and our downstream splitter. And we’re also going to have this wired 00:27:26.211-->00:27:32.618 link uh between the two of them. And also we’ll have a passive tap uh that is going between 00:27:32.618-->00:27:36.788 these two splitters when it- when it’s in bypass mode that will let us to- allow us to um 00:27:36.788-->00:27:40.792 inspect traffic . Have you ever used the Michael Ossman’s uh throwing star LAN tap? You build 00:27:40.792-->00:27:43.428 something that’s basically similar to that and then you inspect traffic when you’re in 00:27:43.428-->00:27:48.934 bypass mode. Um so when the switches are- are in Mode A, traffic is going completely 00:27:48.934-->00:27:52.304 bypassing the rogue device and going directly between the authenticator and the 00:27:52.304-->00:27:57.709 supplicant. Uh when you use the solenoids to flip the switches into Mode B, now traffic is 00:27:57.709-->00:28:03.615 diverted into the rogue device. So to actually implement the attack uh we- we flip the 00:28:03.615-->00:28:08.787 switches y'know after we plant the device we remotely flip the switches to Mode B and we shut 00:28:08.787-->00:28:14.726 down the upstream interface which essentially blocks and traffic being sent to or from 00:28:14.726-->00:28:20.632 the authenticator. And then we set up our rogue authentication server to listen on our PHY 00:28:20.632-->00:28:25.637 interface and essentially what this does is force the supplicant to authenticate with 00:28:25.637-->00:28:29.575 us. And you’ll have to inject a EAPOL Start frame um to yourself to get this to work and we’ll 00:28:29.575-->00:28:34.146 talk about why that is later but um this actually will actually force the device to authenticate 00:28:34.146-->00:28:39.051 with you. And then once you are able to capture those- those uh those hashes provided they are 00:28:39.051-->00:28:44.790 using a weak EAP method you can crack them and then you bring down on your PHY interface, 00:28:44.790-->00:28:51.530 bring up your upstream interface and authenticate directly with the network. And you just kind 00:28:51.530-->00:28:56.535 of lazily avoided having to deal with 802 dot 1x entirely. So here’s our uh our updated demo. 00:28:59.805-->00:29:04.676 There’s going to be some lag because I don’t really know how to fast forward through it. Okay 00:29:04.676-->00:29:10.048 so in the bottom right, yeah, so those are the solenoids actually flipping the A/B switch. Um I 00:29:10.048-->00:29:12.484 made them really big so you could see them although obviously you’d want to use a 00:29:12.484-->00:29:16.922 smaller implementation. Um actually the first time I got this to work freaked the h*ll 00:29:16.922-->00:29:20.492 out of my wife because she was like “What is that? Did you just electrocute yourself?” And um, 00:29:22.628-->00:29:28.133 which I was actually pretty concerned about myself because I don’t really do this very often. 00:29:28.133-->00:29:33.138 Um but yeah so essentially we just set it up- Is this paused? Yes it is. Okay so yeah and we 00:29:39.277-->00:29:44.282 divert it uh the traffic to us. It’s playing again. I don’t know how to control this device. I’m 00:29:50.055-->00:29:55.060 sorry. But what you will see soon is that basically yeah so we’ve- we’ve cut off 00:29:57.095-->00:30:00.899 connectivity from there and we have our hashes that we’ve captured. And from there we go 00:30:00.899-->00:30:05.904 ahead and crack them. So [audience applause] Thanks! I honestly don’t know why you’re 00:30:10.442-->00:30:15.614 clapping. That is like the laziest attack that like- but whatever they wanted me to come 00:30:15.614-->00:30:22.020 talk about it so. So let’s take a quick detour really fast now that we’ve gone over that. Kind 00:30:22.020-->00:30:25.557 of some other stuff that I looked into while working on this project was um kind of the 00:30:25.557-->00:30:28.760 current state of MAC filtering and MAC authentication bypass because it’s something that’s 00:30:28.760-->00:30:35.734 been affecting me directly a lot lately. Um so fun fact, not all devices support 802 dot 1x. 00:30:35.734-->00:30:40.906 Who’d have thought right? Um but not all devices support 802 dot 1x but enterprise organizations 00:30:40.906-->00:30:47.312 uh y'know that- that need to use these device still need to be able to deploy them anyway so 00:30:47.312-->00:30:51.950 y'know when this happens y'know when you’re an enterprise organization that uses 802 dot 00:30:51.950-->00:30:55.587 1x but you have to deploy a device that doesn’t support it, um traditionally what you’ve- 00:30:55.587-->00:30:59.458 you’ve had to do is create what’s known as a port security exception. And a port security 00:30:59.458-->00:31:04.429 exception essentially you just disable 802 dot 1x on the port being used by that device. Um 00:31:04.429-->00:31:09.167 when you do this usually you replace 802 dot 1x with MAC filtering or some other weak 00:31:09.167-->00:31:13.405 form of access control. Not always, but usually. Um and historically this has been 00:31:13.405-->00:31:18.243 pretty prevalent due to the widespread lack of support for 802 dot 1x by peripheral devices 00:31:18.243-->00:31:22.614 such as printers, IP cameras, all those essentials that y'know just don’t have the- the 00:31:22.614-->00:31:27.385 sophistication of- of like a full workstation or something like that. So port security 00:31:27.385-->00:31:30.489 exception- exceptions have traditionally been very low hanging fruit for attackers. 00:31:30.489-->00:31:35.393 It’s much easier to find a port security exception than to try and bypass 802 dot 1x two 00:31:35.393-->00:31:40.398 thousand whatever um using a bridge or a hub. Um the problem is and I kind of had to go try 00:31:43.702-->00:31:48.707 and verify this myself just by looking at things because anybody do like- any red teamers 00:31:51.076-->00:31:55.247 here that do like physical security assessments. Yeah. Haven’t you got the impression 00:31:55.247-->00:32:00.185 that these are becoming much less and less prevalent? Like it’s just slowly kind of yeah. 00:32:02.621-->00:32:06.691 Well I mean when you think about it a bit it actually makes sense. Um if you- y'know 00:32:06.691-->00:32:12.197 basically support for 802 dot 1x peripheral um support by 802 dot 1x peripheral device 00:32:12.197-->00:32:17.068 manufacturers um it actually has increased dramatically in recent years. Um if you- I mean a good 00:32:17.068-->00:32:21.239 example of this is if you- if you go on NewEgg or whatever and just look up multi function 00:32:21.239-->00:32:25.143 printers and- and try to find ones that support 802 dot 1x. Pretty much every major 00:32:25.143-->00:32:30.515 manufacturer of a multi function printer um has at least one model that’s affordable by an 00:32:30.515-->00:32:34.719 enterprise um by an enterprise budget. Um and but I don’t mean like a 5000 dollar printer I 00:32:34.719-->00:32:41.293 mean like y'know couple hundred dollars that supports 802 dot 1x. So y'know the result of this 00:32:41.293-->00:32:45.730 is that y'know as legacy hardware is phased out it either breaks or just gets cycled out 00:32:45.730-->00:32:50.735 um y'know on a however y'know whatever basis. Um it’s y'know it gets replaced by 802 dot 1x 00:32:53.238-->00:32:56.842 capable models. So what this means is port security exceptions are becoming much- 00:32:56.842-->00:33:01.680 much less prevalent than they used to be. Although they’re still there, they’re not quite 00:33:01.680-->00:33:07.319 the low hanging fruit that they- that they once were. Um which- which seems- seems like a good 00:33:07.319-->00:33:12.290 thing except for the fact that y'know we have to remember that improved option of 802 dot 1x 00:33:12.290-->00:33:15.026 does not necessarily imply strong uh port security for peripheral devices, uh for the 00:33:15.026-->00:33:20.198 following reasons. Uh to begin with y'know 802 dot 1x 2010 support is really only just 00:33:20.198-->00:33:23.935 starting to become a reality for really really expensive enterprise networking hardware 00:33:23.935-->00:33:29.608 let alone peripheral devices. Um y'know additionally we y'know we mentioned 802 dot 1x 2004 can by 00:33:29.608-->00:33:32.978 bypassed using bridges, injections, et cetera. Um and y'know releasing a tool that 00:33:32.978-->00:33:37.115 makes it really easy to do that as well so that’s going to become a little easier to do. 00:33:37.115-->00:33:42.120 Um, with that said y'know adoption for secure EAP can expected to be lower on these 00:33:44.723-->00:33:49.261 peripheral devices than on domain joined devices. So it kind of y'know begs the question 00:33:49.261-->00:33:54.966 y'know can we use- can we just attack EAP as a means to kind of compensate for the diminishing 00:33:54.966-->00:33:58.837 returns we’re getting from port security exceptions? And- and doing this actually makes sense 00:33:58.837-->00:34:02.240 when you consider that the adoption of secure EAP methods is already low across the board 00:34:02.240-->00:34:07.579 let alone um peripheral devices which often can’t be configured uh from a central- uh centrally 00:34:07.579-->00:34:12.784 in the same way that a domain joined workstation can be. So I guess you’re first option for 00:34:12.784-->00:34:16.054 doing this if they’re using- if the rogue- peripheral device is using something like EAP PEAP or 00:34:16.054-->00:34:20.325 EAP TTLS you could use a similar rogue gateway attack like what we talked about before. You 00:34:20.325-->00:34:23.328 don’t actually need the mechanical splitters to do this this time though you just set up 00:34:23.328-->00:34:27.999 your transparent bridge like- like we talked about and y'know then just disable your upstream 00:34:27.999-->00:34:33.605 interface, disable your bridge and y'know launch um launch your rogue authentication server on 00:34:33.605-->00:34:38.243 your PHY interface. Right? ANd then from there you’re able to y'know capture hashes crack them 00:34:38.243-->00:34:42.213 and authenticate directly with the network. And interestingly enough though honestly like one 00:34:42.213-->00:34:47.619 of the most widely used EAP methods that you see using um peripheral devices uh such as 00:34:47.619-->00:34:52.958 multi function printers is EAP MD5 which is really really old and kind of crappy but y'know 00:34:52.958-->00:34:56.995 when you- when you think about it, it’s also really easy to set up and configure and it’s still 00:34:56.995-->00:35:00.365 better than MAC filtering right so y'know you- you- you can honestly if you are deploying 00:35:00.365-->00:35:04.069 EAP MD5 and protecting all your printers with it you could say yes, all of our devices support 00:35:04.069-->00:35:09.074 802 dot 1x. We’re not going to tell you how we implemented that but they support 802 dot 1x. Um 00:35:11.276-->00:35:17.148 so the way EAP MD5 works um y'know once again it’s a really old- it’s a really old EAP 00:35:17.148-->00:35:21.853 implementation. Uh it- the first stage of the EAP MD5 authentication process is that 00:35:21.853-->00:35:27.392 the authentication server is going to send an EAP Request Identity frame to the supplicant 00:35:27.392-->00:35:31.663 and the supplicant is going to respond with an EAP Response Identity frame which is- which 00:35:31.663-->00:35:34.933 is providing a username. The authentication server is then going to create a randomly 00:35:34.933-->00:35:41.172 generated string of characters- awesome. We’re good. Um, it’s going to create a randomly uh 00:35:41.172-->00:35:45.076 generated string of characters in the form of an EAP Challenge and it’s going to send that off 00:35:45.076-->00:35:49.314 to the supplicant as as EAP Challenge Request. Uh the supplicant is then going to take 00:35:49.314-->00:35:53.218 that randomly generated string of characters, can catenate it with it’s username catenate that 00:35:53.218-->00:35:57.255 with it’s password and then dump that through the MD5 hash function. And what comes out of 00:35:57.255-->00:36:00.859 the MD5 hash function is the EAP Challenge Response which is sent back to the EAP- to the 00:36:00.859-->00:36:04.763 authentication server. The authentication server is then going to do the exact same 00:36:04.763-->00:36:08.166 hashing operation that the supplicant did, generate its own response, and compare it to the 00:36:08.166-->00:36:11.803 one it received from the supplicant. If they match, then authentication succeeds. If they 00:36:11.803-->00:36:18.576 fail they- or if they don’t match then authentication fails. So um kind of the- the thing to 00:36:18.576-->00:36:22.180 remember about this authentication process is that the entire process is- is 00:36:22.180-->00:36:27.552 occuring over plain text. Which- which um y'know if- if you think about y'know we don’t have the 00:36:27.552-->00:36:33.258 benefit of that tunnel that EAP PEAP or EAP TTLS and what that means is an attacker uh can 00:36:33.258-->00:36:36.861 basically sniff this process passively uh capture the username capture the EAP 00:36:36.861-->00:36:42.100 Challenge uh EAP MD5 Challenge Request and the EAP MD5 Challenge Response and then 00:36:42.100-->00:36:47.405 basically perform a dictionary attack to obtain the password. Um and actually a couple of 00:36:47.405-->00:36:53.211 researchers from China in 2012 they were able to uh recover uh EAP MD5 credentials even faster 00:36:53.211-->00:36:57.515 using a length recovery attack. So y'know this essentially has really really broken protocol. 00:36:57.515-->00:37:01.886 So with this in mind and leveraging what we know not only about how to attack EAP MD5 but 00:37:01.886-->00:37:07.525 how to talk- how to attack 802 dot 1x 2004 as well um it- y'know it follows that we can 00:37:07.525-->00:37:12.564 start out using a bridge based approach, a bridge based bypass to place a rogue device between 00:37:12.564-->00:37:16.668 the supplicant and the authenticator. We then- we then start sniffing traffic um being 00:37:16.668-->00:37:20.371 send back and forth between these devices. y'know we then wait for the supplicant to 00:37:20.371-->00:37:25.443 authenticate, sniff the EAP MD5 Challenge Response sniff the EAP MD5 response when it does uh 00:37:25.443-->00:37:29.748 crack the credentials and then just authenticate directly with the network. Uh there is one 00:37:29.748-->00:37:32.617 major drawback to this approach and that’s that we have to wait for the supplicant to 00:37:32.617-->00:37:36.421 re-authenticate with the switch. Uh which actually that’s not going to happen unless we 00:37:36.421-->00:37:41.759 disable a virtual network interface or I’m sorry- um- disabling a virtual network 00:37:41.759-->00:37:45.296 interface isn’t enough to make that happen and it’s real- realistically not going to 00:37:45.296-->00:37:50.368 happen unless we unplug the- the supplicant from-from from the switch itself. Um we could use 00:37:50.368-->00:37:54.172 the mechanical splitters that we talks about with 802 dot 1x 2010 uh but honestly the less 00:37:54.172-->00:38:00.411 overhead the better and right now we’re going for simpler. Um so basically um another this 00:38:00.411-->00:38:05.116 that. The- the third contribution that we have here is the EAP um MD5 forced 00:38:05.116-->00:38:11.055 reauthentication attack against 802 dot 1x 2004. Um we mentioned that the first two steps of the 00:38:11.055-->00:38:16.528 initialization process right? Uh which- which realistically are the first two steps of the 00:38:16.528-->00:38:20.331 reauthentication process. That’s pretty much the whole thing combined. Are that the 00:38:20.331-->00:38:23.134 supplicant’s going to send the authenticator an EAPOL start frame and that’s going to signal 00:38:23.134-->00:38:26.104 to the authenticator that it should send the supplicant an EAP Request Identity frame 00:38:26.104-->00:38:30.275 because we’re beginning the authentication process. We also mentioned that this first step- 00:38:30.275-->00:38:33.478 the EAPOL Start frame- is optional. The reason why the first step is optional is that 00:38:33.478-->00:38:37.649 the authenticator needs a- a means of- of forcing the supplicant to reauthenticate 00:38:37.649-->00:38:40.685 y'know in the event of a problem- in the event it needs to reconfigure something, et 00:38:40.685-->00:38:46.391 cetera. So that’s left as an optional- as an optional step. The problem with this is that 00:38:46.391-->00:38:49.894 the supplicant has no way of verifying if an incoming EAP Request Identity frame has been 00:38:49.894-->00:38:56.301 sent in response to an EAPOL Start. Um y'know essentially like we can force 00:38:56.301-->00:38:59.704 reauthentication by sending an EAPOL Start frame to the authenticator as if it came from 00:38:59.704-->00:39:03.208 the supplicant using MAC- MAC spoofing. And this- the result will be that the authenticator 00:39:03.208-->00:39:06.744 is going to send an EAP request identity frame to the actual supplicant and kick start the 00:39:06.744-->00:39:10.215 reauthentication process. Um when this happens both the authenticator and the supplicant 00:39:10.215-->00:39:15.119 are going to believe that the other party has initiated the reauthentication attempt. And as 00:39:15.119-->00:39:20.124 you can see here in this little video here we can just inject repeatedly inject EAPOL Start 00:39:23.061-->00:39:27.699 frames using a Scapy in the bottom left. That forces reauthentication and it’s very 00:39:27.699-->00:39:32.704 easy to do and very fast. So if we take this information add it to- to our first attack- our 00:39:35.273-->00:39:40.345 passive attack against EAP MD5- we come out with um y'know I guess what we call the EAP MD5 00:39:40.345-->00:39:43.514 forced reauthentication attack. Which we start out by introducing this rogue device 00:39:43.514-->00:39:47.518 the network uh directly between the authenticator and the supplicant set up our bridge as 00:39:47.518-->00:39:50.688 before start passively sniffing traffic. We then force reauthentication by sending a 00:39:50.688-->00:39:54.192 spoofed EAPOL Start frame to the authenticator and then from there that allows up to 00:39:54.192-->00:39:59.764 immediately capture um the EAP MD5 Challenge Response and the EAP MD5 Challenge, crack those, 00:39:59.764-->00:40:06.337 and then we can authenticate with the network that way. And this is pretty fast. You just 00:40:06.337-->00:40:11.342 run this- yeah it’s we’ve literally just by running the thing now we have the request 00:40:14.145-->00:40:20.118 ID, the challenge, the response, and also the identity. And that’s it. Um I guess like the 00:40:20.118-->00:40:25.290 first proposed mitigation to this uh that comes to mind- although honestly this is 00:40:25.290-->00:40:29.894 probably not bulletproof either- um is to put a safety bit in the EAP Request Identity frame. You 00:40:29.894-->00:40:33.498 could set it to one if the frame was sent in response to the EAPOL Start frame and check it 00:40:33.498-->00:40:38.036 when the supplicant receives an EAP Request Identity frame. And y'know essentially if the safety 00:40:38.036-->00:40:41.906 bit is set to one and the supplicant did not recently issue an EAPOL Start frame uh 00:40:41.906-->00:40:47.645 you abort the authentication process. So just to wrap this up. Um just to summarize our 00:40:47.645-->00:40:52.450 contributions. Uh what we kind of went over today. Uh we’ve introduced the rogue gateway um 00:40:52.450-->00:40:57.255 and bait and switch which when used in conjunction with one another can be used to bypass 00:40:57.255-->00:41:00.892 802 dot 1x 2010 by attacking it’s authentication mechanism. Um we’ve also introduced an 00:41:00.892-->00:41:05.129 updated and improved- we’ve also updated and improved existing 802 dot 1x 2004 bypass 00:41:05.129-->00:41:11.169 techniques emphasis- uh emphasizing on the uh on the techniques introduced by- by uh 00:41:11.169-->00:41:17.542 Alva Duckwall uh back in 2011. And we’ve also introduced the EAP MD5 forced reauthentication 00:41:17.542-->00:41:22.780 attack which improved attacks against EAP MD5 on wired networks. Uh some key take aways 00:41:22.780-->00:41:27.518 uh before we wrap this up. Uh port security is still a very very positive thing. Please keep 00:41:27.518-->00:41:31.356 using it. Um but it’s not a substitute for a layered approach to network security. It 00:41:31.356-->00:41:35.727 y'know deploying- deploying port security does not absolve you from- from- from very basis 00:41:35.727-->00:41:40.998 responsibilities like patch management uh kind of keeping tabs of yeah it- it- it’s part 00:41:40.998-->00:41:47.839 of- it needs to be part of a larger system that is designed to keep your network secure. And 00:41:47.839-->00:41:52.310 additionally the benefits provided by 802 dot- 802 dot 1x uh can be undermined due to the 00:41:52.310-->00:41:58.249 continued use of EAP as an authentication mechanism. Um and finally improved 802 dot- 802 00:41:58.249-->00:42:01.486 dot 1x support by peripheral devices uh or should I saw peripheral device manufacturers 00:42:01.486-->00:42:06.691 is largely undermined by lack of support for 802 dot 1x 2010 and low adoptions and support rates 00:42:06.691-->00:42:11.662 for strong EAP methods. Uh if you want to look over this information in more detail uh 00:42:11.662-->00:42:15.166 there’s going to be a blog post. I tried putting in the entire URL of the blog post but like it 00:42:15.166-->00:42:19.804 just kind of took up the entire slide so it’s just the first results on uh Digital Silence 00:42:19.804-->00:42:26.144 dot com slash blog. Um and finally uh we have the uh if you actually want to try performing 00:42:26.144-->00:42:30.314 these uh the tool and the associated documentation is available on GitHub dot com 00:42:30.314-->00:42:35.319 slash Solstice slash Silent Bridge. Thank you very much. [applause]