Oh, hi everyone. Hi. Um, thanks for showing up. Uh, this talk is called, uh, what did I call it? Reverse Engineering 4G Hotspots for Fun, Bugs and Net Financial Loss. Um, I'm a, uh, senior work avoider at Pentest Partners. Um, I'm also do hardware or embedded work sometimes. Um, no one cares who the speaker is. Let's go on. So the structure of the talk today looks like this. Um, I'm talking about, uh, why I'm talking about cellular routers. Then I'm gonna talk about the sort of attack surface you might see on them. Uh, then I've got two devices to look at. Um, one made by a Chinese company, one made by a US company to sort of avoid getting everyone all overexcited about it. Um, then I'm gonna go over what was fun about each one of them and the sort of bugs that I found in them as well. Um, then I'm probably just gonna complain until my time's up. 5G is, uh, apparently imminent. Uh, I've heard there's, uh, it's meant to be operational in some areas. I'm not entirely convinced by that yet. Um, it's meant to be very quick. Uh, consumers and business users are probably gonna start using it more for their daily TCP IP activities. Um, and so there'll be more modems, dongles, and, and other things. Um, routers out there in the world. Um there's not been that much public scrutiny on non-phone consumer cellular gear uh so far. Which is sort of weird because uh there's not that many vendors or OEMs actually doing uh cellular kit from scratch. Um cause there's only a few OEMs there's lots of code reuse uh so the label on the box doesn't necessarily mean that the contents of the box are actually made by that vendor. Um so and also code on these sort of consumer devices ends up on very similar industrial device devices as well. Uh cellular routers are sort of interesting. Um they're somewhere between uh phones and traditional routers. Um and cause they're just embedded computers there's probably going to be lots of bugs in them as well. Um I would say at this point the bar is still pretty low for finding bugs in these sorts of things. Um not as low as it used to be but it's it's still pretty easy. I'm going to do a review of some of the devices that are out there. Um I'm going to do a review of some of the devices that are out there. Um I'm going to do a really quick cellular network refresher. Uh just to get everyone on the same on the same page. Uh some people think cellular networks are safer than public wifi. It's not necessarily true. Uh devices connect to an APN which is like connecting to any LAN that you don't control. Um some APNs are really well configured some aren't. It totally depends on the APN itself. Um cause you're essentially on a LAN. Uh you're not going to see a lot of cellular connected devices on showdown and things like that. But if you connect to the same LAN you're not going to see a lot of cellular connected devices. And the same APN um you can start to poke around and have a look and see who else is on there. Uh there's a few security measures uh you might find on public or private APNs like client segregation, web filtering, uh IMEI, IMEI, ICCID sort of filtering. Uh it's sort of like any network there's certain security mechanisms they can put in place. Uh we have to take that into account when we're thinking about attacking a cellular device cause we don't really know where it's going to be used and the APN configuration might be really weak. Um so when I'm looking at something like this I have a rough idea of what I'm trying to find. I'm always looking for higher risk issues um actual security bugs um since we're going in with like a pessimistic view of the APN um you have to assume to some extent that you can touch the the WAN interface on the device if there's no client segregation on the APN or something like that. Um so we can't rule out the sort of traditional RCEs um as a vector. Uh you can also think about things like if you're much more worried about uh state level stuff or very very serious actors you might want to worry about compromise like GGSNs or NGCNs or or whatever they use in 5G. Um the these sort of things that handle IP traffic on these APNs. Um so um we also can't rule out cross site request forgery on the router web configuration interface. Uh because if you're connected to a router you're probably looking at stuff in a browser while you're looking at it. Um sometimes there's all other kinds of TCP UDP services running traditionally DNS, UPnP, other obscure proprietary stuff that the vendor makes. Um not all of it's going to get blocked off on the on the WAN side as well. Um they try the same thing these days but but it's not always the case. Uh there's also the possibility of more traditional cellular services like SMS or MMS being exploitable as well. Um there's also lower risk stuff so there's the sort of thing that might get you just a shell if you're connected to something with uh a piece of copper. Um or it might give you some sort of firmware access or something like that. These sorts of things are not necessarily reportable to a vendor but they're really nice if we're looking for bugs on them. Uh or if you want to just mess around with some of the lower level configurations on on the modem itself like trying to change the IMEI to bypass APN security measures. Um which I think is illegal basically everywhere so don't do that. Um you also might want to get like a privileged AT shell to to lock your device to a particular band or something along those lines. Um there's sort of a limit to that in my opinion. Um if you can if you can permanently back door a device in like 10 seconds with access to USB USB port that's that's probably reportable to the vendor and you might want to try and get them to fix that. Whether they do or not is is who knows uh they might not care at all. Um I also prefer if a shell doesn't survive a reboot but uh a lot of these things don't check for the firmware integrity. Um so when I'm looking at um devices like this I have a sort of really general methodology um which is basically asking what's been already what's been done already uh what public info is out there already for the same or similar devices. Can I get firmware uh what does it look like. If I can't get that firmware can I get firmware for a really similar device. Um can I get a shell and start playing with that. None of that is necessarily in that order but it's just a rough kind of a I'm trying to do when I start reverse engineering these things. So, let's have a look at some devices. The first one is the ZTE MF910. Um, I also had a look at the MF65 plus and the MF920. Uh, which both had really, really similar code running on them as well. Um, I'm going for a deep dive on this one because it's end of life, easy to get, really cheap. Uh, so if you're interested in looking at these, it's a really good starter. Uh, it runs a Qualcomm MDM SOC, um, which are really common, the MDM series, uh, in modems. Uh, ZTE are also a massive OEM slash vendor, so you tend to find their hardware and software running in lots of devices that aren't badged ZTE. There's also a few caveats. There, there might be O days ahead. Uh, definitely in the MF910 because it's end of life, so they're not going to fix anything in that. But ZTE also pretty slack, uh, following up on the reports that we, that we sent them. Um, so there might be issues in really similar ZTE devices because they share a lot of the same code. Uh, we originally thought it was supported because it's advertised on their website, still being sold, and nothing on their website says it's not supported. Um, then we told them what bugs we found and then they told us it wasn't supported. Um, so, uh, I'm going to show you a couple of examples. Um, uh, we asked them how they, how we're supposed to know that and they just said, uh, we'll only tell you if you ask, basically. Uh, so we asked them to check their other products themselves, they didn't do that, then we found essentially exactly the same issues in a different supported device, disclosed again, then they fixed them, they gave a couple of CVEs, linked us to an advisory, which they don't link to on their website. Um, so, uh, I think, I think they're doing that thing where they're checking issues per device rather than, uh, rather than, uh, looking at the entire code base itself, or it's the code base genealogy or whatever. Um, so I'm just going to do this whole talk, uh, approach the device in the same way that, uh, ZTE did. I'm just going to treat the MF910 like, uh, everything that I talk about only affects this device and doesn't affect anything else and whatever. Let's go. So, let's have a look at the hardware. It's got this Qualcomm MDM9225 sock. Um, some of the newer ones are maybe 9625s but there's much of a muchness. They run this, uh, ARM Linux core plus a baseband. The baseband's this Qualcomm hexagon, um, micro architecture. Other people have done a lot more intense work on that. I actually wanted to start looking at that when I started looking at these, but I got a little totally sidetracked by, by looking at the really easy bugs instead. Um, it also has this, like, combination RAM NAND chip which you find attached to a lot of these, uh, Qualcomm devices. Uh, it's got this really nice test pad array. Um, if you're looking at a modem and you see a, some test pads that are sort of square like this, there's a really high possibility that it was made by ZTE. I've seen it on quite a few devices that have either been made by them or, um, that, but aren't badged by them. Uh, and you can do things like, oh, I've got, I've got, I've got, I've got a lot of, uh, on some of the more locked down ones you can pull these test pins low and it will boot into different modes. Um, sort of like GPIOs or like the volume button on a phone. There's already a bit of public information about this particular device as well. Um, there's two ways to enable ADB over USB. So, you can just get an unauthenticated root shell immediately. Um, it, it's, it's only over USB. So, it's, it's not that, not that, it's not that bad. Uh, you enable it through just API calls in the web interface. So, you just send a, uh, request to this USB mode switch endpoint and the USB, uh, will just go down and come up again and you just write ADB shell and you, you, your root. Uh, it's really well known. Uh, I couldn't really figure out who already found, who found it already but it's, it's a really well known thing that's out there. Um, it works on loads of other ZTEs too. Um, it's, it's, it's, it's, it's, it's, it's, it's, it's, it's, it's, it's, it's stuff as well. Uh, apparently, not just the MF910. There's another public way to do this as well which is mode switch. Uh, just does exactly the same thing. You just send the, the word factory to, um, the switch command parameter and it'll just, um, just start ADB over USB again. So, we can get a shell really easily on this. Uh, start pulling firmware off. See how the thing works when it's running. Uh, see what binaries are running. See how they're all talking to each other as well. Uh, so, the MF910's quite bloated. Um, which also means there's quite a lot of interesting stuff about it. Uh, the underlying system is probably gonna be familiar to people who are used to working with embedded devices. It's just old Linux kernel running on ARM, Android-esque, not really full fat Android. The default root, root password you can find in just one of the RCF startup scripts. Uh, in a function called set passwords. It just echoes the root password. Uh, the password to a temporary file, pushes it into change password and then tries to delete the temporary file to cover its tracks. Uh, this kind of stuff's really common on embedded devices. It's not really revolutionary but it, it, it's quite funny whenever you see it. Uh, it's not hugely useful out of the box cause we've already got a root shell but, um, there's drop bear running but you can't get in because there's IP, default IP tables rules. Some of them have telnet running, others don't. It really depends on, on who badged the firmware, I think. It's loads of Qualcomm stock binaries, um, these QC map ones, uh, Qualcomm mobile access point binaries. And there's a few Diag binaries as well, uh, if for anyone who's interested in that. And there's also GDB server, just stock on it. The IP tables rules just default accept. Um, they block TCP and UDP on everything. Uh, u- it's TCP and UDP twenty-two on everything. Uh, but you can just large and then block TCP 80, UDP, and TCP 23, 53, and 1900 on the WAN interface. But that doesn't actually block everything that's actually running on it. There's still a few services exposed, like syslogd, there's that DNS mask, DHCP port, and there's a custom binary called ZTE whisper, which is some sort of proprietary whisper protocol service on UDP 4500. I had a really quick look at that. It's definitely using lots of unsafe C functions, but I'm not going to talk about that one today. I'm going to talk about this ZTE top SW go-ahead binary, which is really fun to reverse. If you're not familiar with embedded web servers, the hard part is that it's not going to work. It's not going to work. The whole web server stack tends to be just custom binaries, so they'll be based on some open source web server, and then they'll just attach stuff to it. This one's probably based off a web server called go-ahead, which is just a common commercial web server. It's not directly accessible from the WAN side, so you can't do any of this stuff directly over the APN, but you could still attack it by cross-out request forgery if someone went to a malicious page. So, we're going to have a look at it with that in mind. The web API logic is pretty standard for a router. Because there's a large configuration table that holds all the configuration data for this router, stored in non-volatile memory somewhere, all the configuration is written to or read from that by this binary. So, the web server is just a broker for reading and writing that information. There's a couple of API endpoints. There's a couple of API endpoints that are used to do this. GoForm get command process and GoForm set command process. Um, GoForm get is just for reading data and GoForm set is just for writing data to, uh, to the NVRAM. Uh, GoForm get takes a CMD parameter and then an optional multi-data parameter. GoForm set takes this GoForm ID parameter and then custom parameters based on what that GoForm ID is. Uh, so we can, with that information, you can load the binary up in either or or whatever. I did it in either, but I think Ghidra's a bit easier to see in really, really quick time. Um, there's a lot more endpoint handlers in this binary than you actually see when you're using the device normally. Uh, not all of them are that interesting, uh, but it just means there's a lot more attack surface on it, a lot more stuff to play with. Uh, in GoForm set command process, um, each GoForm ID points to a different function in a big lookup table in the binary. So, most of these functions are just, uh, just wrappers around a pretty safe ZTE library function that just reads and writes data to the NVRAM. Um, and some of them are like explicitly white listed as well. Uh, so they can be used before authentication. Um, not all of the functions do this, uh, NVRAM reading and writing. They also tend to run other sort of SIS commands. There's one more ADB mode, uh, that I've found pre, that you can enable pre-authentication. So, GoForm ID takes this set device mode parameter and just takes a debug enable, um, uh, sorry, GoForm ID takes this, uh, set device mode, uh, as its value and there's, takes a debug enable parameter, checks if it's 0, 1 or 2 and then just echoes it straight to that Android USB debug enable file in SIS, which just brings up, uh, ADB again over USB. There's no command injection because they're actually checking the input. Uh, so it's not a really nasty risk, but it's a nice new way to, to get ADB access over USB on a device you don't have the password for. Um, uh, as far as I know, this hasn't been public before, but it's quite a nice one. So there's three different ways to do the exact same thing, uh, in one web server binary. There's, uh, something else that's really nice is there's lots of verbose logging. So it's got this ZTE SISLOG append library function. So you know exactly where you are in every function in the code. Uh, there's also a way to leverage this from the web server. So, one of those undocumented endpoints, um, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, is, uh, that lets you set up, uh, remote SIS logging. This, uh, so this, you send a request to this endpoint and SISLOG data gets sent back to you on UDP 514, uh, of the requesting IP address. Um, it's only available post authentication but it's persistent across reboots. Um, the function itself does a system call, but there's no command injection in this particular one. I think there was command injection in it in the MF920 or the 65 remember. But they're very very similar functions just with slightly different bits of uh checking added. Um so if you open up UDP 514 you get all of this ZTE uh syslog data sent back to you. Which is which is useful if you're looking at a particular ZTE binary and trying to hit particular parts of the code in it. Um you can dump logs to a file as well, download them, enable kernel kernel logging as well. There's also a bug that I can't actually properly test. Um and again because anything that doesn't directly affect the MF910 ZTE aren't going to do anything about. So I didn't report this to them. Um there's all these pre-authentication HTTP share functions. Uh they don't work by default on the MF910 uh cause there's no SD card slot. But with a bit of basic reverse engineering you can see there might be a few problems in some of the code. Um so in this particular one uh you get a 1024 length buffer. You just sprint f uh a touch command with the user supplied variable in double quotes and just pass it straight to system. Uh there might be a couple of problems in there. I'll leave that as an exercise for the reader. But um I can't really confirm this because I don't have a ZTE modem with an SD card slot. But theoretically if I did the exploit would look something like this. So I'm going to go back to the MF910 and I'm going to do something like this. Um that sort of qualifies as fun uh cause it's not technically exploitable on the MF910. But we'll never know. We'll never know. So there's actual, actual technically exploitable bugs. This first one is a leaky uh API endpoint. The GoForm get command process endpoint. Uh there's two checks. One for authentication and one for cross set request forgery. But there's no proper authentication check if the multi data parameter is set to zero for some reason. So we can just read arbitrary values from the configuration table uh a as long as you can pass the the CSERF check. So that includes the unencrypted admin password value. So if you set the referrer to the router IP or 127 dot one you can read things just like the admin password backwards um without CSERF, without a CSERF bypass you have to be on the same LAN. So on the default there's also obviously command injection with code like this. Um there's that USB mode switch function from earlier. Uh the USB mode parameter is injectable so it just passes whatever whatever uh it it gets straight straight to system. Those two bugs are not quite a proper exploit because we can't really and they're not really a remote exploit because we can't really uh access the web server over the over the WAN. So to turn it into another kind of exploit we could uh we have to take some of the mitigations into account. There's uh this cross site request forgery protection. So it just checks the referrer header. Uh you can't control the referrer header in a browser. So uh any requests that we send from another page are gonna fail. Even if we try to log in we're just gonna fail um if we're coming from another page context. I think you might be able to guess um how to bypass this protection. Uh cross site scripting means we can just run java script in the root of page context. So the referrer header is gonna be the root or IP address. There's a really nice clean uh XSS in this totally inexplicable page. Uh go form slash form test. Um which by default just prints name Joe Smith address 1212 Milky Way Avenue. So you send us something like this you just bypass the cross site request forgery protection. Uh and you just run any java script you want in the root of page context. So we can have an exploit that just goes like this. XSS gives us a clean referrer header and we don't have to worry about the same origin policy so we can read the responses back as well. Then we can just leak the admin password, log in, exploit the command injection. Uh the csurf to XSS is just a form posted into an iframe because uh if you just watch the environment and get changes in their try to use XHR it'll send this options pre-float request and the web server just can't handle an options request. So it'll just fail. Uh and the injected JavaScript just sets up a couple of functions, reads the admin password, logs in and executes arbitrary code. So let's have a look at it. So on the right there is the uh um Windows machine just connected to the router. Uh and on the left is a sort of attacker machine that's gonna open up, open up a shell. Yeah. Okay. Case study number two. Uh I'm gonna show you a little bit more detail. Uh I'm gonna show you a little detail. Uh a high end router this time. Uh the Netgear Nighthawk M1. I wanted to see what an expensive 4G router looked like cause the MF910 is pretty old and pretty cheap. Uh the M1's new. Uh newish. It's been out maybe a couple of years. There's barely any public information out there about it. Um it's using a new Qualcomm SOC so there's almost no public information about that. Uh so it's a sort of a sort of challenge. There's also a really cool Russian subculture of just pushing them way too hard by putting heat sinks and massive antennas on them. Uh it's also part of the Netgear bug bounty. Uh which they run on their high end routers. Um I absolutely hate the Netgear bug bounty so much. Um before you disclose to them you've got to agree that you uh can't publish your findings or speak about it to anyone. Uh. That's the other part on the right hand side. Uh the other than Netgear. Uh if you do they'll be uh so called entitled to some kind of performance uh instead of giving money back. Uh I uh. The payout calculations also really really uh complicated. They seem to calculate the payout amount based on CVSS. Um which is arguably not the best uh way to calculate risk in a piece of hardware. Uh I had looked back through some of their recent disclosure, recent uh disclosures. One of them they gave a post authentication command injection this CVSS v3 score of 6.8 which is conveniently uh a medium risk. So a $300 payout rather than a high risk $600 payout. So uh they're also cheapskates. So I did manage to find command injection in this thing so I just I very briefly considered my options. Um should I go through bug crowd, never talk about it in public and maybe get $300 from Netgear or speak at DEF CON, complain about Netgear in public and get $300 anyway. So yeah I'm here. The hardware is really really similar to the MF910. It's got a Qualcomm uh MDM 9250. Uh which is pretty new, you can't really find much information about it. It's got this Nanya combination Nand RAM chip as well. These really generic looking test pads. I'm sorry for the there's like scrapes and scratches all over them cause I'd tapped onto them and tried to clean them up. Um so it's the main core components are pretty similar to the MF910 uh but a little bit more up to date. There's basically no useful information out here at all for this one. Uh it's a really long threading threading. on 4PDA which is this Russian phone modem enthusiast website. Um they want to lock it to particular bands for some reason. Um no one seems to be able to do much with it. The thread was really helpful because they archived some older firmware update packages and documented some arbitrary firmware update process that I'll talk about in a minute. Um so thanks to them for that. Uh there's a GPL tarball on the on the uh Netgear site that seems to be about 14 versions out of out of date. Uh so there's not there's not much else out there. There's firmware on the Netgear site but every file looks encrypted. So it's not trivial to get binaries off it. Um and look for bugs. There really wasn't anything that obvious. There's no ADB, no telnet, no known backdoor. It's nowhere near as easy as the MF910 to get into. Um there's a web server on port 80 and then an 80 shell on port 552. Um so there's a lot of information over 10. Uh but only if you're plugged in over USB. Um I could figure out it's based on Sierra Wireless technology. Uh Sierra Wireless is just a a big Canadian vendor who make really expensive industrial cellular stuff as well like modem modules. So knowing that gives us a little bit of a wider uh scope to look for uh more information outside of just the Netgear specific uh searches. So since the M1 was a bit more difficult to get to get into initially the the fun stuff is was sort of figuring things out black box entirely. Um these test pads I started off thinking they'd be GPIOs like the ZTE stuff or or on phones. Um I spent time pulling them sort of up and down on boot and seeing what the USB, vid, PID combos were coming up on DMessage. But I put it into like Qualcomm emergency boot mode a few times just cause I didn't know what it was. Um so I put it into like Qualcomm emergency boot mode a few times just cause I didn't know what it was. Um so I put it into like Qualcomm emergency boot mode a few times just cause I didn't know what it was. Um so I put it into like Qualcomm emergency boot mode a few times just cause I didn't know what it was. Um so I put it into like Qualcomm emergency boot mode a few times just cause I didn't know what it was. Um so I put it into like Qualcomm emergency boot mode a few times just cause I didn't know what it was. Um so I put it into like Qualcomm emergency boot mode a few times just cause I didn't know what it was. Um so I put it into like Qualcomm emergency boot mode a few times just cause I didn't know what it was. Um so I put it into like Qualcomm emergency boot mode a few times just cause I didn't know what it was. Um so I put it into like Qualcomm connect as a generic cortex. I think it's A7 or something like that. But in the end I didn't really spend that much time on it. Um JTAG on a really complex SOC with basically no data sheet is not really like a quick win to get into something. I think the uh memory protection unit was also stopping a lot of stuff. Um I figured out a few things like the bootloader starts at zero and arm thumb gives you some in insight into uh interesting potentially interesting memory locations or register locations. Um but you can't really read those locations from JTAG cause the MPU's blocking most memory reads. Um but it's there for anyone who's interested in in JTAG on Qualcomm stuff. That AT shell as well is sort of uh limited. So um you can see extremely small amounts of like modem crashes and stuff like that. And there's a lot of flash data and things like that. There wasn't this uh usual privileged command mode that you sometimes see on AT shells. Um I think the password is nulled by default so you can't uh so you can't get into it even with even with the right password. There's nothing like this like AT bang enable or anything uh that you see on some other devices that would just pop open ADB for you. Um the only thing that came close to being useful was this AT bang boot hold. Um that was a very, very, very, very good design. Uh I think there's uh a lot of just put it into this Qualcomm flashing boot mode. Um from this mode you can use this tool called fdt.exe which is a a Sierra Wireless proprietary binary. It's not that easy to track down. Uh you can find it packed with other Sierra Wireless firmware update packages. You just sort of open them up in 7zip and the file's in there. Um if you're used to the like Qualcomm normal Qualcomm download mode um this one's sort of proprietary. It doesn't open up a com port. It just seems to do it all over USB. So maybe it's just some sort of Sierra Wireless specific implementation. But this was a a really nice tip from that 4pda.ru thread. Um it's still not that helpful unless we can manipulate firmware update files uh cause they're encrypted. I used the same encryption loosely. Uh Netgear chose everyone's favorite encryption. I mean it actually depending on your definition of fun this might not sound like that much fun. Is it's not just XOR. Um it's XOR and AES. Uh the firmware follows this really generic Sierra Wireless structure. So the firmware's split into chunks and each chunk has a header and a body. Um Netgear added this encryption layer where all the chunk headers are AES encrypted and the actual data, the chunk body is just XOR encrypted with um with a, oops oh dear, well with a um um ten twenty four byte key. Go ahead and find this. The AI section is also just encrypted in uh ECB mode as well. So they're just repeating 16 byte uh blocks. So they're really easy to spot. Um, so the general theory of it, you can derive the XOR key for these chunk data segments just by assuming that most firmware bytes are just going to be nulls. Uh, then you can just XOR out all the data segments, get all the data, get the AES key out, and just decrypt everything. Um, I'll go over the steps so you can just sort of see really quickly. This is the nulls encrypted with AES and ECB modes. So each block is just encrypted on its own, 16 bytes. Uh, it looks like XOR with a 16 byte key, but it's definitely not. And when you line up the encrypted file with a generic, uh, non-encrypted, uh, Sierra Wireless firmware update file, you can see the repeating blocks of nulls line up really nicely with the, with these so-called ECB encrypted null blocks, um, at the same offsets. So, the headers for each chunk are all the same size, you can figure out where the headers are just by looking for this known, uh, header. Um, so, uh, the headers for each chunk are all the same uh, encrypted null, uh, uh, chunk, block. Um, so you can figure out where the headers end and begin just by searching for, for that 16 bytes. So it's pretty easy to figure out the file structure, file structure, uh, and just decrypt everything. So, I, I wrote up a script to do it. You can read about it here. Um, it's a bit too fiddly to get in too deep. Um, I'm gonna do a little bit of decrypting right now, anyway. Um, it'll just, it's, the script itself will just iterate over the file, just decrypt everything. Uh, some of the chunks are nested in other chunks. The key shifts very slightly if the chunk data mod, uh, modulo, uh, 32 isn't zero. So, it's, it's all a bit convoluted and weird. Um, but anyway, the firmware's pretty interesting once you've decrypted it. It's got literally everything that's running on the device in there. So, including the bootloader, it's got the DSP, it's got the Linux system, it's got the web root, it's got the Android splash screen, uh, and some, like, generic APN configuration data as well. Um, I didn't take this to its sort of logical conclusion. I mean, it, it might be possible to fiddle around with this firmware, re-upload it back, and, uh, uh, run arbitrary code that way, uh, to get in. I didn't get around to doing that in too much depth for reasons you'll see in a minute. Um, there's other, there's other, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, other Sierra firmware file parsing tools out there so you can figure out where the checksums are in the headers, and, or where the size fields are in the headers and stuff like that. Um, anyway, Nega don't think this is a problem so they're not going to fix it, so have fun. Okay. Uh, I, I found some bugs before I decrypted the firmware. Uh, these were just black box finding the bugs. Um, if you decrypt the firmware and, and you might find more things. As is customary there's command injection. I sound bored don't I? I'm so bored of command injection. Uh there's uh so it works like this. A bunch of the endpoints after the um forms hand handler um a handling request. There's like forms dot config, forms dot multi-config. You send a post request with a parameter like uh webd dot admin password equals password one and it'll just change the admin password if you're logged in. And the session security is quite good on the on the web application so it's it's not that easy to bypass. I I thought maybe someone else will find differently. Um requests look a bit like this with the sort of important parameters highlighted. Um I did a bit of basic fuzzing with stuff that I found when I was actually just going over the uh the web interface totally black box but I didn't really find that much. Um but there is an interesting webpage at um introspection dot html uh which is a Sierra Wireless specific page which gives you a really long list of parameters when you're logged in. Um and it'll give you their expected value type as well like Boolean or Integer or String and sometimes the values that they're set in there as well along with uh the permissions the user permissions that you need to modify or read them. So it's pretty helpful cause it just it's just giving us a word list of valid parameters that we can try to fuzz. Um which we can use to find this command injection in uh ready dot device share dot remove USB device. Uh so if you send something like that you'll just get telnetd opening up. Um just log in with the default credentials. They're root oe linux one two three and uh you get a nice clean root shell on it. This is my absolute favorite cross site request forgery bypass of all time. Um so unlike the ZTE there's no dynamic API to request this command injection. Uh so if you send something like that you'll get a lot of data from. Um you read all the configuration and session data from these like dynamically generated JSON files. Um that includes uh also the CSERF token. They're not JSONP so you can't just siphon them off cause the SOP will stop you. Um but there is a file another file called netgear strings dot js uh which is also dynamically generated. And just after the to do comment at the top is a big variable called netgear load data. Uh it's a big variable called netgear load data which holds the user privilege level of the current session and the CSERF token. So you can just load this javascript file from any site. Read the netgear load data dot session dot sec token and you've just got the CSERF token. So it's the dumbest CSERF bypass I've ever found. So you can theoretically you can chain these in a really similar way um to the MF910. I didn't find an authentication bypass um so it's not I don't have such a clean exploit. You'd have to try and guess a weak password. Um after just so much hassle with it I was just quite happy to get a shell shell on it to be honest. Um if you just want a shell to get uh so you can start trying to change stuff on the low low level configuration you can uh you can flash any compatible firmware that with that FDT dot exe uh file. Just grab a vulnerable version and and get a shell by command injection. Um netgear have been pretty bad to disclose to um maybe cause I avoided bug crowd they were having a little tantrum. Uh so I reported the issues in late February. Um as of I think this morning they haven't fixed anything so all of that stuff was just oh days back there. Uh they're not gonna fix some stuff. Other stuff they're looking into. They might change the root passwords. Literally who cares. Okay. It's the end. These things are these sorts of devices are really fun. Uh they're really easy ways to get into hacking embedded stuff. You should go into it with the mindset that vendors are gonna be really rubbish. The boundaries are gonna be rubbish. But you can start to at least learn how these things work on quite a low level. Which is quite interesting. I've got a massive to do list of things cause I I I started the whole project cause I wanted to find bugs in the in the Qualcomm baseband. But I got obviously way too distracted by all of this stuff. Um I wanna do things like download all the extremely dodgy looking uh unofficial Qualcomm tools that people have have released out there. Figure out how they work and what they do. There's so much stuff out there. There's so much work that's been put into reverse engineering and changing these things. Um there's just a gold mine of of existing research. Um vendors should be asking things like where's my code from? What else is running? What's the root cause? How do I fix it? They don't really seem to do that. They just respond reactively to bugs that you send them and and don't think about it anymore. Um I tried to coerce SETI to check for similar issues and they just didn't do it. Um I think one of the excuses was I sent them a a proof of concept that used Netcat and they hadn't uh installed Netcat on another vulnerable device. So despite the fact that there was still command injection in there Netcat wasn't running. So they just gave up and thought it wasn't affected. Uh Netgear running this slightly modified Sierra wireless stuff. I'm really not sure how much Netgear actually do on this or whether they just outsourced to a third party. It's been what six months since I reported to them. Almost six months and they've done absolutely nothing. Um so I I have no idea how how in control they are of their own device. Um in all of this stuff there's loads of like rebranding, shared code, um especially if you're running on your own device. Um especially in some of these like lower level Qualcomm libraries as well. Um these issues might affect other vendors or similar devices using a similar development stack. So I can't buy everything and check it myself and I'm bored of a lot of this by now. So that's it. Thanks to everyone uh who's up here. Uh have a look at the blog post up here. I've written up some of this stuff and another issue that I found in a TP-Link pre-authentication command injection in a TP-Link uh router as well. And just really basic stuff on how to use Ghidra uh to find stuff like that. And um yeah hassle me on Twitter if you want at no thanks with all underscores underneath everything. And yeah thanks very much.