WEBVTT

00:00.000 --> 00:01.900
So my name is Aapo.

00:02.080 --> 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.

00:15.880 --> 00:19.560
I work a lot on cryptography and network protocols.

00:19.880 --> 00:22.100
Outside of that, bug bounty.

00:22.100 --> 00:26.760
So if you run a hardware bug bounty program, you know where to find me.

00:26.840 --> 00:29.760
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 --> 00:59.560
So that should be quite straightforward.

00:59.560 --> 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.

01:13.680 --> 01:21.020
And then on our laptop in the ethernet interface, we will see any traffic it's trying to send.

01:22.760 --> 01:24.960
We can do the same with Wi-Fi.

01:24.960 --> 01:29.060
So if we have our access point, the device connected to it.

01:29.060 --> 01:34.860
And then again, we will see the traffic on the ethernet interface.

01:37.120 --> 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.

01:47.820 --> 01:51.700
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:03.540
So today we will be talking about these kind of devices.

02:03.620 --> 02:09.640
So some kind of 4G connection on this one and how that works.

02:09.640 --> 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.

02:16.420 --> 02:21.720
But the problem is how do we actually see the data?

02:22.200 --> 02:26.320
So this is kind of the topic of today.

02:27.980 --> 02:30.540
There are also different kind of devices.

02:30.540 --> 02:33.080
They might have multiple ways of connecting to the internet.

02:33.080 --> 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.

02:41.840 --> 02:43.060
Or can I?

02:43.280 --> 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.

02:52.120 --> 02:55.940
So question is, is there traffic over 5G as well?

02:56.860 --> 03:02.540
So it might be something built in, there might be something malicious.

03:02.900 --> 03:07.320
So let's talk about that.

03:09.520 --> 03:13.060
So why would you want to look into mobile network traffic?

03:13.640 --> 03:20.920
If you're just a tinkerer, if you're at Defcon here or watching this video, then you might be curious.

03:21.240 --> 03:23.340
You might care about your privacy.

03:23.500 --> 03:27.640
You might think, where do my devices talk to?

03:27.900 --> 03:34.020
Is there some kind of unencrypted private information flying through the air?

03:34.020 --> 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.

03:44.530 --> 03:50.790
From offensive security point of view, we might think that can we tamper with the traffic and find vulnerabilities?

03:51.390 --> 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.

04:05.530 --> 04:08.490
You might want to look at the traffic.

04:08.490 --> 04:15.250
Can you say we've kind of penetration tested this if you haven't looked at the mobile traffic?

04:17.820 --> 04:25.520
From defensive point of view, you might want to detect malicious traffic or just filter some unwanted things.

04:25.800 --> 04:29.400
You can do this in most cases on the device.

04:29.400 --> 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.

04:37.040 --> 04:44.240
But if you have some advanced malware on your phone, it might not respect the on-device protections.

04:44.240 --> 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.

04:56.100 --> 05:02.420
So we might not want to do the testing on the device, we want to do it outside.

05:06.530 --> 05:09.670
So what are these mobile networks?

05:10.370 --> 05:15.190
Sometimes called like cellular networks and these come in different flavors.

05:15.350 --> 05:19.530
There is 2G, 3G, 4G, 5G, etc.

05:19.910 --> 05:26.090
Some older ones, but I think these are the currently used.

05:26.090 --> 05:36.730
And in 4G and in 5G, there are these slightly different like NB-IoT is a special version of LTE.

05:37.090 --> 05:50.250
But the main thing is that you have different frequency bands and special radios that can talk with these protocols.

05:52.030 --> 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.

06:03.870 --> 06:09.590
So if you have civilization, you most likely have a mobile network there.

06:10.310 --> 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.

06:30.450 --> 06:36.870
You can kind of send text messages or phone calls, but nobody really does that anymore.

06:36.870 --> 06:44.310
So it's mainly used to route IP traffic from your device to the internet or wherever you want to go.

06:46.390 --> 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.

07:00.630 --> 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.

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: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.

07:47.610 --> 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.

08:07.430 --> 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.

08:22.980 --> 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.

08:50.920 --> 08:54.540
So how do we intercept this mobile network traffic?

08:54.540 --> 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.

09:03.860 --> 09:08.680
So of course the easiest way to intercept traffic is on the device.

09:08.840 --> 09:15.920
So just log in, run TCP dump, and you will see the network connections.

09:16.060 --> 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.

09:28.080 --> 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.

09:38.820 --> 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.

09:48.100 --> 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.

10:06.020 --> 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.

10:24.680 --> 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.

10:32.940 --> 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.

10:41.100 --> 10:45.040
And we have found a lot of vulnerabilities in the modems.

10:47.220 --> 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.

11:07.060 --> 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.

11:23.620 --> 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.

11:34.240 --> 11:36.840
So this is something that we've already done.

11:36.880 --> 11:40.180
Um, in some cases it's quite simple.

11:40.180 --> 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.

11:50.520 --> 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.

12:07.660 --> 12:12.200
And we cannot see the modem's own traffic, uh, here as well.

12:15.180 --> 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.

12:25.880 --> 12:30.820
So if you want to play around with this, you can look at that and uh, try it out.

12:33.300 --> 12:39.720
The next thing I tried uh, to run my own base station because I want to see the modem traffic.

12:39.720 --> 12:45.680
I figured out just like I have my Wi-Fi access point, I'll do a 4G access point.

12:46.440 --> 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.

12:56.660 --> 13:01.420
Just a couple hundred bucks and uh, open source software and, and you can do this.

13:02.460 --> 13:09.520
A basic setup, like a thousand bucks, not that much if you're into kind of uh, professional uh, penetration testing.

13:09.780 --> 13:14.460
Uh, but it requires a week worth of work to get some running.

13:14.740 --> 13:19.440
And if you want to buy the commercial thing then it's, it's really expensive.

13:21.620 --> 13:26.400
Uh, the problem with these, the radio bands are heavily licensed.

13:26.400 --> 13:34.220
They are used uh, quite a lot and that means that kind of all available bands have been bought by someone.

13:34.260 --> 13:37.440
Uh, so it's illegal to run without a Faraday cage.

13:37.440 --> 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.

13:51.220 --> 13:54.180
Some of the frequency bands can be licensed.

13:54.440 --> 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.

14:06.520 --> 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.

14:19.230 --> 14:22.770
So let's go back to the 4G mobile network.

14:23.050 --> 14:31.710
We have our mobile device, it talks to the cell tower and then there's the authentication and some other stuff.

14:32.030 --> 14:35.070
But what exactly is that other stuff?

14:37.210 --> 14:41.290
Like I said, the device is authenticated with SIM card, but it's not authenticated with SIM cards.

14:41.690 --> 14:47.350
And then there's some kind of uh, packet filtering uh, going on.

14:47.490 --> 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.

14:56.710 --> 15:00.810
Uh, and I think if it can be inspected then it most likely is.

15:00.990 --> 15:04.710
Um, but yeah.

15:04.710 --> 15:07.690
Other things that it does is policy enforcement.

15:07.690 --> 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.

15:16.990 --> 15:24.650
They calculate the billing so if you have a kind of per megabyte subscription then they calculate the megabytes.

15:25.730 --> 15:28.290
Then they route the packets.

15:28.290 --> 15:34.870
So there might be some kind of ISP internal things like uh, DNS servers.

15:34.870 --> 15:38.290
So some of the things might not go to the internet at all.

15:38.490 --> 15:46.790
Um, so they might go to kind of uh, internal uh, DNS service or, or something else.

15:47.990 --> 15:54.330
But um, also the packets can be routed internally in different ways.

15:54.330 --> 15:58.570
So we have these things uh, called APNs.

15:58.590 --> 16:08.770
Uh, which basically mean that um, how to uh, route your packets uh, inside the ISP.

16:08.770 --> 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.

16:17.510 --> 16:20.930
And then you need to go to these and then you need to type something.

16:21.170 --> 16:24.690
But nowadays you might not even uh, know that these exist.

16:24.690 --> 16:29.130
So, and if you need to type something you just type in internet and then you get to the internet.

16:30.570 --> 16:38.050
Uh, these are actually used uh, so you might have some kind of uh, restricted internet or something.

16:38.050 --> 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.

16:54.090 --> 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.

17:00.870 --> 17:07.150
But usually just um, you use what the, comes with the subscription.

17:07.550 --> 17:13.670
So these uh, a big change nowadays that these are pushed usually through the network to your device.

17:14.070 --> 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.

17:24.250 --> 17:32.830
You can change these uh, configure them manually on the device um, but it might not be respected by the ISP.

17:32.830 --> 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.

17:42.530 --> 17:47.590
So there is this uh, thing called private APN.

17:47.970 --> 17:54.470
So um, something that uh, you can kind of buy as a service.

17:54.470 --> 18:02.070
So if you run uh, big fleets of IOT devices, you might want uh, to buy this uh, from an ISP.

18:02.070 --> 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.

18:17.710 --> 18:23.370
It's a private network um, and they can be configured uh, however.

18:24.450 --> 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.

18:37.330 --> 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.

18:50.270 --> 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.

19:13.680 --> 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.

19:30.860 --> 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.

19:40.360 --> 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.

19:59.800 --> 20:04.380
So, I had this question, could I get a private APN?

20:04.380 --> 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.

20:18.220 --> 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.

20:31.960 --> 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.

20:42.140 --> 20:47.860
Uh, the next place they were also contact us for pricing, but I was pleasantly surprised.

20:48.440 --> 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.

20:53.980 --> 20:59.080
And they had a 100 USD setup fee and 150 bucks a month.

20:59.080 --> 21:01.780
So this is completely doable.

21:02.700 --> 21:09.640
There's another place, so they have this uh, $10 setup fee and 75 cents per hour.

21:09.900 --> 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.

21:24.620 --> 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.

21:33.120 --> 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.

21:44.580 --> 21:46.100
You have options for that.

21:48.300 --> 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.

22:03.000 --> 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.

22:14.440 --> 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.

22:26.160 --> 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.

22:37.100 --> 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.

22:51.880 --> 22:55.420
And then you can push that to the private APN.

22:57.570 --> 22:59.590
So how to configure this?

22:59.590 --> 23:04.610
Like once you buy it, first you want to disable the traffic filtering if there is one.

23:04.870 --> 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.

23:16.050 --> 23:22.570
Next, just uh, site to site VPN between the private APN on kind of our cloud server.

23:22.630 --> 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.

23:35.610 --> 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.

23:53.950 --> 24:00.670
And this basically should mean that the SIM card data is now on our cloud server.

24:02.710 --> 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.

24:11.610 --> 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.

24:26.390 --> 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.

24:41.950 --> 24:45.290
So uh, uh, yeah.

24:45.850 --> 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.

24:59.710 --> 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.

25:08.350 --> 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.

25:17.050 --> 25:23.490
Uh, because then you just uh, it thinks it's connected to normal internet but it's connected to you.

25:24.990 --> 25:27.370
And this should be it.

25:27.370 --> 25:29.090
So profit.

25:29.310 --> 25:31.890
Uh, let's see.

25:31.890 --> 25:35.270
So this is a proof of concept for this.

25:35.270 --> 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.

25:46.170 --> 25:53.130
We have the IPsec VPN tunnel to our server and then I'm SSH into the server.

25:53.690 --> 25:56.250
So uh, yeah.

25:56.250 --> 25:58.070
Let's see a demo.

25:59.830 --> 26:04.230
So uh, here we have the trusty EPC.

26:04.250 --> 26:08.630
So it's kind of, it doesn't require fancy things.

26:08.630 --> 26:12.130
You just SSH into your uh, server.

26:12.130 --> 26:16.730
My server is called private APN because it's connected to the private APN.

26:16.870 --> 26:19.890
Here we are running a TCP dump.

26:19.890 --> 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.

26:33.560 --> 26:34.680
And yeah.

26:34.680 --> 26:39.600
So we have the uh, 2.2.2.0.1 SIM card.

26:39.600 --> 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.

26:51.940 --> 26:56.040
And I'm really interested to see what it actually does.

26:57.060 --> 26:58.760
So let's see.

27:01.240 --> 27:06.920
Of course takes some time to boot but uh, we have uh, yeah.

27:06.920 --> 27:09.540
And now we see some traffic.

27:09.540 --> 27:12.340
So it wants to know the time.

27:12.340 --> 27:15.340
So not that interesting after all.

27:15.420 --> 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.

27:23.120 --> 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.

27:31.900 --> 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.

27:39.640 --> 27:41.900
So here is a modem.

27:41.940 --> 27:48.920
It's used to connect uh, laptops or ethernet based devices uh, to the internet with 4G.

27:49.120 --> 27:51.280
So here it's booting up.

27:52.200 --> 27:55.700
And I like I said, it runs its own operating system.

27:55.700 --> 28:00.820
This is kind of a device but it might also be a chip uh, inside your phone or whatever.

28:00.820 --> 28:03.440
But they run their own operating systems.

28:04.480 --> 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.

28:12.480 --> 28:15.440
But there's uh, data there.

28:15.760 --> 28:21.820
So it's connecting to netgear.com and uh, a lot of, doing a lot of things.

28:22.140 --> 28:25.460
So it's downloading or checking for software updates.

28:25.460 --> 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.

28:35.420 --> 28:40.500
But now we at least know that it's, it's not uh, completely bad.

28:42.630 --> 28:47.090
And also, so here, next up we have an iPhone.

28:48.030 --> 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.

28:55.910 --> 29:01.230
So this is the kind of hardest part of the setup is actually kind of boosting the SIM card inside.

29:01.310 --> 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.

29:14.830 --> 29:18.190
But yeah, that was one joke and uh, that's all of them.

29:18.290 --> 29:22.410
So if we push the SIM card into the device, you can see it's actually locked.

29:22.410 --> 29:24.610
So this is the first boot before unlock.

29:24.610 --> 29:30.450
We push a SIM card into an iPhone, so let's see what happens.

29:33.360 --> 29:38.140
Yep, so it's connecting to somewhere.

29:38.140 --> 29:45.280
So in here I think it's doing uh, some uh, push notifications so it's uh, getting that.

29:45.600 --> 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.

29:52.960 --> 29:59.620
So if you are into hacking locked devices, you might want to look into this.

30:00.760 --> 30:03.740
So yeah, so this is the demo.

30:03.920 --> 30:09.280
That's uh, how easy to actually run it uh, once you've set it up.

30:21.610 --> 30:24.450
Yeah, and let's get back to this question.

30:24.450 --> 30:27.350
So is there traffic over 5G as well?

30:27.550 --> 30:33.070
So of course when I made this slide I was like hey, I will need to kind of uh, check it.

30:33.170 --> 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.

30:41.690 --> 30:46.090
So even though it's connected to Wi-Fi, you will see traffic.

30:46.270 --> 30:49.950
So these are the, I think similar Apple push notifications.

30:50.510 --> 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.

30:58.170 --> 31:05.370
Um, but turned out it's uh, maybe not some uh, malware on my phone.

31:08.170 --> 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.

31:18.130 --> 31:23.470
And if there is some kind of advanced malware then it might also pop up here.

31:25.870 --> 31:37.910
So proof of concept it's kind of uh, kind of uh, yes.

31:37.910 --> 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.

31:45.530 --> 31:48.910
Uh, so I collaborated with some IOT security experts.

31:48.910 --> 31:54.010
Some of them are here in the room and they have had the same exact problems.

31:54.130 --> 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.

32:17.910 --> 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.

32:37.110 --> 32:44.270
Um, and yeah some uh, I also heard that they are running similar setup than I do.

32:44.270 --> 32:50.370
Like one person I know that has been running this uh, and a bunch of that haven't.

32:52.030 --> 32:54.410
So of course I'm from Finland.

32:54.410 --> 33:00.570
We have the kind of uh, holy land of uh, network connectivity so of course everything works there.

33:00.670 --> 33:03.530
Uh, it's cheap and uh, stuff like that.

33:03.530 --> 33:07.470
So I wanted to look at the US where it's uh, the opposite.

33:07.470 --> 33:09.210
There's, it's not cheap.

33:09.290 --> 33:13.090
Um, and also EU and global stuff.

33:13.090 --> 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.

33:28.710 --> 33:34.910
And you can see this uh, to get uh, some up to date things.

33:34.910 --> 33:37.990
So they are, there are global ISPs there.

33:37.990 --> 33:45.110
So one of the ten bucks uh, to set up and twenty bucks per day thing works everywhere.

33:45.230 --> 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.

33:53.010 --> 33:57.470
But uh, there would, should be something there that works in your country.

33:57.890 --> 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.

34:06.830 --> 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,

34:23.510 --> 34:26.030
figure out if you can make it work.

34:26.330 --> 34:30.210
Uh, if they have to do it manually it will be expensive.

34:30.470 --> 34:37.770
So uh, usually you want to look for something that has a, a self service portal that works.

34:37.990 --> 34:39.010
But yeah.

34:40.110 --> 34:43.950
So this is my kind of uh, full set up.

34:43.950 --> 34:45.050
And this is the GitHub that I run.

34:45.250 --> 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.

34:55.990 --> 34:57.610
One is here in Las Vegas.

34:57.710 --> 35:04.590
And they are kind of in the opposite sides of the world but they still connect to the same ISP.

35:04.910 --> 35:07.550
And they do the ISP stuff.

35:07.550 --> 35:09.650
Go into the private APN.

35:09.650 --> 35:15.050
Uh, different uh, ISPs have different kind of uh, different tunnels.

35:15.250 --> 35:18.630
But uh, they end up in my, my server.

35:18.770 --> 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.

35:28.930 --> 35:33.290
So here I have on the right like a Kali Linux machine in Helsinki.

35:33.390 --> 35:37.990
Uh, some of my colleagues maybe be in Stockholm and they have the same.

35:38.050 --> 35:41.930
And uh, with this uh, VPN server on the cloud server.

35:41.930 --> 35:43.890
So there's like one to one mapping.

35:43.890 --> 35:52.630
So IOT like SIM card one goes to VPN profile one and the VPN profile one is opened uh, in Helsinki.

35:52.630 --> 35:55.710
And then the traffic just magically goes there.

35:55.730 --> 36:02.050
So once you set up this uh, if you are working in a company, your colleagues will love you.

36:02.050 --> 36:03.650
You just hand them out SIM cards.

36:03.650 --> 36:07.130
You hand them out uh, uh, VPN profiles.

36:07.130 --> 36:09.010
And then like they're hey, what's this?

36:09.010 --> 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.

36:16.710 --> 36:19.550
So uh, it's that easy.

36:19.550 --> 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.

36:29.330 --> 36:36.710
Um, also like I said on the GitHub you have um, a list of uh, private APNs.

36:36.710 --> 36:42.850
The list is quite small because I use things that I found that work in Finland.

36:42.950 --> 36:46.130
When I flew here I tested uh, London.

36:46.130 --> 36:48.270
So in London this works great.

36:48.270 --> 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.

36:57.950 --> 37:00.350
Uh, doesn't work in the U.S.

37:00.350 --> 37:02.170
because I noticed that the U.S.

37:02.170 --> 37:06.190
has different mobile network stuff for some reason.

37:06.810 --> 37:11.550
But um, I tested that these work well on my phone here.

37:11.550 --> 37:15.570
So I just push it into my phone and I can see the traffic uh, on the server.

37:15.790 --> 37:20.250
So confirmed to work well um, everywhere in the world.

37:23.030 --> 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?

37:30.750 --> 37:32.950
So curiosity and privacy.

37:34.030 --> 37:39.010
Fifty bucks, couple days of tinkering on a device, like that's a good deal.

37:39.390 --> 37:46.170
Uh, it's actually the fifteen bucks is like one evening of like six hours of of uh, tinkering with this.

37:46.370 --> 37:48.450
So not, not much.

37:49.470 --> 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.

37:58.890 --> 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.

38:11.690 --> 38:13.250
Offensive security.

38:13.450 --> 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.

38:26.310 --> 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.

38:39.550 --> 38:47.570
These devices, especially in industrial IoT, uh, they're everywhere and people don't really look at their traffic that much.

38:47.570 --> 38:55.790
So there's just a handful of companies that actually I know that do this, but now anyone can do this.

38:57.590 --> 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.

39:13.170 --> 39:15.150
Defensive point of view.

39:15.470 --> 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.

39:23.790 --> 39:31.190
So if you are running some kind of uh, firewall, then uh, you can just connect this to it.

39:31.190 --> 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.

39:40.790 --> 39:47.290
So if you have thousands of devices, it will be still uh, quite uh, inexpensive to do.

39:48.590 --> 39:56.130
And the mobile phone malware infections, they might not communicate at all over Wi-Fi or VPN.

39:56.330 --> 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,

40:14.310 --> 40:15.430
C2 servers.

40:15.630 --> 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.

40:25.510 --> 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?

40:36.070 --> 40:41.970
So it might have just been a misconfigured malware that they happened to find through their Wi-Fi.

40:41.970 --> 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.

40:55.730 --> 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.

41:05.870 --> 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.

