[00:00.000 --> 00:10.140] Hi everyone. The sound is okay? Yes? Everybody listens? Okay. My name is Andres. And this is a [00:10.140 --> 00:17.360] brief introduction of myself. It's not really interesting so I will skip it. But the [00:17.360 --> 00:22.140] important thing is here we are to talk about Wi-Fi fingerprinting. Okay? We want to [00:22.140 --> 00:27.940] fingerprint devices. So this is the first part of a pen test or to seek for a target. So I [00:27.940 --> 00:32.740] think it's really important. And it's also important as we are defending our network to [00:32.740 --> 00:37.780] understand what we are exposing to the air. Because we used to think that networks or [00:37.780 --> 00:43.020] Wi-Fi networks was an access point and some devices connecting to it. But nowadays the [00:43.020 --> 00:48.420] protocol has changed. And it's quite difficult to know the boundaries of a network. And [00:48.420 --> 00:53.500] also it's an interesting way of how to bypass micro-randomization. That is something [00:53.500 --> 01:00.520] vendors are implementing to protect a user from being tracked. But in some cases this is [01:00.520 --> 01:08.300] not working as expected. So I will show some of, some example of this. So also an important [01:08.300 --> 01:13.380] thing I want to focus in is explaining that if we are connected to an open network and our [01:13.380 --> 01:20.020] traffic is not encrypted, it's quite easy to fingerprint a device because we can see [01:20.020 --> 01:27.760] DNS traffic, we can see HTTP traffic and we can see a lot of traffic that is not encrypted. [01:27.760 --> 01:32.520] So it's quite easy to identify and fingerprint a device. Like if you grab the user agent [01:32.520 --> 01:39.220] from HTTP traffic, you can get the OS and other stuff on a computer. So it's quite easy. [01:39.220 --> 01:43.760] But if you are connected to a secure network, you are almost not leaking any traffic. Or [01:43.760 --> 01:48.000] let's say you have a device that is connected to, is not connected to a network. How can I [01:48.000 --> 01:53.060] fingerprint a device that is not connected? So we are going to focus on management frames [01:53.060 --> 02:01.780] only and in some of those management subtypes in specific. So I'm going to talk about some [02:01.780 --> 02:08.200] specific protocols or extensions on WiFi. The first one is WPS, that is called WiFi [02:08.200 --> 02:13.340] protected setup. It has some vulnerabilities in the past, but here we are going to focus [02:13.340 --> 02:19.560] only on fingerprinting devices. So I don't know if this is the best screenshot I can get [02:19.560 --> 02:26.180] because it's not really clear. But this is an access point and as we can see here, the access [02:26.180 --> 02:33.100] point is leaking the model, the version, the vendor. It's giving a lot of information in the [02:33.100 --> 02:40.080] response frame. So this is leaked every time an access point is queried with a request frame, [02:40.080 --> 02:44.780] it will reply with this and you will get a lot of information on the target and maybe if you get [02:44.780 --> 02:51.560] the model or a specific version, you can know that it's vulnerable and then you can target it [02:52.060 --> 02:58.720] for an exploit or something else. I'm going to go really quick because it's only 20 minutes [02:59.220 --> 03:05.980] and then if there's questions, please ask me after the talk so I can answer everything you [03:05.980 --> 03:12.640] want and I can do also a live demo afterwards also. This is CCX that if you have worked with [03:12.640 --> 03:21.680] Cisco Ironet, this is an extension that was used by default on most Cisco Ironet networks. And [03:21.680 --> 03:30.340] this is a portion of a text in the manual and it's really, it's really, it's really great for us [03:30.340 --> 03:35.960] because it says that Cisco Ironet, it sends an information element on the beacon frame that [03:35.980 --> 03:42.000] as we all know, the beacon frame is sent every single time in the air and the information [03:42.000 --> 03:49.280] element that is a portion of the beacon frame, the tag that is with the number 85 in hex, [03:49.280 --> 03:56.840] contains the access point name that is internal for the network administration, the load of the [03:56.840 --> 04:02.700] access point, the number of associating clients and so on. I'm not sure what so on is but [04:02.700 --> 04:08.160] apparently it's also giving more information. And then it also says that if someone is like [04:08.160 --> 04:14.040] doing roaming, moving from one access point to another in the same network and it sends an [04:14.040 --> 04:21.500] association request with this tag, the access point is going to reply you with an association [04:21.500 --> 04:32.660] response frame with the tag 89 and 85 and 95 and this can contain the controller IP address. [04:32.660 --> 04:38.120] So now your access point is given to anyone that is looking around the IP address of the [04:38.120 --> 04:45.720] controller inside the network. So again, sorry about the, I don't know, someone could read [04:45.720 --> 04:54.760] that or, no, sorry, I could show it afterwards. In this case, this is a beacon frame and we see [04:54.760 --> 05:00.060] the information element and we see the name and the number of clients that is, that access [05:00.060 --> 05:06.040] point in particular has connected to him. Again, the name of the access point I think is [05:06.040 --> 05:10.920] really useful because when you're going around and doing world driving, sometimes the [05:10.920 --> 05:19.480] administrators of the network, they find the access point name such as IT access point or [05:19.480 --> 05:24.240] second floor access point and you can get like an idea where the access point is in fact [05:24.240 --> 05:30.040] without GPS also. So it's a really good information to make context of what you're [05:30.040 --> 05:38.020] dealing with. Then Wi-Fi direct, that is another extension. It was designed by Wi-Fi [05:38.020 --> 05:43.320] alliance and it's designed so we can connect directly without needing to have an access [05:43.320 --> 05:47.680] point. So if someone wants to share with my phone something, I can connect phone to phone [05:47.680 --> 05:55.840] without having an access point. This one also gives a lot of information. In this case, most [05:56.360 --> 06:02.460] devices supporting this are Android mobile devices, TVs, printers. There are a lot of [06:02.460 --> 06:08.540] devices that support this. Windows, Windows desktop machines support it. So you get a lot [06:08.540 --> 06:14.140] of information. In this case, we can get the name and the model of a TV that has this [06:14.640 --> 06:20.900] support for this, for this protocol. The important thing here to understand is that Wi-Fi [06:20.900 --> 06:27.660] direct needs an active scan. It doesn't work if you're doing passive recognition. So it [06:27.660 --> 06:31.860] needs you to send some frames to get this information. But again, this information can be [06:31.860 --> 06:45.260] get by anyone. Then we have HP. HP has decided to, besides supporting Wi-Fi direct on most [06:45.260 --> 06:51.720] printers, scanners and office devices that they design, they also added like a custom [06:51.720 --> 06:57.340] information element that they are sending through the air that has like the serial number of [06:57.340 --> 07:04.040] the printer, the IP address that the printer has where it's connected to. Again, Wi-Fi [07:04.040 --> 07:09.440] direct needs, it's a protocol that can be used to connect directly to the printer. But if [07:09.440 --> 07:13.740] your printer is connected to a wireless network and you connect with Wi-Fi direct to the [07:13.740 --> 07:19.580] printer, it could be used as a bridge, okay, to connect to the network it's connected to. And [07:19.580 --> 07:24.280] let's say you're not using Wi-Fi with a printer because you say that it's insecure and you [07:24.280 --> 07:31.000] only use an Ethernet cable. But you don't disable the Wi-Fi direct that again is by default [07:31.000 --> 07:39.340] on the printer, your printer can be a bridge to your wireless network. So again, wireless is [07:39.340 --> 07:43.640] not only about access points, you can have devices that support wireless that could be [07:43.640 --> 07:51.360] act, could be acting as an access point or as a bridge to a network. This information [07:51.360 --> 07:57.940] element is not processed by Wireshark, but I released a tool that you can get all the [07:57.940 --> 08:03.800] information from this information element and I explain how you can reverse it or parse it. [08:04.520 --> 08:10.640] Then we have this one that lately has a lot of people looking into it. It's the Apple wireless [08:10.640 --> 08:17.820] direct link. It's used by AirPlay and AirDrop. So if you have an Apple device and you have Wi-Fi [08:17.820 --> 08:23.800] and Bluetooth on, your device is going to be sending a lot of information into the air, so [08:23.800 --> 08:31.540] if you have a friend nearby and you can share some information. This one has something [08:31.540 --> 08:38.840] really interesting because this hasn't been fixed in a lot of time. I have been speaking [08:38.840 --> 08:44.420] about this, I think a couple of years. And it's like Apple is always saying that it's [08:44.420 --> 08:49.900] protecting the users and they are trying to do macro randomization for example, so you [08:49.900 --> 08:56.300] cannot be tracked in a conference or any place you are. But there you, I don't know if it [08:56.300 --> 09:00.900] can be read because it's a little small, but it says the transmitting address or the [09:00.900 --> 09:06.220] source address is the random MAC, so you cannot be tracked. But in this action frame that [09:06.220 --> 09:12.700] is not encrypted and it's sent for anyone to read, inside the frame it says device ID and [09:12.700 --> 09:19.600] there is the real MAC. So you create macro randomization, you add this feature and you [09:19.600 --> 09:26.560] broke it. Like it doesn't work. And it's not, in this case in particular it's for AirPlay and [09:26.560 --> 09:35.020] it's affecting Apple TVs. But as you can see here, this is an iPhone and iPhone is doing, [09:35.020 --> 09:42.600] with AirDrop it's doing almost the same. So it's sending your device name into the air. So if [09:42.600 --> 09:48.360] you have a particular, it's like your name, like Andres iPhone, it's gonna say Andres iPhone [09:48.360 --> 09:53.620] with all the random MACs so I can continue looking into it and I continue tracking you. And [09:53.620 --> 09:58.820] we know your random MACs that you have leaked into the air. So again, macro randomization [09:58.820 --> 10:08.220] with Apple AirDrop or AirPlay is not working as expected. So let me see how I'm doing with [10:08.220 --> 10:27.810] the time. Okay, I'm good. As far as here, any question? Any brief question I could know? The [10:27.810 --> 10:35.910] Wi-Fi Direct, Wi-Fi Direct is active. These are passive but if you want to force it, maybe you [10:35.910 --> 10:48.310] need to do something active. The Apple protocol requires to send some Bluetooth, BLE, beacons [10:48.310 --> 10:53.610] to be activated. So if you have another device nearby, it's gonna be activated. But if you [10:53.610 --> 11:01.590] don't have a device, you need to force it. But the CCX is passive. You can do something [11:01.590 --> 11:08.730] active but I can tell you afterwards, it's sort of a vulnerability more or less. I will explain [11:08.730 --> 11:16.110] it later. So how you can find this stuff and understand what is going on and look into this [11:18.310 --> 11:24.570] custom protocols. So there's a lot of them. So this is only some of them that I look but I'm [11:24.570 --> 11:30.810] looking to more of them and there's a lot, a lot. Vendors are like extending the protocol and [11:30.810 --> 11:35.770] leaking a lot of information into there. On management frames, they are not encrypted and they [11:35.770 --> 11:42.530] cannot be encrypted because it's the way the protocol works. So there's no fix for this. So we [11:42.530 --> 11:48.670] have three different places where we can look for these protocols. We can look in firmware, for [11:48.670 --> 11:55.390] example printers, embedded devices that they support WiFi. We can see on the kernel, I'm gonna [11:55.390 --> 12:03.990] show two examples of kernels. But usually Linux kernel, a kernel module or a kernel extension on [12:03.990 --> 12:11.150] macos. Also on Windows. I haven't looked into Windows once but I think that they are not so [12:11.150 --> 12:16.190] difficult either. And then you have user applications that I will show one, the HP case [12:16.190 --> 12:28.170] that is the more interesting. Sorry. So this is quite difficult to read again but this case, I'm [12:28.170 --> 12:37.550] looking into the IO80211 family kernel extension. That again, this is a module that displays, [12:37.550 --> 12:41.130] it's, you can be finding on IOS devices or macos. And this is a module that displays, it's, you [12:41.130 --> 12:45.290] can be finding on IOS devices or macos. And it's almost the same on the IOS and on the macos. So [12:45.290 --> 12:50.710] if you want to reverse it, you need a mac and you don't need an iPhone. Let's say you, you are [12:50.710 --> 12:57.330] looking into, into IOS and you want to look into an iPhone but you don't, you don't have a, a [12:57.330 --> 13:02.190] jailbroken device. So you can look into the macos that the kernel extension is there, you can [13:02.190 --> 13:06.630] grab it with root privileges and then you can reverse it and it's almost the same. So if I [13:06.630 --> 13:12.850] wanted to, want to look into this, it's easier to look at macos than iPhone. Unless you have a [13:12.850 --> 13:23.590] jailbroken device. But this is a function on a particular class that is called 802.11 AWDL peer [13:23.590 --> 13:28.970] manager that is doing all the direct link stuff. And all the functions, they are dealing with [13:28.970 --> 13:34.830] the parsing and other stuff. There have been some vulnerabilities also reported here. You can [13:34.830 --> 13:40.570] look in the web, there, there's some stuff there. I think there are more vulnerabilities. I [13:40.570 --> 13:48.910] have some ideas, maybe I, I want to share it in the future. Then this is a host APD, as some of [13:48.910 --> 13:54.950] you could maybe know, the host APD is a user run application that does a lot of parsing on [13:54.950 --> 14:03.930] the, on the 802.11 protocol on WiFi. Mostly on routers, Android, Linux devices. And again, [14:03.930 --> 14:10.250] because we have a specific license on, on the host APD, a lot of vendors extend the protocol, [14:10.250 --> 14:16.910] modifying the host APD and other specific features. It doesn't, it's really, really, really [14:16.910 --> 14:23.690] tiny here. But here it says air ties. Air ties, it looks like a vendor that is giving some [14:23.690 --> 14:31.450] information into the air. I recently started reversing this driver, so I don't have more [14:31.450 --> 14:36.290] information, but this is just to show you that there's a lot of information we can process, [14:36.290 --> 14:44.950] just reversing some drivers or firmware. And this last one is the, let me check my time, [14:44.950 --> 14:53.090] okay. And this last one is the, eh, HP one, that is the, eh, it's, it's, it's weird because I [14:53.090 --> 14:59.890] never find something on, on Java, like to, to on WiFi, like with Java. But in this case, [14:59.890 --> 15:05.890] this, this application for HP only works on Android devices. So if you have an Android device [15:05.890 --> 15:10.190] and you have the HP application to connect to a printer and, and print directly from your [15:10.190 --> 15:16.130] phone, you have this application that will ask Android, the, the OS, the Android OS to give [15:16.130 --> 15:23.030] the, all the beacon and the response frames and the WiFi direct frames that they are [15:23.030 --> 15:29.250] print response but with little modifications. And then it's gonna pass the here on the Java [15:29.250 --> 15:34.570] application. So if you find something wrong in the Java application, I don't say it has [15:34.570 --> 15:38.550] something wrong, but if you find something wrong, you can maybe attack the application [15:38.550 --> 15:44.330] directly with WiFi frames, you are attacking directly the application. In this case I, I, I [15:44.330 --> 15:51.030] decompiled some code and I was able to reverse the protocol, eh, HP printers were, were like [15:51.030 --> 15:56.210] Customizing. They give a lot of information. It's amazing they send this in a [15:56.210 --> 16:03.870] management frame. So, future work. There's a lot of things anyone can grab and look [16:03.870 --> 16:08.690] into it. There's a protocol that, there's WPS has something called vendor and [16:08.690 --> 16:15.230] application extensions that I, when I was driving, I found a lot of devices that [16:15.230 --> 16:21.010] they are leaking information. There's also the Wi-Fi direct service discovery. [16:21.030 --> 16:24.690] That again is something useful because you can ask the device what type of service [16:24.690 --> 16:28.750] they are providing. So again, you can fingerprint based on the service that they [16:28.750 --> 16:34.190] are providing. Remember that this is, everything is without authentication. Okay, [16:34.190 --> 16:37.990] the device is there and you talk through them, you talk to them, no authentication [16:37.990 --> 16:45.150] needed. Then you have Wi-Fi display. There is something about Aruba network that [16:45.150 --> 16:51.370] they are sending some custom frames. It looks like they are used to like manage the [16:51.370 --> 16:57.050] network. I haven't looked into that, but they are like pretty big frames. I'm not [16:57.050 --> 17:02.350] sure what they have. And again, there are many other information elements that you [17:02.350 --> 17:12.850] can look into it. So, I'm gonna show a brief demo of an application I wrote. This [17:12.850 --> 17:22.270] application is not a replacement for the other tools you usually use. It's not a [17:22.270 --> 17:28.070] replacement for Kismet, for Aircrack or for BetterCup. It's just a complement. You [17:28.070 --> 17:33.190] can use it. This application is gonna parse all the frames that it finds with extra [17:33.510 --> 17:37.830] information with the protocols and it will give you this information in a way you can [17:37.830 --> 17:44.210] later parse it and add it to a report or maybe a plan for when you are doing a Wi-Fi [17:44.210 --> 17:49.230] pen test or something like that. So, I will try to do a demo. It's not gonna be a live [17:49.230 --> 17:55.490] demo because before starting the talk, I check what devices they are here and they are [17:55.490 --> 18:02.910] not so many devices with these protocols. But I give a, I walk around the hotel before [18:02.910 --> 18:07.650] the talk and I have some captures that we can use as an example. But if you download [18:07.650 --> 18:11.910] the tool and you test it yourself, you will see that there's plenty of devices around us [18:11.910 --> 18:24.800] that they are using these protocols and you can get a lot of information from them. So [18:24.800 --> 18:30.520] this tool I wrote can receive a pick up file or it can read directly from the Wi-Fi [18:30.520 --> 18:36.040] carrying monitor mode. It has only one active mode, that is the Wi-Fi direct mode [18:36.040 --> 18:41.400] because again you have to send something to the device to get information. But all the [18:41.400 --> 18:53.640] other ones are in passive mode. So here I, I only put a couple of devices so we can see [18:53.640 --> 19:00.420] what, what type of information we can get. In this case, the, this printer that maybe you [19:00.420 --> 19:07.880] have seen stuff like this, like direct, HP, office, something. They are printers and as [19:07.880 --> 19:13.960] Wi-Fi direct requires WPS to work, it's gonna leak in two, in two different information [19:13.960 --> 19:19.340] elements. You're gonna get information on the Wi-Fi direct information element and in the [19:19.340 --> 19:23.820] Wi-Fi protected setup information element. So in this case we don't, we don't, we don't [19:23.820 --> 19:31.520] get so much information. It's like the serial number is zero, the version, this is not [19:31.520 --> 19:35.960] model name, it's zero, so we are not getting too much information. We only get a little [19:35.960 --> 19:42.780] bit of information from the SSID. But if we go here and we see here the, this is the [19:42.780 --> 19:50.400] module of the HP printer, vendor specific one. We can see that they are giving you like a [19:50.400 --> 19:56.960] USB, USB connected. So we now know that the printer has the USB connected. We also know [19:56.960 --> 20:02.940] the model, the product SKU, the, the serial number and this IP address here is the IP [20:02.940 --> 20:07.980] address of the, of the printer that is connected as a Wi-Fi station to an access point. So [20:07.980 --> 20:12.500] this printer is connected to a computer by, via USB and it's also an access station [20:12.500 --> 20:16.700] connected to an access point. So if you connect to the printer and you, let's say you [20:16.700 --> 20:20.680] have, you connect with Wi-Fi direct and you exploit the printer and you get access to the [20:20.680 --> 20:26.740] printer as let's say root, it's not root but something more or less, and you get access to [20:26.740 --> 20:31.800] this, you will be able to maybe pivot to the USB device that is connected to the printer [20:31.800 --> 20:36.380] and maybe attack that or you can get access to the local network. So maybe you have a [20:36.380 --> 20:44.860] really secure network, the WPAA3 with a really hard core, hard difficult password, maybe [20:44.860 --> 20:51.800] you're using any protection you want, but if your printer is gonna be the entry point, you [20:51.800 --> 20:56.080] are in, you, you have some trouble there. So again, all this information, they are sending [20:56.080 --> 21:02.620] it every single time to the AR, you, you can do it passively or actively. The HP printer [21:02.620 --> 21:07.520] is sending it like passively, it sends it in every beacon, they, they are sending this [21:07.520 --> 21:15.100] information. Then we have the CCS, the CCX here, Cisco Client Extension, and this is from a [21:15.100 --> 21:21.100] hotel nearby. And it says the access point name, it says how many clients are associated to [21:21.100 --> 21:26.460] this particular access point. Again, this information, public, you don't need even to [21:26.460 --> 21:34.720] interact with the access point, this is sent through the AR. Then we have, um, this one is [21:34.720 --> 21:43.060] an Apple TV. The Apple TV is giving a lot of information. Eh, here, the MAC address here is a [21:43.060 --> 21:56.440] random MAC address, and as we can see, this one. Here, it says device ID, and this one is the [21:56.440 --> 22:04.840] real MAC address. So, that's, that is not working as expected. Eh, and you also have the model, [22:04.840 --> 22:10.440] and here it says that it's an Apple TV, I think that this, this is 5th generation, not really [22:10.440 --> 22:15.360] sure, but you can get from this information, you can also know maybe the version they are [22:15.360 --> 22:26.420] running. Um, here you have an iPhone, eh, I don't know what country code is this, eh, and [22:26.440 --> 22:34.560] because it's also leaking the, the country code of the device, how it's set to, and, and here it [22:34.560 --> 22:39.720] has a MAC address. I'm not really sure what this MAC address is, but I'm gonna research into it. [22:39.740 --> 22:45.800] Maybe the iPhone is also, is leaking the, the, the real MAC address of the device, so if this [22:45.800 --> 22:55.620] is true, eh, iOS, eh, has MAC address randomization broken. Eh, on iOS 9, that it was, this was [22:55.620 --> 22:59.720] broken, because they were giving the, the real MAC address inside the frame, but then after [22:59.720 --> 23:07.280] iOS, I think 10, they fix it, and I think this is a new, so I think they, they, like, put the [23:07.280 --> 23:13.100] bug inside again. I'm, I'm not really sure, but I have to look into it. So this was a, a, it's [23:13.100 --> 23:17.940] not a live demo, but if you want a live demo, now after doc, I can show you, I have another [23:17.940 --> 23:26.500] computer, this one doesn't work really good with my Wi-Fi, eh, Wi-Fi card, but, this is it. [23:26.500 --> 24:05.180] So, any questions? No questions? One last thing I forget to say is, remember that every [24:05.180 --> 24:10.920] single custom protocol that is in there, is extending the tag surface of the device. If you [24:10.920 --> 24:16.780] have AirDrop, AirPlay or any other protocol, and there's a vulnerability for that protocol, you [24:16.780 --> 24:21.680] can get down. So it's not about only leaking information, it's also about extending the tag [24:21.680 --> 24:28.060] surface and being able to find new vulnerabilities on the parsing code, so it's, it's, it's [24:28.060 --> 24:34.580] getting chaotic, the, the protocol. So again, we should look into it more, more, more deeply.