1 00:00:00,000 --> 00:00:01,900 So my name is Aapo. 2 00:00:02,080 --> 00:00:15,500 I do a lot of things with IoT, but especially for my work, security research, consulting, and mainly look at IoT and other kinds of devices. 3 00:00:15,880 --> 00:00:19,560 I work a lot on cryptography and network protocols. 4 00:00:19,880 --> 00:00:22,100 Outside of that, bug bounty. 5 00:00:22,100 --> 00:00:26,760 So if you run a hardware bug bounty program, you know where to find me. 6 00:00:26,840 --> 00:00:29,760 And I'm also a coach for a Finnish CTFT. 7 00:00:33,400 --> 00:00:43,440 But yeah, so here is some IoT and my trusty EPC and I want to kind of see how it works. 8 00:00:43,440 --> 00:00:49,080 I might want to hack it or I might want to check out something about it. 9 00:00:50,600 --> 00:00:57,300 This particular device connects to the internet with an ethernet port or Wi-Fi. 10 00:00:57,660 --> 00:00:59,560 So that should be quite straightforward. 11 00:00:59,560 --> 00:01:13,680 If we want to know where it's connecting to, and that's a big part of IoT, we can simply plug in an ethernet cable to the device and the other ends to our laptop. 12 00:01:13,680 --> 00:01:21,020 And then on our laptop in the ethernet interface, we will see any traffic it's trying to send. 13 00:01:22,760 --> 00:01:24,960 We can do the same with Wi-Fi. 14 00:01:24,960 --> 00:01:29,060 So if we have our access point, the device connected to it. 15 00:01:29,060 --> 00:01:34,860 And then again, we will see the traffic on the ethernet interface. 16 00:01:37,120 --> 00:01:47,820 But there are some kind of devices and especially industrial IoT that have a very specialized job and they have been made to be very cheap. 17 00:01:47,820 --> 00:01:51,700 So they have only one way to connect to the internet. 18 00:01:51,700 --> 00:01:58,960 And nowadays a big part of it is something else than ethernet or Wi-Fi. 19 00:01:59,540 --> 00:02:03,540 So today we will be talking about these kind of devices. 20 00:02:03,620 --> 00:02:09,640 So some kind of 4G connection on this one and how that works. 21 00:02:09,640 --> 00:02:16,220 There's a modem, you plug in a SIM card and it connects to 4G and it's connected to the internet. 22 00:02:16,420 --> 00:02:21,720 But the problem is how do we actually see the data? 23 00:02:22,200 --> 00:02:26,320 So this is kind of the topic of today. 24 00:02:27,980 --> 00:02:30,540 There are also different kind of devices. 25 00:02:30,540 --> 00:02:33,080 They might have multiple ways of connecting to the internet. 26 00:02:33,080 --> 00:02:41,620 So here we have a phone currently connected to my Wi-Fi access point and I can see everything it's sending to the internet. 27 00:02:41,840 --> 00:02:43,060 Or can I? 28 00:02:43,280 --> 00:02:51,180 So if you might not be able to see it, but there's a little 5G icon there so it's actually connected to 5G as well. 29 00:02:52,120 --> 00:02:55,940 So question is, is there traffic over 5G as well? 30 00:02:56,860 --> 00:03:02,540 So it might be something built in, there might be something malicious. 31 00:03:02,900 --> 00:03:07,320 So let's talk about that. 32 00:03:09,520 --> 00:03:13,060 So why would you want to look into mobile network traffic? 33 00:03:13,640 --> 00:03:20,920 If you're just a tinkerer, if you're at Defcon here or watching this video, then you might be curious. 34 00:03:21,240 --> 00:03:23,340 You might care about your privacy. 35 00:03:23,500 --> 00:03:27,640 You might think, where do my devices talk to? 36 00:03:27,900 --> 00:03:34,020 Is there some kind of unencrypted private information flying through the air? 37 00:03:34,020 --> 00:03:42,240 And if you are in traveling in some countries you might want to kind of know what exactly your devices are sending. 38 00:03:44,530 --> 00:03:50,790 From offensive security point of view, we might think that can we tamper with the traffic and find vulnerabilities? 39 00:03:51,390 --> 00:04:04,710 If you do penetration testing and you have these kind of devices, you need to hack them, you need to kind of do some kind of security audit or something like that. 40 00:04:05,530 --> 00:04:08,490 You might want to look at the traffic. 41 00:04:08,490 --> 00:04:15,250 Can you say we've kind of penetration tested this if you haven't looked at the mobile traffic? 42 00:04:17,820 --> 00:04:25,520 From defensive point of view, you might want to detect malicious traffic or just filter some unwanted things. 43 00:04:25,800 --> 00:04:29,400 You can do this in most cases on the device. 44 00:04:29,400 --> 00:04:37,040 So if you have a phone, you can install something and it will kind of filter things or endpoint detection or whatever. 45 00:04:37,040 --> 00:04:44,240 But if you have some advanced malware on your phone, it might not respect the on-device protections. 46 00:04:44,240 --> 00:04:55,060 So if it's running on very low inside the operating system, it can easily just not allow the endpoint protection to run. 47 00:04:56,100 --> 00:05:02,420 So we might not want to do the testing on the device, we want to do it outside. 48 00:05:06,530 --> 00:05:09,670 So what are these mobile networks? 49 00:05:10,370 --> 00:05:15,190 Sometimes called like cellular networks and these come in different flavors. 50 00:05:15,350 --> 00:05:19,530 There is 2G, 3G, 4G, 5G, etc. 51 00:05:19,910 --> 00:05:26,090 Some older ones, but I think these are the currently used. 52 00:05:26,090 --> 00:05:36,730 And in 4G and in 5G, there are these slightly different like NB-IoT is a special version of LTE. 53 00:05:37,090 --> 00:05:50,250 But the main thing is that you have different frequency bands and special radios that can talk with these protocols. 54 00:05:52,030 --> 00:06:03,870 Usually the mobile networks are operated by internet service providers, so ISPs, and they have massive amounts of base stations all over the world. 55 00:06:03,870 --> 00:06:09,590 So if you have civilization, you most likely have a mobile network there. 56 00:06:10,310 --> 00:06:28,650 And how you use these mobile networks is you just buy a subscription from an ISP, they will give you a SIM card or send it to you, and then you plug the SIM card into your device, the SIM card authenticates you to the network, and then you connect. 57 00:06:30,450 --> 00:06:36,870 You can kind of send text messages or phone calls, but nobody really does that anymore. 58 00:06:36,870 --> 00:06:44,310 So it's mainly used to route IP traffic from your device to the internet or wherever you want to go. 59 00:06:46,390 --> 00:07:00,390 Usually this mobile network stuff, this is very specialized, and it comes in this separate hardware module called a modem, and that's a separate device on your device. 60 00:07:00,630 --> 00:07:15,450 These modems are very complex, usually run their own operating systems, and are basically a small computer that you just connect to your board, and then it handles a lot of things. 61 00:07:17,670 --> 00:07:23,030 Here you can see a picture of this, so on the left we have a mobile device. 62 00:07:23,210 --> 00:07:45,290 It has a CPU and a modem, and the CPU runs some kind of operating system, Linux or Windows or whatever, and then talks with the modem and offloads the actual mobile network thing to it, and then you just give it data, and the data somehow finds its way into the internet. 63 00:07:47,610 --> 00:08:06,710 On 4G we have these cell towers, so these are the base stations that are all over the world, and your device usually connects to the nearest one or the one with the least amount of traffic, so they handle it themselves. 64 00:08:07,430 --> 00:08:22,900 The cell tower is connected to the ISP infrastructure, so there's different kind of things, we're not going to go that in depth, because this talk not only covers 4G, but all kinds of mobile networks. 65 00:08:22,980 --> 00:08:46,700 But usually they have similar way of operating, so first the radio connects to a serving gateway, and some kind of authentication mechanism, so the SIM card from the modem talks with the auth, and then your mobile device is then, the traffic is routed with these packet gateways to the internet. 66 00:08:50,920 --> 00:08:54,540 So how do we intercept this mobile network traffic? 67 00:08:54,540 --> 00:09:01,100 So if we want to analyze it, we need to see it, to see it we need to somehow intercept it at some point. 68 00:09:03,860 --> 00:09:08,680 So of course the easiest way to intercept traffic is on the device. 69 00:09:08,840 --> 00:09:15,920 So just log in, run TCP dump, and you will see the network connections. 70 00:09:16,060 --> 00:09:28,080 So if you have a Linux based device, the CPU is sending the data to the modem, but you can look at the traffic already on the device, so no need to any kind of fancy things. 71 00:09:28,080 --> 00:09:38,820 So if you can do this, it's very powerful, and especially if you want to know if your device is accepting connections, you might want to take a look at that from the device. 72 00:09:38,820 --> 00:09:46,020 So no need to scan all UDP ports if you just like, type in a command that shows you all listening UDP ports. 73 00:09:48,100 --> 00:10:04,540 This however, requires root access to the device, so if you want to hack something, um, you might not have this, or if you have some kind of secure device, like an iPhone, you might not be able to, uh, have enough permissions to do this. 74 00:10:06,020 --> 00:10:23,900 And also I said that the modem has its own operating system, might have some over there updates, uh, some of the functionality can be offloaded to it, so for example FTP, uh, you can just say to the modem that hey, download these files from this FTP server and hand them to me. 75 00:10:24,680 --> 00:10:32,560 And that might not be secure, and if you're just looking at the traffic on the device, you will most likely, you will not see that. 76 00:10:32,940 --> 00:10:40,380 And if you're doing penetration testing and you have been relying on this, I have bad news for you, you haven't kind of done your work really well. 77 00:10:41,100 --> 00:10:45,040 And we have found a lot of vulnerabilities in the modems. 78 00:10:47,220 --> 00:11:06,800 So if we actually want to intercept the traffic, um, there is the CPU, there's a modem, so how this works is they have some kind of serial interface, usually not encrypted because you don't really need to, and um, just kind of look at the board and find the traces and sniff them. 79 00:11:07,060 --> 00:11:21,660 Um, this work with these AT commands, sometimes a little bit different, but basically the CPU says to the modem that hey, please make a connection to Google and then send this data through that connection and you will get the traffic. 80 00:11:23,620 --> 00:11:34,040 So you can just kind of sniff the traffic and decode it and or even replace the modem with your own software based simulator. 81 00:11:34,240 --> 00:11:36,840 So this is something that we've already done. 82 00:11:36,880 --> 00:11:40,180 Um, in some cases it's quite simple. 83 00:11:40,180 --> 00:11:49,400 If you have kind of uh, clear traces and you just solder your serial port adapter to it and pull the modem to reset, you can do this. 84 00:11:50,520 --> 00:12:07,120 But of course it requires hardware reverse engineering and some tiny soldering and again, uh, there's very complex setup sometimes, so um, it might not be as easy as is shown here. 85 00:12:07,660 --> 00:12:12,200 And we cannot see the modem's own traffic, uh, here as well. 86 00:12:15,180 --> 00:12:25,880 Um, I usually have written my own because it's quite simple to do, but I found this uh, GitHub project that seems to have uh, made similar thing. 87 00:12:25,880 --> 00:12:30,820 So if you want to play around with this, you can look at that and uh, try it out. 88 00:12:33,300 --> 00:12:39,720 The next thing I tried uh, to run my own base station because I want to see the modem traffic. 89 00:12:39,720 --> 00:12:45,680 I figured out just like I have my Wi-Fi access point, I'll do a 4G access point. 90 00:12:46,440 --> 00:12:56,420 Um, you can uh, buy this, uh, you can build your own and um, the software defined radios can do pretty much anything nowadays. 91 00:12:56,660 --> 00:13:01,420 Just a couple hundred bucks and uh, open source software and, and you can do this. 92 00:13:02,460 --> 00:13:09,520 A basic setup, like a thousand bucks, not that much if you're into kind of uh, professional uh, penetration testing. 93 00:13:09,780 --> 00:13:14,460 Uh, but it requires a week worth of work to get some running. 94 00:13:14,740 --> 00:13:19,440 And if you want to buy the commercial thing then it's, it's really expensive. 95 00:13:21,620 --> 00:13:26,400 Uh, the problem with these, the radio bands are heavily licensed. 96 00:13:26,400 --> 00:13:34,220 They are used uh, quite a lot and that means that kind of all available bands have been bought by someone. 97 00:13:34,260 --> 00:13:37,440 Uh, so it's illegal to run without a Faraday cage. 98 00:13:37,440 --> 00:13:51,060 So you need to have a kind of pouch uh, that you put your radio in and your device in and you have to kind of uh, be careful not to leak the thing because someone will find you and uh, come find you. 99 00:13:51,220 --> 00:13:54,180 Some of the frequency bands can be licensed. 100 00:13:54,440 --> 00:14:05,740 Uh, some countries have unlicensed bands but then you're limited into that one band or uh, that one physical location where you are running this. 101 00:14:06,520 --> 00:14:16,880 So if you're into this, there's the Libra Cellular, they have good instructions how to do this, but I have something better for you. 102 00:14:19,230 --> 00:14:22,770 So let's go back to the 4G mobile network. 103 00:14:23,050 --> 00:14:31,710 We have our mobile device, it talks to the cell tower and then there's the authentication and some other stuff. 104 00:14:32,030 --> 00:14:35,070 But what exactly is that other stuff? 105 00:14:37,210 --> 00:14:41,290 Like I said, the device is authenticated with SIM card, but it's not authenticated with SIM cards. 106 00:14:41,690 --> 00:14:47,350 And then there's some kind of uh, packet filtering uh, going on. 107 00:14:47,490 --> 00:14:56,430 There is this thing called lawful interception that uh, kind of means that your traffic uh, can be inspected by the authorities. 108 00:14:56,710 --> 00:15:00,810 Uh, and I think if it can be inspected then it most likely is. 109 00:15:00,990 --> 00:15:04,710 Um, but yeah. 110 00:15:04,710 --> 00:15:07,690 Other things that it does is policy enforcement. 111 00:15:07,690 --> 00:15:16,870 So basically it means uh, if you buy a slow speed subscription it will make sure that you won't uh, get good speeds. 112 00:15:16,990 --> 00:15:24,650 They calculate the billing so if you have a kind of per megabyte subscription then they calculate the megabytes. 113 00:15:25,730 --> 00:15:28,290 Then they route the packets. 114 00:15:28,290 --> 00:15:34,870 So there might be some kind of ISP internal things like uh, DNS servers. 115 00:15:34,870 --> 00:15:38,290 So some of the things might not go to the internet at all. 116 00:15:38,490 --> 00:15:46,790 Um, so they might go to kind of uh, internal uh, DNS service or, or something else. 117 00:15:47,990 --> 00:15:54,330 But um, also the packets can be routed internally in different ways. 118 00:15:54,330 --> 00:15:58,570 So we have these things uh, called APNs. 119 00:15:58,590 --> 00:16:08,770 Uh, which basically mean that um, how to uh, route your packets uh, inside the ISP. 120 00:16:08,770 --> 00:16:17,450 So this is something that if you're old you know what these are because you've kind of gotten a new SIM card you put it in and it doesn't work. 121 00:16:17,510 --> 00:16:20,930 And then you need to go to these and then you need to type something. 122 00:16:21,170 --> 00:16:24,690 But nowadays you might not even uh, know that these exist. 123 00:16:24,690 --> 00:16:29,130 So, and if you need to type something you just type in internet and then you get to the internet. 124 00:16:30,570 --> 00:16:38,050 Uh, these are actually used uh, so you might have some kind of uh, restricted internet or something. 125 00:16:38,050 --> 00:16:54,090 So uh, some ISP is um, uh, offer some kind of child safe things so they do more, more things uh, uh, or some kind of uh, at some point you can kind of get more speed if you, from some, certain ISP. 126 00:16:54,090 --> 00:17:00,870 So if you don't use the internet but you use something else then it's faster because there's less people there or, or something like that. 127 00:17:00,870 --> 00:17:07,150 But usually just um, you use what the, comes with the subscription. 128 00:17:07,550 --> 00:17:13,670 So these uh, a big change nowadays that these are pushed usually through the network to your device. 129 00:17:14,070 --> 00:17:23,030 So when you connect and you don't have an APN, the modem asks the network that hey, like do you have something for me and then it's automatically set up. 130 00:17:24,250 --> 00:17:32,830 You can change these uh, configure them manually on the device um, but it might not be respected by the ISP. 131 00:17:32,830 --> 00:17:39,170 So it basically just tells the ISP, hey this is what I want, but it can of course offer you whatever it wants. 132 00:17:42,530 --> 00:17:47,590 So there is this uh, thing called private APN. 133 00:17:47,970 --> 00:17:54,470 So um, something that uh, you can kind of buy as a service. 134 00:17:54,470 --> 00:18:02,070 So if you run uh, big fleets of IOT devices, you might want uh, to buy this uh, from an ISP. 135 00:18:02,070 --> 00:18:17,710 So they will set you up with a internal network where uh, your devices are connected to and they might not go to the internet at all or there might be some uh, uh, kind of you can run your own server there or uh, something like that. 136 00:18:17,710 --> 00:18:23,370 It's a private network um, and they can be configured uh, however. 137 00:18:24,450 --> 00:18:37,330 So routing, filtering, everything can be configured and direct connection between the devices are kind of at least uh, you can configure them to be allowed. 138 00:18:37,330 --> 00:18:48,830 So this is a big difference to normal uh, APNs that you cannot really do device to device connections, but you just have to go through the internet. 139 00:18:50,270 --> 00:19:10,810 These also by default usually they don't filter the traffic, so it's um, sometimes the ISPs don't really like some kind of uh, traffic or if you do like port scanning over mobile network, they might shut you down and you don't really know if it uh, works or not. 140 00:19:13,680 --> 00:19:30,860 But so you can also set the private APN to connect you to the internet, so you have access to all these services and then you can get uh, also access the internet uh, maybe even with a static IP that then you can configure your servers to only accept that. 141 00:19:30,860 --> 00:19:39,940 So then, it's used quite heavily in IOT, so that's where I found out that this exists and I, a lot of the customers are using this. 142 00:19:40,360 --> 00:19:58,860 So I kind of figured that this sounds something that kind of, if we want to do this uh, inspect the packets and they use the same things for the lawful interception things, then it might help me kind of uh, look at my traffic. 143 00:19:59,800 --> 00:20:04,380 So, I had this question, could I get a private APN? 144 00:20:04,380 --> 00:20:17,580 Sounds expensive and uh, I went on a journey to send a bunch of emails to different ISPs and uh, I found out that there's a huge variance in price and usability. 145 00:20:18,220 --> 00:20:31,820 So, the first place I went, they had this uh, contact us for pricing and they were like, yeah, we can do this uh, no problem, so you just pay us 3K to get started and then 500 monthly. 146 00:20:31,960 --> 00:20:41,080 So I was like, yeah, this sounds a bit too much for a proof of concept and I might as well just run my own base station in a couple of offices. 147 00:20:42,140 --> 00:20:47,860 Uh, the next place they were also contact us for pricing, but I was pleasantly surprised. 148 00:20:48,440 --> 00:20:53,960 So, they also said that hey, just go to our self service portal and activate it and you're good to go. 149 00:20:53,980 --> 00:20:59,080 And they had a 100 USD setup fee and 150 bucks a month. 150 00:20:59,080 --> 00:21:01,780 So this is completely doable. 151 00:21:02,700 --> 00:21:09,640 There's another place, so they have this uh, $10 setup fee and 75 cents per hour. 152 00:21:09,900 --> 00:21:24,500 So different uh, pricing models, so if you look at the, in the similar schemes here, so the first one, if you kind of no matter how much you use it, it's 250 bucks, but uh, then for a year it's just 2K. 153 00:21:24,620 --> 00:21:33,120 So you can rent it out easily and uh, other one, so 30 bucks a day, 100 bucks a week and 6.5K for a year. 154 00:21:33,120 --> 00:21:44,580 So if you want to kind of uh, do it for longer times, you might want to have this uh, local ISP and then uh, if you just want it for a day, then you can just do it. 155 00:21:44,580 --> 00:21:46,100 You have options for that. 156 00:21:48,300 --> 00:22:02,480 There is a lot of difference in coverage, so some of them are really global, they offer services in all the countries, some are US specific, some are EU specific and even uh, some are just uh, inside your country. 157 00:22:03,000 --> 00:22:13,180 There's also differences in the available data plans, so you still have to pay for your subscription even though you have the private APN because it's kind of a different thing. 158 00:22:14,440 --> 00:22:26,160 Um, some of the like IOT orientated ISPs, they offer a really good pricing that you only pay like 2 bucks a year if you send 100 kilobytes of data a year. 159 00:22:26,160 --> 00:22:37,040 But if you want to uh, look at your phone traffic, I recommend not using these uh, IOT things uh, because it might be uh, costly. 160 00:22:37,100 --> 00:22:51,640 But some of uh, just the regular ISPs offer this, so then you can uh, use your own uh, already kind of own subscriptions and you can have like unlimited data for uh, whatever you are paying for it in your country. 161 00:22:51,880 --> 00:22:55,420 And then you can push that to the private APN. 162 00:22:57,570 --> 00:22:59,590 So how to configure this? 163 00:22:59,590 --> 00:23:04,610 Like once you buy it, first you want to disable the traffic filtering if there is one. 164 00:23:04,870 --> 00:23:13,670 Um, and then disable routing to the internet because we don't want the devices to connect to the internet without us seeing it. 165 00:23:16,050 --> 00:23:22,570 Next, just uh, site to site VPN between the private APN on kind of our cloud server. 166 00:23:22,630 --> 00:23:35,050 We could do a bunch of these things inside the private APN, but I kind of like to be in control uh, of what I do and have like command line access to the server where, where the data is. 167 00:23:35,610 --> 00:23:53,630 But once we have the tunnel, we can set our cloud server as the default gateway for the network and that basically means that all the data from the SIM cards first go to the private APN and then it's just shoved through the VPN tunnel uh, into our cloud server. 168 00:23:53,950 --> 00:24:00,670 And this basically should mean that the SIM card data is now on our cloud server. 169 00:24:02,710 --> 00:24:10,930 And so we need to add some mobile devices to the private APN, so we have our SIM card, we push it into the device. 170 00:24:11,610 --> 00:24:25,970 Uh, some ISPs uh, kind of require you to set some uh, APN settings uh, on the device so they are not pushing anything to the devices or they uh, are roaming and you kind of need to set it up. 171 00:24:26,390 --> 00:24:41,950 Uh, and kind of some of the ISPs that say that you need to set the APN and you need to set it to this, you might be able to just set anything and it works like on some carriers and then some it doesn't and it's, it's weird. 172 00:24:41,950 --> 00:24:45,290 So uh, uh, yeah. 173 00:24:45,850 --> 00:24:59,450 And then there are some ISPs like if you actually run uh, both the kind of ISP and you run the kind of infrastructure and you run the cell towers and everything, then you have more control over things. 174 00:24:59,710 --> 00:25:08,350 So you have this easy check box that just redirect everything uh, to the private APN no matter what settings or anything there's on the device. 175 00:25:08,350 --> 00:25:16,930 So this is uh, something that uh, you want to look for uh, when you are uh, testing devices that don't want to be tested. 176 00:25:17,050 --> 00:25:23,490 Uh, because then you just uh, it thinks it's connected to normal internet but it's connected to you. 177 00:25:24,990 --> 00:25:27,370 And this should be it. 178 00:25:27,370 --> 00:25:29,090 So profit. 179 00:25:29,310 --> 00:25:31,890 Uh, let's see. 180 00:25:31,890 --> 00:25:35,270 So this is a proof of concept for this. 181 00:25:35,270 --> 00:25:46,170 So I talked about there's the IOT device connected to some of uh, some AS uh, ISP and then there's a private APN configured uh, inside the ISP. 182 00:25:46,170 --> 00:25:53,130 We have the IPsec VPN tunnel to our server and then I'm SSH into the server. 183 00:25:53,690 --> 00:25:56,250 So uh, yeah. 184 00:25:56,250 --> 00:25:58,070 Let's see a demo. 185 00:25:59,830 --> 00:26:04,230 So uh, here we have the trusty EPC. 186 00:26:04,250 --> 00:26:08,630 So it's kind of, it doesn't require fancy things. 187 00:26:08,630 --> 00:26:12,130 You just SSH into your uh, server. 188 00:26:12,130 --> 00:26:16,730 My server is called private APN because it's connected to the private APN. 189 00:26:16,870 --> 00:26:19,890 Here we are running a TCP dump. 190 00:26:19,890 --> 00:26:29,010 So the interface is the IPsec VPN tunnel interface and we're looking for traffic from host uh, 10.2.2.2.0.1. 191 00:26:33,560 --> 00:26:34,680 And yeah. 192 00:26:34,680 --> 00:26:39,600 So we have the uh, 2.2.2.0.1 SIM card. 193 00:26:39,600 --> 00:26:51,480 So that has like statically uh, static IP that every time that uh, SIM card is pushed to a device it will get that IP address and here it is uh, booting up. 194 00:26:51,940 --> 00:26:56,040 And I'm really interested to see what it actually does. 195 00:26:57,060 --> 00:26:58,760 So let's see. 196 00:27:01,240 --> 00:27:06,920 Of course takes some time to boot but uh, we have uh, yeah. 197 00:27:06,920 --> 00:27:09,540 And now we see some traffic. 198 00:27:09,540 --> 00:27:12,340 So it wants to know the time. 199 00:27:12,340 --> 00:27:15,340 So not that interesting after all. 200 00:27:15,420 --> 00:27:23,080 But if you leave the SIM card to the device then you will see some uh, unencrypted uh, location data from that. 201 00:27:23,120 --> 00:27:30,440 So if you're running that tracker somewhere, uh, the ISP knows where you're kind of uh, exactly where you're running it. 202 00:27:31,900 --> 00:27:39,640 It's kind of uh, one nice thing about this setup is also you just kind of uh, put the SIM card into something and then you see the traffic. 203 00:27:39,640 --> 00:27:41,900 So here is a modem. 204 00:27:41,940 --> 00:27:48,920 It's used to connect uh, laptops or ethernet based devices uh, to the internet with 4G. 205 00:27:49,120 --> 00:27:51,280 So here it's booting up. 206 00:27:52,200 --> 00:27:55,700 And I like I said, it runs its own operating system. 207 00:27:55,700 --> 00:28:00,820 This is kind of a device but it might also be a chip uh, inside your phone or whatever. 208 00:28:00,820 --> 00:28:03,440 But they run their own operating systems. 209 00:28:04,480 --> 00:28:12,480 So once it's uh, booted up uh, we can see that it has, so it actually says here zero devices connected. 210 00:28:12,480 --> 00:28:15,440 But there's uh, data there. 211 00:28:15,760 --> 00:28:21,820 So it's connecting to netgear.com and uh, a lot of, doing a lot of things. 212 00:28:22,140 --> 00:28:25,460 So it's downloading or checking for software updates. 213 00:28:25,460 --> 00:28:35,420 But luckily we can see that it's uh, 443 so it's DLS traffic and I couldn't use my certmetem tool to hack that so it's, it can be okay, maybe. 214 00:28:35,420 --> 00:28:40,500 But now we at least know that it's, it's not uh, completely bad. 215 00:28:42,630 --> 00:28:47,090 And also, so here, next up we have an iPhone. 216 00:28:48,030 --> 00:28:55,910 So we're booting it up and uh, I have the SIM card tray and you can see me struggle getting it in. 217 00:28:55,910 --> 00:29:01,230 So this is the kind of hardest part of the setup is actually kind of boosting the SIM card inside. 218 00:29:01,310 --> 00:29:14,690 One of our project uh, kind of penetration tester pushed the SIM card and it, we heard this kind of clunk, clunk, clunk, clunk, clunk because it was inside the device and it was a competition and we only had 30 minutes so we had to shake it out of the device. 219 00:29:14,830 --> 00:29:18,190 But yeah, that was one joke and uh, that's all of them. 220 00:29:18,290 --> 00:29:22,410 So if we push the SIM card into the device, you can see it's actually locked. 221 00:29:22,410 --> 00:29:24,610 So this is the first boot before unlock. 222 00:29:24,610 --> 00:29:30,450 We push a SIM card into an iPhone, so let's see what happens. 223 00:29:33,360 --> 00:29:38,140 Yep, so it's connecting to somewhere. 224 00:29:38,140 --> 00:29:45,280 So in here I think it's doing uh, some uh, push notifications so it's uh, getting that. 225 00:29:45,600 --> 00:29:52,960 And I think it uh, won't do that many things before you actually unlock it but we are actually seeing something. 226 00:29:52,960 --> 00:29:59,620 So if you are into hacking locked devices, you might want to look into this. 227 00:30:00,760 --> 00:30:03,740 So yeah, so this is the demo. 228 00:30:03,920 --> 00:30:09,280 That's uh, how easy to actually run it uh, once you've set it up. 229 00:30:21,610 --> 00:30:24,450 Yeah, and let's get back to this question. 230 00:30:24,450 --> 00:30:27,350 So is there traffic over 5G as well? 231 00:30:27,550 --> 00:30:33,070 So of course when I made this slide I was like hey, I will need to kind of uh, check it. 232 00:30:33,170 --> 00:30:41,550 So this is my phone, I connected it to a Wi-Fi, then I pushed the same SIM card into it and this is what I see. 233 00:30:41,690 --> 00:30:46,090 So even though it's connected to Wi-Fi, you will see traffic. 234 00:30:46,270 --> 00:30:49,950 So these are the, I think similar Apple push notifications. 235 00:30:50,510 --> 00:30:58,010 Uh, first when I Googled these IP addresses I went kind of uh, the first match was some weird Russian forum and I got scared. 236 00:30:58,170 --> 00:31:05,370 Um, but turned out it's uh, maybe not some uh, malware on my phone. 237 00:31:08,170 --> 00:31:17,490 But yeah, so there is uh, something that the operating system does so it overrides the Wi-Fi and pushes directly uh, through the 5G. 238 00:31:18,130 --> 00:31:23,470 And if there is some kind of advanced malware then it might also pop up here. 239 00:31:25,870 --> 00:31:37,910 So proof of concept it's kind of uh, kind of uh, yes. 240 00:31:37,910 --> 00:31:45,130 So uh, from kind of moving on from the proof of concept to an actual project that uh, you guys can use. 241 00:31:45,530 --> 00:31:48,910 Uh, so I collaborated with some IOT security experts. 242 00:31:48,910 --> 00:31:54,010 Some of them are here in the room and they have had the same exact problems. 243 00:31:54,130 --> 00:32:17,670 So, how do you, of course they have the problem of how do you kind of uh, look at your mobile traffic and bunch of them were in the face of using their own uh, kind of mobile base stations and uh, software defined radios and kind of trying to use an IOT device that you need to kind of boot up and then you need to press a button. 244 00:32:17,910 --> 00:32:35,330 But once it's inside the bag it's kind of hard to best press the button and uh, then I told about this that hey I, I kind of uh, think this is the way to do it and, and kind of I can see them contemplating kind of uh, years worth of uh, doing all the previous steps. 245 00:32:37,110 --> 00:32:44,270 Um, and yeah some uh, I also heard that they are running similar setup than I do. 246 00:32:44,270 --> 00:32:50,370 Like one person I know that has been running this uh, and a bunch of that haven't. 247 00:32:52,030 --> 00:32:54,410 So of course I'm from Finland. 248 00:32:54,410 --> 00:33:00,570 We have the kind of uh, holy land of uh, network connectivity so of course everything works there. 249 00:33:00,670 --> 00:33:03,530 Uh, it's cheap and uh, stuff like that. 250 00:33:03,530 --> 00:33:07,470 So I wanted to look at the US where it's uh, the opposite. 251 00:33:07,470 --> 00:33:09,210 There's, it's not cheap. 252 00:33:09,290 --> 00:33:13,090 Um, and also EU and global stuff. 253 00:33:13,090 --> 00:33:28,670 So it turns out a lot of ISPs and companies offer affordable private APNs and um, they a little bit different but uh, I created this uh, GitHub page so it's online now. 254 00:33:28,710 --> 00:33:34,910 And you can see this uh, to get uh, some up to date things. 255 00:33:34,910 --> 00:33:37,990 So they are, there are global ISPs there. 256 00:33:37,990 --> 00:33:45,110 So one of the ten bucks uh, to set up and twenty bucks per day thing works everywhere. 257 00:33:45,230 --> 00:33:52,670 Uh, if you've seen me uh, before today I've kind of given out bunch of SIM cards so you can try this out. 258 00:33:53,010 --> 00:33:57,470 But uh, there would, should be something there that works in your country. 259 00:33:57,890 --> 00:34:06,510 Uh, but of course the global IOT providers might be too expensive for your use case if you want to use more data. 260 00:34:06,830 --> 00:34:23,510 Uh, and if you want to use kind of your existing uh, mobile plans or you want to use your local ISP, you really should kind of show them this GitHub page and ask them hey, do you want to go there on the GitHub page so people will buy your services and uh, 261 00:34:23,510 --> 00:34:26,030 figure out if you can make it work. 262 00:34:26,330 --> 00:34:30,210 Uh, if they have to do it manually it will be expensive. 263 00:34:30,470 --> 00:34:37,770 So uh, usually you want to look for something that has a, a self service portal that works. 264 00:34:37,990 --> 00:34:39,010 But yeah. 265 00:34:40,110 --> 00:34:43,950 So this is my kind of uh, full set up. 266 00:34:43,950 --> 00:34:45,050 And this is the GitHub that I run. 267 00:34:45,250 --> 00:34:55,990 So I have uh, multiple IOT devices connecting to an ISP and so a global ISP one of the devices is in Helsinki in uh, in my home. 268 00:34:55,990 --> 00:34:57,610 One is here in Las Vegas. 269 00:34:57,710 --> 00:35:04,590 And they are kind of in the opposite sides of the world but they still connect to the same ISP. 270 00:35:04,910 --> 00:35:07,550 And they do the ISP stuff. 271 00:35:07,550 --> 00:35:09,650 Go into the private APN. 272 00:35:09,650 --> 00:35:15,050 Uh, different uh, ISPs have different kind of uh, different tunnels. 273 00:35:15,250 --> 00:35:18,630 But uh, they end up in my, my server. 274 00:35:18,770 --> 00:35:28,930 There I run WireGuard but you can also set up uh, another type of VPN uh, for your pentesting like uh, workstations. 275 00:35:28,930 --> 00:35:33,290 So here I have on the right like a Kali Linux machine in Helsinki. 276 00:35:33,390 --> 00:35:37,990 Uh, some of my colleagues maybe be in Stockholm and they have the same. 277 00:35:38,050 --> 00:35:41,930 And uh, with this uh, VPN server on the cloud server. 278 00:35:41,930 --> 00:35:43,890 So there's like one to one mapping. 279 00:35:43,890 --> 00:35:52,630 So IOT like SIM card one goes to VPN profile one and the VPN profile one is opened uh, in Helsinki. 280 00:35:52,630 --> 00:35:55,710 And then the traffic just magically goes there. 281 00:35:55,730 --> 00:36:02,050 So once you set up this uh, if you are working in a company, your colleagues will love you. 282 00:36:02,050 --> 00:36:03,650 You just hand them out SIM cards. 283 00:36:03,650 --> 00:36:07,130 You hand them out uh, uh, VPN profiles. 284 00:36:07,130 --> 00:36:09,010 And then like they're hey, what's this? 285 00:36:09,010 --> 00:36:16,130 And you just hey, push that in there and then just double click that and then you see the data and everyone's amazed and you're a hero. 286 00:36:16,710 --> 00:36:19,550 So uh, it's that easy. 287 00:36:19,550 --> 00:36:26,850 But you can of course don't have to have this fancy set up if you just want to do everything on the cloud server you can do it there. 288 00:36:29,330 --> 00:36:36,710 Um, also like I said on the GitHub you have um, a list of uh, private APNs. 289 00:36:36,710 --> 00:36:42,850 The list is quite small because I use things that I found that work in Finland. 290 00:36:42,950 --> 00:36:46,130 When I flew here I tested uh, London. 291 00:36:46,130 --> 00:36:48,270 So in London this works great. 292 00:36:48,270 --> 00:36:57,650 Uh, here uh, I run into the problem that the modem I was using to kind of uh, figure out if they work in different ways. 293 00:36:57,950 --> 00:37:00,350 Uh, doesn't work in the U.S. 294 00:37:00,350 --> 00:37:02,170 because I noticed that the U.S. 295 00:37:02,170 --> 00:37:06,190 has different mobile network stuff for some reason. 296 00:37:06,810 --> 00:37:11,550 But um, I tested that these work well on my phone here. 297 00:37:11,550 --> 00:37:15,570 So I just push it into my phone and I can see the traffic uh, on the server. 298 00:37:15,790 --> 00:37:20,250 So confirmed to work well um, everywhere in the world. 299 00:37:23,030 --> 00:37:30,650 But yeah, so let's wrap up and um, go back to the kind of why do, would you want to do this? 300 00:37:30,750 --> 00:37:32,950 So curiosity and privacy. 301 00:37:34,030 --> 00:37:39,010 Fifty bucks, couple days of tinkering on a device, like that's a good deal. 302 00:37:39,390 --> 00:37:46,170 Uh, it's actually the fifteen bucks is like one evening of like six hours of of uh, tinkering with this. 303 00:37:46,370 --> 00:37:48,450 So not, not much. 304 00:37:49,470 --> 00:37:58,890 And even if you use this uh, if you want to use it for a longer time you might want to look into uh, other options that are kind of uh, less expensive in long term. 305 00:37:58,890 --> 00:38:10,430 But hackerspaces or even tiniest penetration testing companies, like two K a year should be a no brainer to uh, if you really want to look at the traffic. 306 00:38:11,690 --> 00:38:13,250 Offensive security. 307 00:38:13,450 --> 00:38:26,310 So if you do penetration testing on IoT and you say to your customers that hey we kind of look at the device and look where it's connected to, you really need some kind of setup to do this. 308 00:38:26,310 --> 00:38:37,410 And two thousand a year versus an illegal setup that's kind of, you need to have your best engineers work a week on, so that's really expensive as well. 309 00:38:39,550 --> 00:38:47,570 These devices, especially in industrial IoT, uh, they're everywhere and people don't really look at their traffic that much. 310 00:38:47,570 --> 00:38:55,790 So there's just a handful of companies that actually I know that do this, but now anyone can do this. 311 00:38:57,590 --> 00:39:11,590 And like I said, maybe some new attack vectors for high security devices that if you can push a SIM card in and it, you get the data then you can also uh, send some uh, malicious things uh, to it. 312 00:39:13,170 --> 00:39:15,150 Defensive point of view. 313 00:39:15,470 --> 00:39:23,790 So these private APNs, uh, like I connect it to my server, but you can connect the IPsec tunnel to your existing firewall. 314 00:39:23,790 --> 00:39:31,190 So if you are running some kind of uh, firewall, then uh, you can just connect this to it. 315 00:39:31,190 --> 00:39:40,790 Um, kind of the first devices might kind of uh, cost something and then you, it costs more to add devices but the cost goes down uh, gradually. 316 00:39:40,790 --> 00:39:47,290 So if you have thousands of devices, it will be still uh, quite uh, inexpensive to do. 317 00:39:48,590 --> 00:39:56,130 And the mobile phone malware infections, they might not communicate at all over Wi-Fi or VPN. 318 00:39:56,330 --> 00:40:14,310 So there was this uh, hack, some kind of some triangles or something and uh, they said that when they noticed the hack, uh, they were uh, scanning there or like they were looking at their Wi-Fi traffic at their office and they noticed that some of the phones were sending things to some uh, 319 00:40:14,310 --> 00:40:15,430 C2 servers. 320 00:40:15,630 --> 00:40:25,510 And they also analyzed the malware and the malware had these properties that it can detect if it's been uh, run over Wi-Fi or VPN and not do it. 321 00:40:25,510 --> 00:40:36,070 So it might have been misconfigured to allow traffic over Wi-Fi because why would you, people are looking at the Wi-Fi, why would you do your malicious stuff over that? 322 00:40:36,070 --> 00:40:41,970 So it might have just been a misconfigured malware that they happened to find through their Wi-Fi. 323 00:40:41,970 --> 00:40:54,710 So I, my thing that the advanced malware that sometimes are not that advanced uh, might get better at this or they might already be doing this and that was just one uh, slip up. 324 00:40:55,730 --> 00:41:03,930 Uh, so yeah, if you're targeted by uh, advanced malware, you might want to do kind of, this kind of thing. 325 00:41:05,870 --> 00:41:19,450 But you can find the project details, you can uh, snap a uh, photo of this to remember it and you can find me here at DEF CON or the internet and uh, thank you for your uh, coming here.