[00:00.000 --> 00:10.360] So my name is Aapo. I do a lot of things with IoT, but especially for my work, security research, [00:10.360 --> 00:17.340] consulting, and mainly look at IoT and other kinds of devices. I work a lot on cryptography [00:17.340 --> 00:24.840] and network protocols. Outside of that, bug bounty. So if you run a hardware bug bounty program, [00:24.840 --> 00:29.760] you know where to find me. And I'm also a coach for a Finnish CTFT. [00:33.400 --> 00:43.440] But yeah, so here is some IoT and my trusty EPC and I want to kind of see how it works. [00:43.440 --> 00:49.080] I might want to hack it or I might want to check out something about it. [00:50.600 --> 00:57.300] This particular device connects to the internet with an ethernet port or Wi-Fi. [00:57.660 --> 01:02.320] So that should be quite straightforward. If we want to know where it's connecting to, [01:02.990 --> 01:12.200] and that's a big part of IoT, we can simply plug in an ethernet cable to the device and the other [01:12.200 --> 01:19.460] ends to our laptop. And then on our laptop in the ethernet interface, we will see any traffic [01:19.460 --> 01:27.480] it's trying to send. We can do the same with Wi-Fi. So if we have our access point, the device [01:27.480 --> 01:34.860] connected to it. And then again, we will see the traffic on the ethernet interface. [01:37.120 --> 01:44.640] But there are some kind of devices and especially industrial IoT that have a very specialized job [01:44.640 --> 01:51.700] and they have been made to be very cheap. So they have only one way to connect to the internet. [01:51.700 --> 01:58.960] And nowadays a big part of it is something else than ethernet or Wi-Fi. [01:59.540 --> 02:07.280] So today we will be talking about these kind of devices. So some kind of 4G connection on this one [02:08.180 --> 02:15.060] and how that works. There's a modem, you plug in a SIM card and it connects to 4G and it's connected [02:15.060 --> 02:24.900] to the internet. But the problem is how do we actually see the data? So this is kind of the [02:24.900 --> 02:32.140] topic of today. There are also different kind of devices. They might have multiple ways of connecting [02:32.140 --> 02:39.080] to the internet. So here we have a phone currently connected to my Wi-Fi access point and I can see [02:39.080 --> 02:47.060] everything it's sending to the internet. Or can I? So if you might not be able to see it, but there's [02:47.160 --> 02:54.000] a little 5G icon there so it's actually connected to 5G as well. So question is, is there traffic [02:54.000 --> 03:03.060] over 5G as well? So it might be something built in, there might be something malicious. So [03:05.260 --> 03:07.320] let's talk about that. [03:09.520 --> 03:15.860] So why would you want to look into mobile network traffic? If you're just a tinkerer, if you're at [03:15.860 --> 03:23.340] Defcon here or watching this video, then you might be curious. You might care about your privacy. [03:23.500 --> 03:31.660] You might think, where do my devices talk to? Is there some kind of unencrypted private [03:31.660 --> 03:37.600] information flying through the air? And if you are in traveling in some countries you might want to [03:37.600 --> 03:47.470] kind of know what exactly your devices are sending. From offensive security point of view, we [03:47.470 --> 03:52.690] might think that can we tamper with the traffic and find vulnerabilities? If you do penetration [03:52.690 --> 04:00.530] testing and you have these kind of devices, you need to hack them, you need to kind of do some [04:00.530 --> 04:08.810] kind of security audit or something like that. You might want to look at the traffic. Can you [04:08.810 --> 04:15.250] say we've kind of penetration tested this if you haven't looked at the mobile traffic? [04:17.820 --> 04:23.960] From defensive point of view, you might want to detect malicious traffic or just filter some [04:23.960 --> 04:30.560] unwanted things. You can do this in most cases on the device. So if you have a phone, you can [04:30.560 --> 04:37.040] install something and it will kind of filter things or endpoint detection or whatever. [04:37.040 --> 04:43.180] But if you have some advanced malware on your phone, it might not respect the on-device [04:43.180 --> 04:49.980] protections. So if it's running on very low inside the operating system, it can easily just [04:51.480 --> 04:59.840] not allow the endpoint protection to run. So we might not want to do the testing on the device, [04:59.840 --> 05:11.750] we want to do it outside. So what are these mobile networks? Sometimes called like cellular [05:11.750 --> 05:22.110] networks and these come in different flavors. There is 2G, 3G, 4G, 5G, etc. Some older ones, [05:23.030 --> 05:30.970] but I think these are the currently used. And in 4G and in 5G, there are these slightly different [05:30.970 --> 05:41.690] like NB-IoT is a special version of LTE. But the main thing is that you have different [05:42.890 --> 05:50.250] frequency bands and special radios that can talk with these protocols. [05:52.030 --> 05:58.270] Usually the mobile networks are operated by internet service providers, so ISPs, [05:58.270 --> 06:04.410] and they have massive amounts of base stations all over the world. So if you [06:04.410 --> 06:11.910] have civilization, you most likely have a mobile network there. And how you use these mobile [06:11.910 --> 06:19.210] networks is you just buy a subscription from an ISP, they will give you a SIM card or send it to [06:19.210 --> 06:24.630] you, and then you plug the SIM card into your device, the SIM card authenticates you to the [06:24.630 --> 06:35.330] network, and then you connect. You can kind of send text messages or phone calls, but nobody [06:35.330 --> 06:42.090] really does that anymore. So it's mainly used to route IP traffic from your device to the internet [06:42.090 --> 06:50.530] or wherever you want to go. Usually this mobile network stuff, this is very specialized, and [06:50.530 --> 06:58.410] it comes in this separate hardware module called a modem, and that's a separate device on your [06:59.170 --> 07:06.690] device. These modems are very complex, usually run their own operating systems, and are basically a [07:06.690 --> 07:15.450] small computer that you just connect to your board, and then it handles a lot of things. [07:17.670 --> 07:23.030] Here you can see a picture of this, so on the left we have a mobile device. [07:23.210 --> 07:32.350] It has a CPU and a modem, and the CPU runs some kind of operating system, Linux or Windows or [07:32.350 --> 07:39.530] whatever, and then talks with the modem and offloads the actual mobile network thing to it, [07:39.530 --> 07:45.290] and then you just give it data, and the data somehow finds its way into the internet. [07:47.610 --> 07:56.030] On 4G we have these cell towers, so these are the base stations that are all over the world, [07:56.030 --> 08:03.230] and your device usually connects to the nearest one or the one with the least amount of traffic, [08:03.230 --> 08:11.280] so they handle it themselves. The cell tower is connected to the ISP infrastructure, [08:11.280 --> 08:18.600] so there's different kind of things, we're not going to go that in depth, because this talk [08:18.600 --> 08:25.760] not only covers 4G, but all kinds of mobile networks. But usually they have similar way of [08:25.760 --> 08:32.440] operating, so first the radio connects to a serving gateway, and some kind of authentication [08:32.440 --> 08:39.640] mechanism, so the SIM card from the modem talks with the auth, and then your [08:40.620 --> 08:46.700] mobile device is then, the traffic is routed with these packet gateways to the internet. [08:50.920 --> 08:56.040] So how do we intercept this mobile network traffic? So if we want to analyze it, [08:56.040 --> 09:01.100] we need to see it, to see it we need to somehow intercept it at some point. [09:03.860 --> 09:11.260] So of course the easiest way to intercept traffic is on the device. So just log in, [09:11.260 --> 09:18.820] run TCP dump, and you will see the network connections. So if you have a Linux based device, [09:18.820 --> 09:25.580] the CPU is sending the data to the modem, but you can look at the traffic already on the device, [09:25.580 --> 09:31.500] so no need to any kind of fancy things. So if you can do this, it's very powerful, [09:31.500 --> 09:37.160] and especially if you want to know if your device is accepting connections, you might want to take [09:37.260 --> 09:43.680] a look at that from the device. So no need to scan all UDP ports if you just like, type in a [09:43.680 --> 09:51.200] command that shows you all listening UDP ports. This however, requires root access to the device, [09:51.200 --> 09:57.600] so if you want to hack something, um, you might not have this, or if you have some kind of secure [09:57.600 --> 10:04.540] device, like an iPhone, you might not be able to, uh, have enough permissions to do this. [10:06.020 --> 10:11.180] And also I said that the modem has its own operating system, might have some over there [10:11.180 --> 10:18.080] updates, uh, some of the functionality can be offloaded to it, so for example FTP, uh, you can [10:18.080 --> 10:23.900] just say to the modem that hey, download these files from this FTP server and hand them to me. [10:24.680 --> 10:30.540] And that might not be secure, and if you're just looking at the traffic on the device, you will [10:30.540 --> 10:35.520] most likely, you will not see that. And if you're doing penetration testing and you have been [10:35.520 --> 10:41.580] relying on this, I have bad news for you, you haven't kind of done your work really well. And [10:41.580 --> 10:49.540] we have found a lot of vulnerabilities in the modems. So if we actually want to intercept the [10:49.540 --> 10:56.100] traffic, um, there is the CPU, there's a modem, so how this works is they have some kind of [10:56.100 --> 11:03.580] serial interface, usually not encrypted because you don't really need to, and um, just kind of [11:03.580 --> 11:10.100] look at the board and find the traces and sniff them. Um, this work with these AT commands, [11:10.100 --> 11:14.860] sometimes a little bit different, but basically the CPU says to the modem that hey, please make [11:14.980 --> 11:20.280] a connection to Google and then send this data through that connection and you will get the [11:20.280 --> 11:30.780] traffic. So you can just kind of sniff the traffic and decode it and or even replace the modem [11:30.780 --> 11:38.040] with your own software based simulator. So this is something that we've already done. Um, in [11:38.040 --> 11:44.300] some cases it's quite simple. If you have kind of uh, clear traces and you just solder your [11:44.300 --> 11:52.480] serial port adapter to it and pull the modem to reset, you can do this. But of course it requires [11:52.480 --> 12:01.440] hardware reverse engineering and some tiny soldering and again, uh, there's very complex setup [12:01.440 --> 12:09.900] sometimes, so um, it might not be as easy as is shown here. And we cannot see the modem's own [12:09.900 --> 12:19.540] traffic, uh, here as well. Um, I usually have written my own because it's quite simple to do, [12:19.540 --> 12:26.500] but I found this uh, GitHub project that seems to have uh, made similar thing. So if you want to [12:26.500 --> 12:36.240] play around with this, you can look at that and uh, try it out. The next thing I tried uh, to run [12:36.240 --> 12:42.500] my own base station because I want to see the modem traffic. I figured out just like I have my [12:42.500 --> 12:49.300] Wi-Fi access point, I'll do a 4G access point. Um, you can uh, buy this, uh, you can build your [12:49.300 --> 12:57.680] own and um, the software defined radios can do pretty much anything nowadays. Just a couple hundred [12:57.680 --> 13:05.000] bucks and uh, open source software and, and you can do this. A basic setup, like a thousand bucks, [13:05.000 --> 13:10.820] not that much if you're into kind of uh, professional uh, penetration testing. Uh, but it [13:10.820 --> 13:16.680] requires a week worth of work to get some running. And if you want to buy the commercial thing [13:16.680 --> 13:25.320] then it's, it's really expensive. Uh, the problem with these, the radio bands are heavily [13:25.320 --> 13:32.940] licensed. They are used uh, quite a lot and that means that kind of all available bands have been [13:32.940 --> 13:38.820] bought by someone. Uh, so it's illegal to run without a Faraday cage. So you need to have a kind [13:38.820 --> 13:46.960] of pouch uh, that you put your radio in and your device in and you have to kind of uh, be careful [13:46.960 --> 13:52.360] not to leak the thing because someone will find you and uh, come find you. Some of the frequency [13:52.360 --> 13:59.420] bands can be licensed. Uh, some countries have unlicensed bands but then you're limited into that [13:59.420 --> 14:08.800] one band or uh, that one physical location where you are running this. So if you're into this, [14:09.510 --> 14:15.440] there's the Libra Cellular, they have good instructions how to do this, but I have something [14:15.440 --> 14:26.370] better for you. So let's go back to the 4G mobile network. We have our mobile device, it talks [14:26.370 --> 14:33.270] to the cell tower and then there's the authentication and some other stuff. But what exactly [14:33.270 --> 14:40.270] is that other stuff? Like I said, the device is authenticated with SIM card, but it's not [14:40.290 --> 14:47.350] authenticated with SIM cards. And then there's some kind of uh, packet filtering uh, going on. [14:47.490 --> 14:53.770] There is this thing called lawful interception that uh, kind of means that your traffic uh, can [14:53.770 --> 14:59.930] be inspected by the authorities. Uh, and I think if it can be inspected then it most likely [14:59.930 --> 15:09.930] is. Um, but yeah. Other things that it does is policy enforcement. So basically it means uh, if [15:09.930 --> 15:17.630] you buy a slow speed subscription it will make sure that you won't uh, get good speeds. They [15:17.630 --> 15:23.390] calculate the billing so if you have a kind of per megabyte subscription then they calculate [15:23.390 --> 15:32.110] the megabytes. Then they route the packets. So there might be some kind of ISP internal [15:32.110 --> 15:39.790] things like uh, DNS servers. So some of the things might not go to the internet at all. Um, so [15:39.790 --> 15:50.570] they might go to kind of uh, internal uh, DNS service or, or something else. But um, also the [15:51.090 --> 15:59.230] packets can be routed internally in different ways. So we have these things uh, called APNs. Uh, [15:59.230 --> 16:09.470] which basically mean that um, how to uh, route your packets uh, inside the ISP. So this is [16:09.470 --> 16:15.410] something that if you're old you know what these are because you've kind of gotten a new SIM card [16:15.410 --> 16:19.530] you put it in and it doesn't work. And then you need to go to these and then you need to type [16:19.530 --> 16:25.830] something. But nowadays you might not even uh, know that these exist. So, and if you need to [16:25.830 --> 16:31.850] type something you just type in internet and then you get to the internet. Uh, these are actually [16:31.850 --> 16:39.450] used uh, so you might have some kind of uh, restricted internet or something. So uh, some ISP [16:39.470 --> 16:48.870] is um, uh, offer some kind of child safe things so they do more, more things uh, uh, or some kind [16:48.870 --> 16:54.690] of uh, at some point you can kind of get more speed if you, from some, certain ISP. So if you [16:54.690 --> 16:58.690] don't use the internet but you use something else then it's faster because there's less people [16:58.690 --> 17:05.870] there or, or something like that. But usually just um, you use what the, comes with the [17:05.870 --> 17:12.230] subscription. So these uh, a big change nowadays that these are pushed usually through the [17:12.230 --> 17:17.910] network to your device. So when you connect and you don't have an APN, the modem asks the [17:17.910 --> 17:24.810] network that hey, like do you have something for me and then it's automatically set up. You [17:24.810 --> 17:32.170] can change these uh, configure them manually on the device um, but it might not be respected by [17:32.170 --> 17:37.170] the ISP. So it basically just tells the ISP, hey this is what I want, but it can of course [17:37.170 --> 17:51.210] offer you whatever it wants. So there is this uh, thing called private APN. So um, something [17:51.210 --> 17:58.190] that uh, you can kind of buy as a service. So if you run uh, big fleets of IOT devices, you [17:58.190 --> 18:05.190] might want uh, to buy this uh, from an ISP. So they will set you up with a internal network [18:05.190 --> 18:12.130] where uh, your devices are connected to and they might not go to the internet at all or there [18:12.130 --> 18:17.710] might be some uh, uh, kind of you can run your own server there or uh, something like that. [18:17.710 --> 18:26.610] It's a private network um, and they can be configured uh, however. So routing, filtering, [18:26.610 --> 18:34.750] everything can be configured and direct connection between the devices are kind of at least uh, you [18:34.750 --> 18:43.250] can configure them to be allowed. So this is a big difference to normal uh, APNs that you cannot [18:43.250 --> 18:51.390] really do device to device connections, but you just have to go through the internet. These also [18:51.390 --> 19:00.470] by default usually they don't filter the traffic, so it's um, sometimes the ISPs don't really like [19:00.470 --> 19:06.990] some kind of uh, traffic or if you do like port scanning over mobile network, they might shut [19:06.990 --> 19:17.280] you down and you don't really know if it uh, works or not. But so you can also set the private [19:17.280 --> 19:22.400] APN to connect you to the internet, so you have access to all these services and then you can [19:22.400 --> 19:29.120] get uh, also access the internet uh, maybe even with a static IP that then you can configure your [19:29.120 --> 19:35.220] servers to only accept that. So then, it's used quite heavily in IOT, so that's where I found out [19:35.220 --> 19:42.900] that this exists and I, a lot of the customers are using this. So I kind of figured that this [19:42.900 --> 19:52.200] sounds something that kind of, if we want to do this uh, inspect the packets and they use the same [19:52.200 --> 19:58.860] things for the lawful interception things, then it might help me kind of uh, look at my traffic. [19:59.800 --> 20:08.600] So, I had this question, could I get a private APN? Sounds expensive and uh, I went on a journey to [20:08.600 --> 20:16.440] send a bunch of emails to different ISPs and uh, I found out that there's a huge variance in price [20:16.440 --> 20:25.100] and usability. So, the first place I went, they had this uh, contact us for pricing and they were [20:25.100 --> 20:30.860] like, yeah, we can do this uh, no problem, so you just pay us 3K to get started and then 500 [20:30.860 --> 20:37.760] monthly. So I was like, yeah, this sounds a bit too much for a proof of concept and I might as well [20:37.760 --> 20:44.520] just run my own base station in a couple of offices. Uh, the next place they were also contact us [20:44.520 --> 20:50.820] for pricing, but I was pleasantly surprised. So, they also said that hey, just go to our self [20:50.820 --> 20:58.220] service portal and activate it and you're good to go. And they had a 100 USD setup fee and 150 bucks [20:58.380 --> 21:07.000] a month. So this is completely doable. There's another place, so they have this uh, $10 setup fee [21:07.000 --> 21:14.260] and 75 cents per hour. So different uh, pricing models, so if you look at the, in the similar [21:14.520 --> 21:22.200] schemes here, so the first one, if you kind of no matter how much you use it, it's 250 bucks, but uh, [21:22.200 --> 21:30.220] then for a year it's just 2K. So you can rent it out easily and uh, other one, so 30 bucks a day, 100 [21:30.220 --> 21:37.020] bucks a week and 6.5K for a year. So if you want to kind of uh, do it for longer times, you might [21:37.020 --> 21:44.500] want to have this uh, local ISP and then uh, if you just want it for a day, then you can just [21:44.520 --> 21:53.040] do it. You have options for that. There is a lot of difference in coverage, so some of them are [21:53.040 --> 21:57.520] really global, they offer services in all the countries, some are US specific, some are EU [21:57.520 --> 22:04.400] specific and even uh, some are just uh, inside your country. There's also differences in the [22:04.400 --> 22:08.800] available data plans, so you still have to pay for your subscription even though you have the [22:08.800 --> 22:18.180] private APN because it's kind of a different thing. Um, some of the like IOT orientated ISPs, [22:18.180 --> 22:24.720] they offer a really good pricing that you only pay like 2 bucks a year if you send 100 [22:24.720 --> 22:30.320] kilobytes of data a year. But if you want to uh, look at your phone traffic, I recommend not [22:30.320 --> 22:38.780] using these uh, IOT things uh, because it might be uh, costly. But some of uh, just the [22:38.800 --> 22:44.240] regular ISPs offer this, so then you can uh, use your own uh, already kind of own [22:44.240 --> 22:50.760] subscriptions and you can have like unlimited data for uh, whatever you are paying for it in [22:50.760 --> 22:59.750] your country. And then you can push that to the private APN. So how to configure this? Like [22:59.750 --> 23:05.990] once you buy it, first you want to disable the traffic filtering if there is one. Um, and [23:05.990 --> 23:10.670] then disable routing to the internet because we don't want the devices to connect to the [23:10.670 --> 23:21.410] internet without us seeing it. Next, just uh, site to site VPN between the private APN on kind [23:21.410 --> 23:27.810] of our cloud server. We could do a bunch of these things inside the private APN, but I kind [23:27.810 --> 23:33.030] of like to be in control uh, of what I do and have like command line access to the server [23:33.030 --> 23:40.490] where, where the data is. But once we have the tunnel, we can set our cloud server as the [23:40.810 --> 23:45.830] default gateway for the network and that basically means that all the data from the SIM [23:45.830 --> 23:52.070] cards first go to the private APN and then it's just shoved through the VPN tunnel uh, into [23:52.070 --> 23:59.770] our cloud server. And this basically should mean that the SIM card data is now on our cloud [23:59.770 --> 24:07.890] server. And so we need to add some mobile devices to the private APN, so we have our SIM [24:07.890 --> 24:16.450] card, we push it into the device. Uh, some ISPs uh, kind of require you to set some uh, APN [24:16.450 --> 24:23.250] settings uh, on the device so they are not pushing anything to the devices or they uh, are [24:23.250 --> 24:29.590] roaming and you kind of need to set it up. Uh, and kind of some of the ISPs that say that [24:29.590 --> 24:35.450] you need to set the APN and you need to set it to this, you might be able to just set anything [24:35.450 --> 24:43.230] and it works like on some carriers and then some it doesn't and it's, it's weird. So uh, [24:44.030 --> 24:52.450] uh, yeah. And then there are some ISPs like if you actually run uh, both the kind of ISP and [24:52.450 --> 24:57.330] you run the kind of infrastructure and you run the cell towers and everything, then you have [24:57.330 --> 25:03.990] more control over things. So you have this easy check box that just redirect everything uh, to [25:03.990 --> 25:09.550] the private APN no matter what settings or anything there's on the device. So this is uh, [25:09.550 --> 25:15.850] something that uh, you want to look for uh, when you are uh, testing devices that don't want [25:15.850 --> 25:21.650] to be tested. Uh, because then you just uh, it thinks it's connected to normal internet but [25:21.650 --> 25:33.750] it's connected to you. And this should be it. So profit. Uh, let's see. So this is a proof of [25:33.750 --> 25:39.810] concept for this. So I talked about there's the IOT device connected to some of uh, some [25:39.810 --> 25:47.670] AS uh, ISP and then there's a private APN configured uh, inside the ISP. We have the IPsec [25:47.670 --> 26:01.310] VPN tunnel to our server and then I'm SSH into the server. So uh, yeah. Let's see a demo. So uh, [26:01.310 --> 26:09.870] here we have the trusty EPC. So it's kind of, it doesn't require fancy things. You just SSH into [26:10.490 --> 26:17.550] your uh, server. My server is called private APN because it's connected to the private APN. Here [26:17.670 --> 26:24.170] we are running a TCP dump. So the interface is the IPsec VPN tunnel interface and we're looking [26:24.170 --> 26:39.660] for traffic from host uh, 10.2.2.2.0.1. And yeah. So we have the uh, 2.2.2.0.1 SIM card. So [26:39.660 --> 26:46.660] that has like statically uh, static IP that every time that uh, SIM card is pushed to a device it [26:46.660 --> 26:54.600] will get that IP address and here it is uh, booting up. And I'm really interested to see what it [26:54.600 --> 27:07.460] actually does. So let's see. Of course takes some time to boot but uh, we have uh, yeah. And now [27:07.880 --> 27:16.220] we see some traffic. So it wants to know the time. So not that interesting after all. But if you [27:16.220 --> 27:22.320] leave the SIM card to the device then you will see some uh, unencrypted uh, location data from [27:22.320 --> 27:28.620] that. So if you're running that tracker somewhere, uh, the ISP knows where you're kind of uh, [27:28.620 --> 27:35.420] exactly where you're running it. It's kind of uh, one nice thing about this setup is also you just [27:35.420 --> 27:42.220] kind of uh, put the SIM card into something and then you see the traffic. So here is a modem. It's [27:42.220 --> 27:50.200] used to connect uh, laptops or ethernet based devices uh, to the internet with 4G. So here it's [27:50.200 --> 27:57.020] booting up. And I like I said, it runs its own operating system. This is kind of a device but it [27:57.020 --> 28:02.420] might also be a chip uh, inside your phone or whatever. But they run their own operating [28:02.420 --> 28:10.920] systems. So once it's uh, booted up uh, we can see that it has, so it actually says here zero [28:10.920 --> 28:20.060] devices connected. But there's uh, data there. So it's connecting to netgear.com and uh, a lot [28:20.060 --> 28:26.060] of, doing a lot of things. So it's downloading or checking for software updates. But luckily we [28:26.060 --> 28:32.360] can see that it's uh, 443 so it's DLS traffic and I couldn't use my certmetem tool to hack that [28:32.360 --> 28:40.500] so it's, it can be okay, maybe. But now we at least know that it's, it's not uh, completely bad. [28:42.630 --> 28:52.390] And also, so here, next up we have an iPhone. So we're booting it up and uh, I have the SIM card [28:52.390 --> 28:58.030] tray and you can see me struggle getting it in. So this is the kind of hardest part of the setup [28:58.030 --> 29:03.750] is actually kind of boosting the SIM card inside. One of our project uh, kind of penetration [29:03.750 --> 29:07.770] tester pushed the SIM card and it, we heard this kind of clunk, clunk, clunk, clunk, clunk [29:07.770 --> 29:12.270] because it was inside the device and it was a competition and we only had 30 minutes so we [29:12.270 --> 29:18.190] had to shake it out of the device. But yeah, that was one joke and uh, that's all of them. [29:18.290 --> 29:22.910] So if we push the SIM card into the device, you can see it's actually locked. So this is the [29:22.910 --> 29:30.450] first boot before unlock. We push a SIM card into an iPhone, so let's see what happens. [29:33.360 --> 29:42.320] Yep, so it's connecting to somewhere. So in here I think it's doing uh, some uh, push [29:42.320 --> 29:49.340] notifications so it's uh, getting that. And I think it uh, won't do that many things before you [29:49.340 --> 29:54.680] actually unlock it but we are actually seeing something. So if you are into hacking locked [29:54.680 --> 30:05.740] devices, you might want to look into this. So yeah, so this is the demo. That's uh, how easy to [30:05.740 --> 30:25.370] actually run it uh, once you've set it up. Yeah, and let's get back to this question. So is there [30:25.370 --> 30:31.750] traffic over 5G as well? So of course when I made this slide I was like hey, I will need to kind [30:31.750 --> 30:38.670] of uh, check it. So this is my phone, I connected it to a Wi-Fi, then I pushed the same SIM card [30:38.670 --> 30:46.370] into it and this is what I see. So even though it's connected to Wi-Fi, you will see traffic. So [30:46.370 --> 30:52.370] these are the, I think similar Apple push notifications. Uh, first when I Googled these IP [30:52.370 --> 30:58.770] addresses I went kind of uh, the first match was some weird Russian forum and I got scared. Um, [30:58.770 --> 31:10.310] but turned out it's uh, maybe not some uh, malware on my phone. But yeah, so there is uh, [31:10.910 --> 31:16.510] something that the operating system does so it overrides the Wi-Fi and pushes directly uh, [31:16.510 --> 31:23.470] through the 5G. And if there is some kind of advanced malware then it might also pop up here. [31:25.870 --> 31:41.430] So proof of concept it's kind of uh, kind of uh, yes. So uh, from kind of moving on from the proof [31:41.430 --> 31:47.530] of concept to an actual project that uh, you guys can use. Uh, so I collaborated with some IOT [31:47.530 --> 31:54.010] security experts. Some of them are here in the room and they have had the same exact problems. [31:54.130 --> 32:01.350] So, how do you, of course they have the problem of how do you kind of uh, look at your mobile [32:01.350 --> 32:08.290] traffic and bunch of them were in the face of using their own uh, kind of mobile base stations [32:08.290 --> 32:15.330] and uh, software defined radios and kind of trying to use an IOT device that you need to kind of boot [32:15.330 --> 32:20.630] up and then you need to press a button. But once it's inside the bag it's kind of hard to best [32:20.630 --> 32:26.410] press the button and uh, then I told about this that hey I, I kind of uh, think this is the way to [32:26.410 --> 32:34.030] do it and, and kind of I can see them contemplating kind of uh, years worth of uh, doing all the [32:34.030 --> 32:44.270] previous steps. Um, and yeah some uh, I also heard that they are running similar setup than I do. [32:44.270 --> 32:53.190] Like one person I know that has been running this uh, and a bunch of that haven't. So of course [32:53.190 --> 32:58.930] I'm from Finland. We have the kind of uh, holy land of uh, network connectivity so of course [32:58.930 --> 33:05.450] everything works there. Uh, it's cheap and uh, stuff like that. So I wanted to look at the US [33:05.450 --> 33:14.330] where it's uh, the opposite. There's, it's not cheap. Um, and also EU and global stuff. So it [33:14.330 --> 33:22.230] turns out a lot of ISPs and companies offer affordable private APNs and um, they a little bit [33:22.230 --> 33:31.290] different but uh, I created this uh, GitHub page so it's online now. And you can see this uh, to [33:31.290 --> 33:39.610] get uh, some up to date things. So they are, there are global ISPs there. So one of the ten [33:39.610 --> 33:47.530] bucks uh, to set up and twenty bucks per day thing works everywhere. Uh, if you've seen me uh, [33:47.530 --> 33:54.050] before today I've kind of given out bunch of SIM cards so you can try this out. But uh, there [33:54.050 --> 34:00.230] would, should be something there that works in your country. Uh, but of course the global IOT [34:01.570 --> 34:07.670] providers might be too expensive for your use case if you want to use more data. Uh, and if you [34:07.670 --> 34:13.970] want to use kind of your existing uh, mobile plans or you want to use your local ISP, you really [34:13.970 --> 34:20.170] should kind of show them this GitHub page and ask them hey, do you want to go there on the GitHub [34:20.170 --> 34:28.110] page so people will buy your services and uh, figure out if you can make it work. Uh, if they have [34:28.110 --> 34:33.830] to do it manually it will be expensive. So uh, usually you want to look for something that has [34:34.370 --> 34:43.950] a, a self service portal that works. But yeah. So this is my kind of uh, full set up. And this is [34:43.970 --> 34:52.550] the GitHub that I run. So I have uh, multiple IOT devices connecting to an ISP and so a global ISP [34:52.550 --> 34:59.830] one of the devices is in Helsinki in uh, in my home. One is here in Las Vegas. And they are kind [34:59.830 --> 35:06.670] of in the opposite sides of the world but they still connect to the same ISP. And they do the ISP [35:06.670 --> 35:13.950] stuff. Go into the private APN. Uh, different uh, ISPs have different kind of uh, different [35:13.970 --> 35:22.750] tunnels. But uh, they end up in my, my server. There I run WireGuard but you can also set up uh, [35:22.750 --> 35:30.210] another type of VPN uh, for your pentesting like uh, workstations. So here I have on the right [35:30.210 --> 35:36.830] like a Kali Linux machine in Helsinki. Uh, some of my colleagues maybe be in Stockholm and they [35:36.830 --> 35:43.170] have the same. And uh, with this uh, VPN server on the cloud server. So there's like one to one [35:43.170 --> 35:51.530] mapping. So IOT like SIM card one goes to VPN profile one and the VPN profile one is opened uh, [35:51.530 --> 35:58.390] in Helsinki. And then the traffic just magically goes there. So once you set up this uh, if you [35:58.390 --> 36:03.690] are working in a company, your colleagues will love you. You just hand them out SIM cards. You [36:03.690 --> 36:09.710] hand them out uh, uh, VPN profiles. And then like they're hey, what's this? And you just hey, [36:09.710 --> 36:14.450] push that in there and then just double click that and then you see the data and everyone's [36:14.450 --> 36:21.670] amazed and you're a hero. So uh, it's that easy. But you can of course don't have to have this [36:21.670 --> 36:29.870] fancy set up if you just want to do everything on the cloud server you can do it there. Um, [36:29.870 --> 36:37.810] also like I said on the GitHub you have um, a list of uh, private APNs. The list is quite small [36:37.810 --> 36:46.610] because I use things that I found that work in Finland. When I flew here I tested uh, London. So [36:46.610 --> 36:53.490] in London this works great. Uh, here uh, I run into the problem that the modem I was using to [36:53.490 --> 37:01.210] kind of uh, figure out if they work in different ways. Uh, doesn't work in the U.S. because I [37:01.210 --> 37:08.950] noticed that the U.S. has different mobile network stuff for some reason. But um, I tested that [37:08.950 --> 37:14.650] these work well on my phone here. So I just push it into my phone and I can see the traffic uh, on [37:14.650 --> 37:25.570] the server. So confirmed to work well um, everywhere in the world. But yeah, so let's wrap up [37:25.570 --> 37:32.950] and um, go back to the kind of why do, would you want to do this? So curiosity and privacy. [37:34.030 --> 37:41.050] Fifty bucks, couple days of tinkering on a device, like that's a good deal. Uh, it's actually the [37:41.050 --> 37:47.610] fifteen bucks is like one evening of like six hours of of uh, tinkering with this. So not, not [37:47.610 --> 37:54.090] much. And even if you use this uh, if you want to use it for a longer time you might want to look [37:54.090 --> 38:01.410] into uh, other options that are kind of uh, less expensive in long term. But hackerspaces or even [38:01.410 --> 38:07.890] tiniest penetration testing companies, like two K a year should be a no brainer to uh, if you [38:07.890 --> 38:16.530] really want to look at the traffic. Offensive security. So if you do penetration testing on IoT [38:17.140 --> 38:22.910] and you say to your customers that hey we kind of look at the device and look where it's [38:22.910 --> 38:28.910] connected to, you really need some kind of setup to do this. And two thousand a year versus an [38:28.910 --> 38:34.850] illegal setup that's kind of, you need to have your best engineers work a week on, so that's [38:35.550 --> 38:44.050] really expensive as well. These devices, especially in industrial IoT, uh, they're [38:44.050 --> 38:49.570] everywhere and people don't really look at their traffic that much. So there's just a handful of [38:49.570 --> 38:58.890] companies that actually I know that do this, but now anyone can do this. And like I said, [38:58.910 --> 39:05.030] maybe some new attack vectors for high security devices that if you can push a SIM card in and it, [39:05.030 --> 39:14.270] you get the data then you can also uh, send some uh, malicious things uh, to it. Defensive point [39:14.270 --> 39:21.590] of view. So these private APNs, uh, like I connect it to my server, but you can connect the [39:21.590 --> 39:27.390] IPsec tunnel to your existing firewall. So if you are running some kind of uh, firewall, then [39:27.390 --> 39:35.350] uh, you can just connect this to it. Um, kind of the first devices might kind of uh, cost something [39:35.350 --> 39:41.590] and then you, it costs more to add devices but the cost goes down uh, gradually. So if you have [39:41.590 --> 39:50.910] thousands of devices, it will be still uh, quite uh, inexpensive to do. And the mobile phone [39:50.910 --> 39:57.370] malware infections, they might not communicate at all over Wi-Fi or VPN. So there was this uh, [39:57.930 --> 40:04.410] hack, some kind of some triangles or something and uh, they said that when they noticed the [40:04.410 --> 40:09.710] hack, uh, they were uh, scanning there or like they were looking at their Wi-Fi traffic at their [40:09.710 --> 40:16.150] office and they noticed that some of the phones were sending things to some uh, C2 servers. And [40:16.150 --> 40:21.970] they also analyzed the malware and the malware had these properties that it can detect if it's [40:21.970 --> 40:29.890] been uh, run over Wi-Fi or VPN and not do it. So it might have been misconfigured to allow traffic [40:29.890 --> 40:34.430] over Wi-Fi because why would you, people are looking at the Wi-Fi, why would you do your [40:34.430 --> 40:39.410] malicious stuff over that? So it might have just been a misconfigured malware that they [40:39.410 --> 40:46.190] happened to find through their Wi-Fi. So I, my thing that the advanced malware that sometimes [40:46.190 --> 40:52.310] are not that advanced uh, might get better at this or they might already be doing this and that [40:52.310 --> 41:01.810] was just one uh, slip up. Uh, so yeah, if you're targeted by uh, advanced malware, you might want [41:01.810 --> 41:10.030] to do kind of, this kind of thing. But you can find the project details, you can uh, snap a uh, [41:10.030 --> 41:15.910] photo of this to remember it and you can find me here at DEF CON or the internet and uh, [41:15.910 --> 41:19.450] thank you for your uh, coming here.