[00:00.000 --> 00:04.120] Without further ado, this is Elvis Cayado. He's going to be [00:04.120 --> 00:09.260] presenting on some really cool research that he manipulated. [00:10.080 --> 00:12.400] Yeah, sure. All right. Awesome. Thank you so much for joining [00:12.400 --> 00:21.180] us. And here we go. Test. Is that good? All right. Thank you [00:21.180 --> 00:23.900] everyone and welcome for coming. This is my talk called green [00:23.900 --> 00:28.880] waves and ham. All right. Let's get started. So this device up [00:28.880 --> 00:32.020] here that you see is called the green wave G1100. It was [00:32.020 --> 00:35.740] distributed by Verizon Fios and Frontier. They're an ISP up in [00:35.740 --> 00:38.920] the northeast. And we have Verizon for the file service. [00:38.920 --> 00:42.120] It was not available in my area, but this is what they gave you. [00:42.940 --> 00:45.880] So if we look a little there, we got our FCC ID. So what do we [00:45.880 --> 00:50.720] do with our FCC ID? We go online and we find the internal photos [00:50.720 --> 00:54.360] and then we find the processor and we look it up. There's no [00:54.360 --> 00:56.960] data sheet for that, unfortunately, but we see the [00:56.960 --> 00:59.980] shield is on cover. We see two memory modules. And if you see [00:59.980 --> 01:02.520] something like over here, you may be going, hey, what's going [01:02.520 --> 01:06.040] on over here? Well, you have every reason right to be, [01:06.040 --> 01:09.700] because this over here is JTAG. Awesome. So I just grabbed my, I [01:09.700 --> 01:12.460] think it was like JTAGulator or my Arduino. It's 3-3 logic, so [01:12.460 --> 01:15.580] it doesn't really matter. Got the pin outs. So this in the [01:15.580 --> 01:18.000] middle, open up the device, this thing right here. In the middle [01:18.000 --> 01:21.900] we have four pins. And what do you think it is? You are right. [01:21.900 --> 01:25.200] So we have ground, receive, transmit, 3-3. Unfortunately, [01:25.200 --> 01:28.540] when we turn on the device, standard in is blocked. So all [01:28.540 --> 01:30.620] we get is standard out. So receive is, you know, we can't [01:30.620 --> 01:34.700] type anything. Crap. We cannot do anything whatsoever. We just [01:34.700 --> 01:36.700] see standard out. We just see print logs, whatever. We're not [01:36.700 --> 01:40.460] seeing it. We can't do anything. That's boring. So after some [01:40.460 --> 01:42.660] thinking, because I want to keep everything software based. I [01:42.660 --> 01:44.500] don't want to touch hardware. Like, yeah, there's a NAND [01:44.500 --> 01:47.380] flash. We can remove it. That's the last thing I want to do. [01:47.380 --> 01:50.660] Like, I'd rather go the software route because it's ripping crap [01:50.660 --> 01:54.620] out and I mess up. I got to buy a new one. Forget all that. So I [01:54.620 --> 01:58.300] just solder some, so it takes like a hot glue gun. You know, [01:58.300 --> 02:01.680] find an area on the board that has no copper exposed. Put a [02:01.680 --> 02:04.740] little bit of hot glue on there. Take some header pins. Just [02:04.740 --> 02:07.380] stick it on there. Wait for it to dry. And then I take some [02:07.380 --> 02:10.200] wires and I just, you know, solder it on. And it's not the [02:10.200 --> 02:12.900] prettiest thing in the world. But, you know, and then I just [02:12.900 --> 02:16.620] attach some wires. Put it on my FTDI base breakout board over [02:17.400 --> 02:20.600] here. Turn on OpenOCD with my configuration on my FTDI board. [02:20.600 --> 02:23.620] And we see automatically, boom, we do have a JTAG interface. We [02:23.620 --> 02:26.680] have the ID. We see the manufacturer ID is ARM base. [02:26.680 --> 02:31.740] Woohoo. So then we open up our own target configuration. So we [02:31.740 --> 02:35.000] set the reset config. We have test reset. We have system reset. [02:35.000 --> 02:38.240] It's a push-pull situation. We have a new, like, tab with the [02:38.240 --> 02:42.640] ID at the very end of it. And then we create a cortex A target [02:42.640 --> 02:45.960] that's little Indian. And then after that, we run it again with [02:45.960 --> 02:49.120] our two configurations, the board and the target. And look, [02:49.120 --> 02:52.410] oh, also we have six break points, four watch points. And, [02:52.410 --> 02:55.490] you know, I can tell that into OpenOCD, like always, and give a [02:55.490 --> 02:58.430] command or attach GDB to it and start analyzing memory once I [02:58.430 --> 03:02.550] halt the processor. So before we get on to the next slide, so [03:02.550 --> 03:05.250] the first thing I started doing once I had JTAG was I don't have [03:05.250 --> 03:07.970] a data sheet for this chip whatsoever. So I'm dumping [03:07.970 --> 03:10.850] memory addresses. If something is not, you know, unaccessible, [03:10.850 --> 03:13.410] I just write that out. So I'm dumping, dumping, dumping, [03:13.410 --> 03:16.370] halting the boot-up process at different stages. I'm trying to [03:16.370 --> 03:20.150] find the kernel boot arguments. So after about an hour or two, I [03:20.150 --> 03:22.390] think about two or three hours, it was kind of a while, I [03:22.390 --> 03:24.750] finally found it, and I set a watch point to the very last [03:24.750 --> 03:26.870] character of that kernel argument, or kernel boot [03:26.870 --> 03:30.590] argument. So that when it's done writing for a watch point, I can [03:30.590 --> 03:33.870] set a break point, well, it'll, you know, break, and I can [03:33.870 --> 03:37.590] overwrite it. So instead of init calling slash init, I can set, [03:37.590 --> 03:39.910] no, instead of calling this upon initialization, because I don't [03:39.910 --> 03:43.990] have U-boot access, like, yeah, I could ground clock on the, on [03:43.990 --> 03:46.790] the NAND or so, or, you know, whatever, and make it fail, and [03:46.790 --> 03:49.210] maybe I can, you know, do a second retry and get into it, [03:49.210 --> 03:51.850] but, again, I don't want to touch hardware. So, um, I'm able [03:51.850 --> 03:55.390] to overwrite the kernel boot parameters, set a net to bin SH, [03:55.390 --> 04:00.990] alright, awesome, and then we continue execution, and, awesome, [04:00.990 --> 04:03.110] we get a root shell. We actually, can actually do [04:03.110 --> 04:05.110] something, and you actually probably saw me typing up some [04:05.110 --> 04:09.050] commands to load everything up. So great. So this gives us [04:09.050 --> 04:12.410] access to rip the firmware off and get debug capabilities, [04:12.410 --> 04:15.510] right? So the very first thing I do is I go through all the RCS [04:15.510 --> 04:18.290] initialization scripts, I get everything running, and I look [04:18.290 --> 04:21.170] for all the running daemons. I don't care if it's WAN-based, [04:21.170 --> 04:24.230] LAN-based, everything's open scope in my eyes. So I'm looking [04:24.230 --> 04:28.850] at anything that's listed on all interfaces 0 to 0, or, uh, [04:28.850 --> 04:31.750] inner, you know, an internal interface. Uh, IP tables can [04:31.750 --> 04:34.990] maybe come into play later, but we'll get into that later. So [04:34.990 --> 04:37.510] very first thing, I'm looking for low-hanging fruit, and [04:37.510 --> 04:40.850] someone please scrim it out. UDP 1900 is? [04:41.010 --> 04:42.190] Low-hanging fruit! [04:42.190 --> 04:46.370] Yes! Awesome! It is known as SSDP. It is a piece of crap, [04:46.370 --> 04:48.470] and everyone talks about it. But anyways, we have three [04:48.470 --> 04:51.490] binaries here, we have three different SSDB servers, WPS [04:51.490 --> 04:55.570] monitor. Frontier 4 is about a 32 megabyte C++ file. Have fun [04:55.570 --> 04:58.650] with that. It's kind of fun to look at. Fun. Uh, we have mini [04:58.650 --> 05:01.190] UPNPD, which probably is vulnerable to the read out of [05:01.190 --> 05:04.290] bounds volume that I posted earlier this year. So anyways, [05:04.290 --> 05:08.550] today we're going to be talking about WPS monitor. So before I [05:08.550 --> 05:11.090] even start ripping things out, I need to know my environment. [05:11.330 --> 05:13.610] Um, because I need to know like, you know, do I need an info [05:13.610 --> 05:15.970] leak? Uh, do we have an executable stack? Do we have an [05:15.970 --> 05:17.970] executable heap? Well, what the hell am I looking at, right? So [05:17.970 --> 05:21.890] the very first things I do is I look at all, you know, there's a [05:21.890 --> 05:25.830] libupnp library. You can see like, oh, a libupnp. It's not [05:25.830 --> 05:28.630] the Intel one, so remove all like assumptions out of your [05:28.630 --> 05:31.990] head. Uh, and also we have ASLR on the imported libraries. [05:31.990 --> 05:34.770] Surprise. We look at a stack in the heap. We have depth. [05:34.770 --> 05:37.230] Awesome. Uh, we also look at the heap over and over again, you [05:37.230 --> 05:40.870] know, and we see that ASLR does impact the heap base headers and [05:40.870 --> 05:43.610] the stack. Cool. Uh, the only thing that we see here is that [05:43.610 --> 05:46.790] this WPS monitor, the main binary itself is not ASLRed [05:46.790 --> 05:49.610] whatsoever, so we do have a static binary. We have a gadget. [05:49.610 --> 05:52.890] The problem is, we have null bytes in this 32-bit address, so [05:52.890 --> 05:55.210] if we have a string-based overflow or anything like that, [05:55.210 --> 05:58.230] we can't use this because of limitations of a string, you [05:58.230 --> 06:02.010] know. So, after that, this device does have USB devices, so [06:02.010 --> 06:05.510] I plugged in the FAT32 device in, and then just DD, uh, you [06:05.510 --> 06:07.390] know, look at mount, see where the file system will be mounted [06:07.390 --> 06:11.410] from, DD down to the USB drive, and then after that, 1, 2, 3, [06:12.070 --> 06:17.150] we use binwalk, like always, and we extract the file system. So [06:17.150 --> 06:19.230] now we're going to get more into the nitty-gritty, happier [06:19.230 --> 06:23.350] stuff. Vuln hunting. And so, like, you know, everyone has [06:23.350 --> 06:25.890] their own way of like, you know, going about vuln hunting, like [06:25.890 --> 06:29.010] some people have like, you know, super dope scripts, and some [06:29.010 --> 06:31.170] people get lucky, they're like, oh, man, I just looked at a [06:31.170 --> 06:32.910] string, and that sucks, right? It's like, oh, I looked at a [06:32.910 --> 06:35.810] string, found a vuln, and that's exactly what I do first. I'm [06:35.810 --> 06:38.710] looking for low-hanging fruit, least path-resistance, so I'm [06:38.710 --> 06:41.070] looking for %s, right, because what are the destinations for a [06:41.070 --> 06:44.230] format string? We have a buffer, or some sort of file descriptor [06:44.230 --> 06:47.910] in Linux, right? We have syslog, or we print the standard out, or [06:47.910 --> 06:50.210] we're going to, you know, save it something to a buffer and do [06:50.210 --> 06:54.330] whatever, right? So I see this very first response, HP11, okay, [06:54.330 --> 06:58.150] blah, blah, blah. I see %s here, I see %s there, %s here, over [06:58.150 --> 07:02.970] here is a %s, and over there is a %s as well, ha. And that's [07:02.970 --> 07:05.370] very interesting to me, because I'm like, alright, what is this [07:05.370 --> 07:09.270] response, right? Like, what function is using this? So I see [07:09.270 --> 07:11.870] this immediately, looked at xrefs, and I'm like, oh, that's [07:11.870 --> 07:15.330] nice, sprintf. But, you know, remember, sprintf, assert copy, [07:15.330 --> 07:17.870] and all those, like, vulnerable C functions can be used in a [07:17.870 --> 07:20.590] non-vulnerable way, right? So just because it's sprintf doesn't [07:20.590 --> 07:23.670] mean it's vulnerable. So we look at where's r0, the destination [07:23.670 --> 07:27.410] buffer coming from. So we look at, it's from r5 going to r7, [07:27.410 --> 07:29.610] going to, you know, then adding some more to r7 and putting it [07:29.610 --> 07:32.610] into r0. So this right here seems to me that we're accessing [07:32.610 --> 07:35.450] some sort of member in a structure, right, or, you know, [07:35.450 --> 07:38.510] an object, but it's still a struct, it's C. So we're [07:38.510 --> 07:40.950] accessing something. This could be, like, a pointer that, you [07:40.950 --> 07:43.990] know, maybe Malik is saved, you know, Malik is being saved to or [07:43.990 --> 07:45.910] whatever. Like, you know, we get an address from Malik, we save [07:45.910 --> 07:48.550] it there. Maybe it's calculating the length beforehand and, you [07:48.550 --> 07:50.710] know, maybe it's not vulnerable, like I said. Who knows? Or maybe [07:50.710 --> 07:54.190] this is just a character buffer inside this structure that has a [07:54.190 --> 07:57.450] fixed size. Who knows? So we need to do more research. So [07:57.450 --> 08:02.190] next thing I do is I'm looking at the UPnP specifications, [08:02.190 --> 08:06.130] going, what is this message for? And we see that we have something [08:06.130 --> 08:10.810] called a SID, which is a unique identifier, and we have this [08:10.810 --> 08:14.090] timeout second dash, and this is actual subscription time. [08:14.330 --> 08:16.330] Something in our, we probably have second dash and some [08:16.330 --> 08:19.010] integer, right? So I'm like, well, what's causing this [08:19.010 --> 08:21.830] response? And we see this. It's called a subscribe. Subscribe [08:21.830 --> 08:24.150] publisher path, and I'll show you that, what's that, [08:24.150 --> 08:26.370] afterwards. We have something called a callback. Host and user [08:26.370 --> 08:28.890] agent are optional, so that's why they're not bold. Callback [08:28.890 --> 08:32.310] is mandatory. It is wrapped around angle brackets or less [08:32.310 --> 08:35.710] than, greater than, whatever. We have NT set to UPnP event, which [08:35.710 --> 08:37.970] is static, has to be that. And then we have timeout second [08:37.970 --> 08:41.750] dash, and then a request is duration. Second dash, again, [08:41.750 --> 08:44.790] probably an integer, second dash 20, second dash 900, whatever. [08:46.110 --> 08:48.970] So what is this for? Like, what part is this? What is the [08:48.970 --> 08:51.790] publisher path? So you probably have done, like, I send an M [08:51.790 --> 08:55.630] search request on multicast, and then I get an XML, and then I [08:55.630 --> 08:58.850] get all this crap. But everyone talks about the control URL, the [08:58.850 --> 09:01.050] SOAP actions, and that's not what we're talking about today. [09:01.050 --> 09:03.370] We're talking about this, the event URL, which is called the [09:03.370 --> 09:05.590] Gina stat. I forgot what it stands for off the top of my [09:05.590 --> 09:09.630] head, but just trust me, it's called Gina. So the very first [09:09.630 --> 09:13.070] things we do is we launch up some notepad editor, Vim, [09:13.070 --> 09:15.690] whatever, but this is not Vim, I think it's Zed or something [09:15.690 --> 09:20.510] like that. So we use, you know, requests. We're going to send a [09:20.510 --> 09:24.990] request that, come on, we do second dash and then a string [09:24.990 --> 09:27.370] instead of, like, an integer. Because I just want to see [09:27.370 --> 09:29.990] firsthand if this percent S that I'm seeing in the response is [09:29.990 --> 09:32.770] even worth looking at. This is, you know, maybe pass it to a toy [09:32.770 --> 09:35.310] first and, you know, I get zero back and I get second zero. [09:35.310 --> 09:37.330] Like, that's not exploitable or anything worth looking at. So I [09:37.330 --> 09:41.410] need to dig deeper. So we just send it and awesome, I sent a [09:41.410 --> 09:45.730] string, I get a string back. That's awesome. So okay, this [09:45.730 --> 09:49.170] seems kind of interesting now. So that percent S is what we [09:49.170 --> 09:54.070] control. So okay, so next things we can do is we have two things [09:54.070 --> 09:58.930] we can do. We can be super C, super, like, awesome CSI, [09:58.930 --> 10:01.170] double-hacking keyboard, lead dudes that were, you know, [10:01.170 --> 10:03.590] like, all the clubbers and crap. Or, fuck it, we can just [10:03.590 --> 10:07.390] black box it, right? I mean, like, yeah, we can chase down [10:07.390 --> 10:10.270] the structure and, like, you know, we can find C functions [10:10.270 --> 10:12.870] and find where arguments, you know, is being passed to. We [10:12.870 --> 10:15.510] can be like, oh, we know that, you know, like, a start copy is [10:15.750 --> 10:17.850] a character buffer, character pointer, so this is a character [10:17.850 --> 10:21.530] pointer or whatever. Or maybe if we look up certain strings [10:21.530 --> 10:26.690] online, like on git duck duck go, Google, whatever, maybe we [10:26.690 --> 10:30.790] find the structure that we're clobbering, potentially, and we [10:30.790 --> 10:34.690] find everything. But this is supposed to be confidential. So [10:34.690 --> 10:37.850] I didn't have all this at the time, so screw it, we'll just [10:37.850 --> 10:43.890] black box it. Kobe. So, next thing. So I set up a for loop. [10:43.890 --> 10:46.910] That same exact code, just in a for loop. I'm incrementing now [10:46.910 --> 10:50.330] by one byte at a time, that second dash. And I have GDB [10:50.330 --> 10:52.830] attached. It's going to keep going and going and going and [10:52.830 --> 10:54.750] going and going and going. Any kind of reset sets to me, just [10:54.750 --> 10:57.710] try again, keep going. Right, just keep going. And I get a [10:57.950 --> 11:00.410] segmentation fault. I'm like, oh my god, there's probably static [11:00.410 --> 11:03.930] sizes, this is awesome. Oh my god, I got to call my dad. But [11:03.930 --> 11:07.490] hold on, let's not call my dad. Because this is just loading [11:07.490 --> 11:10.570] compare. We're not writing anything, we're just loading and [11:10.570 --> 11:14.650] comparing. That's not anything useful. And we go in IDA and we [11:14.650 --> 11:18.830] look around and yeah, all right, it's comparing to R1, which I [11:18.830 --> 11:21.150] don't know the value of, it's an unknown. But you know, we have [11:21.150 --> 11:23.390] this compare, it's looking at zero, it's going to branch out [11:23.390 --> 11:28.050] and return. So, all right, so I'm kind of messing around at [11:28.050 --> 11:30.350] this point because I'm thinking we have this UPnP server, what [11:30.350 --> 11:32.510] kind of states can we put this in? What kind of requests can I [11:32.510 --> 11:34.770] send to this thing? We have an HP stack, we have a SOAP stack, [11:34.770 --> 11:39.890] SSP stack, we have this Gina stack. So, I start thinking, I'm [11:39.890 --> 11:42.690] like, well what kind of other states can I do this in? And I [11:42.690 --> 11:47.490] find this. And I'm not going to read this wallet text to you. [11:47.510 --> 11:51.490] Basically what this says is that once you subscribe, you get a [11:51.490 --> 11:55.470] SID, your unique identifier ID, right? So from there, let's say [11:55.470 --> 11:58.310] you subscribe for 20 seconds. And then you change your mind. [11:58.310 --> 12:01.310] No, no, no, no, I meant to subscribe for like 100 seconds. [12:01.530 --> 12:04.210] Well, you send a second subscription with your SID and [12:04.210 --> 12:08.150] with a new timeout value. I was like, oh, maybe we can like hit [12:08.150 --> 12:11.110] some new code with this type of thing. So, we subscribe first, [12:11.110 --> 12:13.430] save the SID, and then we cause the overflow and see what [12:13.430 --> 12:16.590] happens, right? So, I do the thing again. And we get a [12:16.590 --> 12:20.630] different site fault. I'm like, oh, better be something good, [12:20.630 --> 12:24.870] right? So, I start looking, I'm like, oh, we see this load, you [12:24.870 --> 12:29.310] know, offset 24 to R3. We do a compare, a branch on zero. So, [12:29.310 --> 12:31.530] if it's null, we don't call it. You're not going to call null. [12:31.590 --> 12:35.450] And then it jumps to it with the exchange. So, we can jump modes [12:35.450 --> 12:38.210] like thumb mode, R mode, whatever, right? And I'm looking [12:38.210 --> 12:40.530] at this, I'm like, what's R3? I'm like, oh, that's the value I [12:40.530 --> 12:45.050] control. That's my name. That's awesome. So, okay. So, we have, [12:45.050 --> 12:47.610] so I got lucky, right? I got super lucky. But I don't care. [12:47.610 --> 12:51.870] That's my luck. So, going on, I kind of have a way to obtain PC [12:51.870 --> 12:56.210] control. We're one pointer away, right? We're almost there. [12:56.690 --> 12:59.550] Still can't use WPS monitor as a gadget because we're still [12:59.550 --> 13:01.990] bounded by the limitations of a string. Can't have a null byte [13:01.990 --> 13:05.450] because that's the terminator. Uh, ASLR and import libraries [13:05.450 --> 13:08.850] that don't have an infleek. So, whatever, right? So, now to the [13:08.850 --> 13:12.850] exploit development of this. So, we're thinking, we're thinking, [13:12.850 --> 13:16.830] I have one pointer away, I have ASLR, I have depth on the heap [13:16.830 --> 13:21.110] and stack, one pointer away. Holy crap, you know what, this [13:21.110 --> 13:23.710] reminds me of actually, so back in the day, who's ever done [13:23.710 --> 13:28.290] internet explorer exploitation? IE8, 7, 4, 1, I don't care. [13:28.290 --> 13:32.930] Anyone? Yes, awesome, cool. So, that's exactly what it reminds [13:32.930 --> 13:37.550] me of. I'm like, okay, new tactic. Screw the infleek. Let's [13:37.550 --> 13:41.390] find a way to spray the heap, let's figure out to do some, you [13:41.390 --> 13:45.270] know, some David Blaine magic stuff and then, you know, maybe [13:45.270 --> 13:48.770] we can trigger the overflow and get code exec, right? And [13:48.770 --> 13:58.640] speaking of which, oh, whoops. I need to start this. So, you're [13:58.640 --> 14:02.120] about to witness the world's slowest exploit. My exploit [14:02.120 --> 14:07.520] takes about 20, 28 minutes and 30 seconds to run. So, we're [14:07.520 --> 14:10.640] going to start it. Just want to make sure it's running before I [14:10.640 --> 14:21.770] go back to my slides. All right. All right. One second, please. [14:23.990 --> 14:30.030] This is slow. All right. There we go. All right, cool. So, [14:30.030 --> 14:34.110] let's go back. All right. So, it says spray the heap, do some [14:34.110 --> 14:37.370] magic, trigger overflow, get code exec. So, we look at the [14:37.370 --> 14:40.670] heap. So, I need information now. What is the base address of [14:40.670 --> 14:43.170] this heap like loaded at every single time? So, I need a target [14:43.170 --> 14:48.090] address to maybe grow this heap torch, right? So, look at it [14:48.090 --> 14:53.250] once, maybe twice, look at it again, and again, and again, and [14:53.250 --> 14:59.330] again, and again, and again, and again, and again. That's okay. [14:59.330 --> 15:01.710] You know, we can do that later, right? We can do more off [15:01.710 --> 15:08.250] screen. That's boring. So, also I need to know how much memory do [15:08.250 --> 15:10.970] I have? Like Internet Explorer, everyone had like, you know, [15:10.970 --> 15:14.330] maybe back in the day like 512 megs. Yeah, my age is showing, [15:14.330 --> 15:16.890] right? Or, you know, at least a gig. So, spraying the heap is [15:16.890 --> 15:20.010] not really that much, you know, not much, you don't have to worry [15:20.010 --> 15:21.530] about it and running out of memory and stuff like that. But [15:21.530 --> 15:25.290] we have 117 megabytes free. Or, you know, I don't want to be, [15:25.290 --> 15:28.590] you know, taking up everything. So, let's just call it 100. 100 [15:28.590 --> 15:32.470] megs. So, theoretically, if the heap always loads at zero, just [15:32.470 --> 15:36.030] think about that. The maximum size I can grow the heap to is [15:37.450 --> 15:40.750] 06060606 or whatever, right? So, awesome. I can grow the heap to [15:40.890 --> 15:44.650] a very large size potentially if I find a printer to allow me to. [15:44.650 --> 15:47.590] So, after doing all that stuff and putting everything to like an [15:47.590 --> 15:50.330] array, into an array, into a spreadsheet, and seeing like the [15:50.330 --> 15:53.270] top and bottom and see, like, what's, what's going on here? [15:53.270 --> 15:56.130] Like, what's the, you know, like, what's the highest address [15:56.130 --> 15:58.810] the heap actually loads onto and stuff like that? So, actually [15:58.810 --> 16:02.010] you saw that it loads under 0303 all the time. We see like an [16:02.010 --> 16:05.770] 0210, but it always loads under 03, 03, 03. So, I'm like, alright, [16:05.770 --> 16:09.790] cool. So, I start looking at the description functionality. Like, [16:09.790 --> 16:12.230] how does this work? I need to find primitives. I need to fill [16:12.230 --> 16:15.590] the heap. I need to do memory leak. Not info leak, memory leak. [16:15.590 --> 16:19.610] I need to fill up the heap. So, I start looking at this. So, I [16:19.610 --> 16:23.390] start looking at Stirling and it goes to a Calic. And I find out [16:23.390 --> 16:26.730] that that pointer there is the starting, it's the URL portion [16:26.730 --> 16:30.490] of the callback. So, after the IP colon port slash and then the [16:30.490 --> 16:33.050] end of it, that's, that's where we're at. So, that's where that [16:33.050 --> 16:37.050] pointer's to. That's slash and then like ABCD, right? The, the [16:37.050 --> 16:40.430] closing bracket is null terminated at this point. So, [16:40.430 --> 16:43.790] we're just slash. And then after that, we add some sort of size [16:43.790 --> 16:45.890] to it. So, it's going to be the size of some structure, right? [16:45.890 --> 16:48.890] So, we have some structure. And where the last element is some [16:48.890 --> 16:51.630] character buffer array. And then we call Calic. If you're not [16:51.630 --> 16:55.030] sure what Calic does, it takes the values of R1 and R0, [16:55.030 --> 16:57.770] multiplies them, checks for overflow condition. This is a [16:57.770 --> 17:01.670] very high level. And then it calls Malik, gets a pointer [17:01.670 --> 17:04.090] back, memsets it, and returns it back to you. So, everything's [17:04.090 --> 17:06.170] going to be initialized to zero. There's some other crap that [17:06.170 --> 17:08.910] goes on in there, but it's not relevant to this. So, we go into [17:08.910 --> 17:13.590] GDB. We set some break points. And, you know, we get the length [17:13.590 --> 17:15.350] and we get the return address. Because I need to learn how to, [17:15.350 --> 17:17.530] you know, I need to start spraying this stuff. So, I set [17:17.530 --> 17:20.190] up a for loop to subscribe over and over and over and over and [17:20.190 --> 17:25.830] over again. And crap. All right. I'm getting the same pointer [17:25.830 --> 17:28.870] over and over again. So, in my head, I'm like, all right, so, [17:28.870 --> 17:32.250] it's being freed, alecked again. Freed, alecked again. Freed, [17:32.250 --> 17:36.510] alecked again. What, what, like, what the hell is going on? So, [17:36.510 --> 17:40.350] step back. If I were to develop this, if I were, you know, on [17:40.350 --> 17:42.950] some team where I'm stressed out to get something delivered by [17:42.950 --> 17:46.270] the end of the week, I'm like, well, having one block for [17:46.270 --> 17:49.470] subscriptions for multiple devices makes no sense. Right? [17:49.470 --> 17:51.210] If I'm just using the same block, we're freeing one block [17:51.210 --> 17:53.030] with two devices, that's almost like you used out the free [17:53.030 --> 17:58.330] situation or only I support one device at a time. So, I go, [17:58.330 --> 18:01.130] well, let's change something in my subscription. We can change [18:01.130 --> 18:04.570] IP address maybe, change the port number, change the URL. So, [18:04.570 --> 18:08.210] for simplicity, I just do, like, a, a four I and range zero two [18:08.210 --> 18:11.570] whatever, and use the I to add it to my port range. So, we get [18:11.670 --> 18:14.530] a new, you know, port number upon every single iteration and [18:14.530 --> 18:20.330] ba-da-bing, ba-da-boom, I can now spray blocks of 4K. Awesome. [18:20.330 --> 18:23.990] I have a way to fill the heap. So, in theory, this is what I'm [18:23.990 --> 18:27.550] doing. Subscribe, subscribe, subscribe, subscribe, subscribe, [18:27.550 --> 18:30.010] subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, [18:30.010 --> 18:32.190] subscribe, subscribe, subscribe, subscribe, subscribe. So, we're [18:32.190 --> 18:34.270] just filling up the heap with a bunch of subscriptions with [18:34.270 --> 18:40.010] Different port numbers. Okay, cool, that's cool. You can fill the heap. We can spray the heap. [18:40.170 --> 18:44.390] But we still need to do some dope David Blaine magic, all right? Then we go to street magic, [18:44.390 --> 18:49.190] you know, some crazy shit. So I start reading the manual some more. We go back to the architect, [18:49.190 --> 18:54.150] you know, the specifications. And I see this request now. Unsubscribe with the publisher path [18:54.150 --> 18:58.470] with your SID. I'm like, all right, let's go back to the code. And I find this function called [18:58.470 --> 19:03.910] delete subscriber. I wonder what it does. And I see this little wrapper of free here, [19:03.910 --> 19:07.530] which literally just takes the pointer and passes the free. So I set a break point there. [19:07.530 --> 19:11.610] I go, well, what is this pointer, right? We have run time capabilities. I don't feel like [19:11.610 --> 19:15.530] spending all the time reversing all the things. Don't limit yourself to just one way. Use the [19:15.530 --> 19:21.370] easiest ways. So I'm like, oh, so if I subscribe and I reverse the array of all the SIDs that I [19:21.370 --> 19:26.390] saved and I send them to unsubscribe, they're freed. These are my blocks. I'm using the, [19:26.390 --> 19:30.870] oh, awesome. So I have an ability to spray the heap and I have the ability to free blocks at [19:30.870 --> 19:35.710] will and I can make holes in the heap if I want to or whatever, right? So back to monkeying [19:35.710 --> 19:43.130] around. Because this is the heap spray portion, but I'm like, okay, I'm still bounded by the [19:43.130 --> 19:48.750] limitations of a string. I can't do anything yet. I can fill up the heap. That's fun. But, you [19:48.750 --> 19:53.630] know, I can't use WPS monitor as a gadget yet. So I start talking to a colleague who works on [19:53.630 --> 19:57.190] different products but also has experiences with heap stuff. I'm just bouncing ideas back and [19:57.190 --> 20:01.090] forth with my colleague. It's kind of like rubber ducking. So I send him my IDB. I'm like, [20:01.090 --> 20:05.470] hey, man, I'm looking at this. You know, this is my limitations. This is what I can do so far. [20:05.550 --> 20:10.390] You know, you can look at all the references to malloc, calloc. If you're super hardcore, [20:10.390 --> 20:15.730] xmalloc. If you turn null, kill the application. Super hardcore. But we start going back [20:15.730 --> 20:19.930] forth and he asks me a question. He goes, hey, this function here about base64 decoding uses [20:19.930 --> 20:25.570] malloc. What is that all about? Like a UPnP, base64. I'm like, oh, shit. Awesome. So we go [20:25.570 --> 20:29.770] back to SOAP, the thing I did not want to talk about whatsoever. And I start looking for an [20:29.770 --> 20:34.670] action with one argument. Because I don't want to deal with multiple arguments and it just gets [20:34.670 --> 20:39.850] kind of messy. And I find this. This delete AP settings. Sure. Whatever. What kind of type is [20:39.850 --> 20:44.230] this new AP settings argument? Go all the way down to the bottom of XML. We see it's a base64 [20:44.230 --> 20:49.690] type. So we can send a SOAP request to this action and inside the XML, inside the text, we [20:49.690 --> 20:56.030] just, you know, base64 encoded string. I can base64 encode nulls. Okay. So what I do next is [20:56.030 --> 21:00.450] like, alright. So when I send this, when I send the SOAP action, I set a breakpoint, I look at [21:00.450 --> 21:05.450] the heap block. And it's actually the decoded data that I sent to it. It's not the base64 [21:05.450 --> 21:11.470] string. Awesome. I can now write nulls and I can probably use WPS as some sort of gadget if I can [21:11.470 --> 21:17.610] figure out the way to spray my fake object into the heap. So, I try this out. So we do it. We [21:18.090 --> 21:23.850] unsubscribe. We call the SOAP action. We unsubscribe. We call the SOAP action. Unsubscribe. [21:23.850 --> 21:27.950] And then I look at this. This is early development of my structure. That's why you see like 02, 02, [21:27.950 --> 21:33.450] 03, 03. Just lining everything up. The very first one is my first gadget. So whatever. But I'm [21:33.450 --> 21:37.210] trying to set things up. So I'm doing everything by hand at first and I'll, you know, I'll make it [21:37.210 --> 21:42.550] nice and pretty later. So, okay. We can spray the heap now. We're kind of almost there doing some [21:42.550 --> 21:47.250] magic. But wait. Roadblock. Alright. I do my spray. I'm doing my technique and I'm like, [21:47.250 --> 21:52.530] alright, let's look at this address and it's not there anymore. Shit. Alright. Well, what's [21:52.530 --> 21:58.390] going on? So, to think about it in layman's terms, like super simplistic, you can't build a [21:58.390 --> 22:03.090] house without a roof. Right? That seems silly. So my technique right now, I'm like, you know, I [22:03.090 --> 22:09.150] got all these descriptions. I unsubscribe. Do a SOAP action. I unsubscribe. Do a SOAP action. [22:09.150 --> 22:14.150] Unsubscribe. SOAP action. You know, blah, blah, blah, blah. And we're going down the line and, [22:14.150 --> 22:18.930] you know, and, and then the rest. Right? But then, the Linux kernel's like, usually an [22:18.930 --> 22:22.450] application, you got all this free space in malloc, or you know, in your heap, you don't need [22:22.450 --> 22:27.890] this anymore. So it eats it all away and revokes it from me and gives it to another [22:27.890 --> 22:31.610] application or anything else that needs the memory. Right? So, that's what's going on. So I'm [22:31.610 --> 22:37.030] like thinking, I'm like, well, instead of freeing everything, what if I leave the last [22:37.030 --> 22:41.650] allocation there? Because in the seconds, there's actually an option to do infinite, where it [22:41.650 --> 22:46.010] will never, ever run out of time for your description. It's forever until the, no, until it [22:46.010 --> 22:52.110] like reboots or something. But either way, so now I fill up the heap, I pop the last allocation [22:52.110 --> 22:58.530] off of my array, reverse it, now I do a unsubscribe on the second to last, and I go from [22:58.530 --> 23:09.330] there. Right? So, this is awesome. So this is working fine until, come on, until this happens. [23:09.330 --> 23:16.270] So my, my way to do the base 64 thing is writing to the same block over and over again. I'm no [23:16.270 --> 23:20.730] longer putting something on top of the free list, occupying it, it's getting freed again, free [23:20.730 --> 23:24.270] something else, put it on top. It's not, it's something else is racing to it. Something else is [23:24.270 --> 23:29.130] causing some issues. So now I've got to figure out what the hell is being freed. So I'm going to [23:29.130 --> 23:34.370] set just a simple break point on free. If it's null, just keep going, I don't care about null [23:34.370 --> 23:39.930] being passed or freed. Um, so we just keep going, and we're just going to wait. And actually it [23:39.930 --> 23:43.650] does some stuff every 60 seconds, cause there's also other imported libraries, and you know, we [23:43.650 --> 23:48.230] gotta see if they're doing something, or the main binary's doing something, cause if there's a [23:48.230 --> 23:52.690] race condition, this makes the exploit that we're trying to do much less reliable, and it's [23:52.690 --> 23:56.750] not really worth going for anymore. So I look at it, and I'm like, alright, let me send an [23:56.750 --> 24:01.570] msearch request. Because if you use Google Chrome, for example, uh, when you open up your [24:01.570 --> 24:06.750] browser, go to YouTube, your browser sends an msearch request on multicast, uh, because it's [24:06.750 --> 24:11.710] looking for something called a dial server, which is a layer of UPnP, developed by Netflix, you [24:11.710 --> 24:16.070] can find the GitHub, find the code, uh, you can also look at the Chromium, uh, code branch and [24:16.070 --> 24:21.090] find the, uh, the dial code. But anyways, we send an msearch request, we see that there's [24:21.090 --> 24:25.270] pointers being freed, okay? We find the sizes by looking at the heap header manual and stuff [24:25.270 --> 24:31.190] like that. Um, so every 60 seconds, this device sends out a notify request on multicast. Sends [24:31.190 --> 24:35.930] it out and says to everyone, hey, you know, I'm here, here's my XML, go and chat, that's cool, [24:35.930 --> 24:40.350] if not, you know, no big deal. Um, and then last but not least, if someone sends it in, like a [24:40.350 --> 24:45.410] get request, like a device is, uh, getting the XML in order to send us a request or a [24:45.410 --> 24:48.990] subscription, this is what it looks like. So I'm going over all these different instances as [24:48.990 --> 24:54.190] to, like, what can get in there, what kind of requests, and the sizes, so that I, I set up my [24:54.310 --> 24:58.830] heap a little bit differently. So that now I have two arenas. So I have one arena where I have [24:58.830 --> 25:02.630] spaces for these objects to fit into perfectly. And they can jump in there all they want, [25:02.630 --> 25:06.230] because I'm making holes. It'll never get, like, condensed or whatever. It may get trimmed, [25:06.230 --> 25:10.370] doesn't matter. Then I have my other arena where I have that last allocation being set and I do [25:10.370 --> 25:15.690] the whole thing. So now we shift gears. So now what I'm doing is a free, replace, free, [25:15.690 --> 25:21.650] replace, free, replace, blah, blah, blah. And then we do an allocation back up. So we [25:21.650 --> 25:26.550] resubscribe and we come back down. And also what we're doing is between every single [25:26.550 --> 25:31.370] iteration is that we have a UDP socket listening on multicast. We select it upon every single [25:31.370 --> 25:35.390] iteration, there's something to read, we slurp it up, and then we also maybe do some more [25:35.390 --> 25:39.990] subscriptions and replacing just to unfubar anything at the top of the free list, because we [25:39.990 --> 25:46.130] don't want anything else to race there. So, next, we can spray the heap. We can do some magic [25:46.130 --> 25:49.870] now. We can now use WPS monitor. We can write nulls to the heap and stuff like that, I guess, [25:49.870 --> 25:54.450] basics for decoding. That's awesome. Uh, but we don't have an exploit chain yet. So I'm [25:54.450 --> 25:59.690] thinking, I'm like, alright, let's cause a crash and we look at what do we control, right? Um, I [25:59.690 --> 26:03.790] don't use, like, sometimes I use, uh, like, Pwn2Bug and stuff like that, but if you use an [26:03.790 --> 26:07.970] open OCD and you have Pwn2Bug running, you have a lot of issues that may occur, so I just [26:07.970 --> 26:12.030] haven't commented on my GDB init. But anyways, the only register that we have control of [26:12.030 --> 26:16.690] really is R4. R4 points to our overflow string. And yeah, the first pointer is going to point [26:16.690 --> 26:20.110] to something in the heap, blah, blah, blah, but let's just assume the very first one is just [26:20.110 --> 26:28.130] 41, 41, 41, 41. So I have a pointer that points to my data. That's all I have. So I start [26:28.130 --> 26:31.570] looking online, I'm like, alright, let's look, think back about Internet Explorer days. Uh, [26:31.570 --> 26:35.630] you know, what did we do? Oh, we did a stack pivot, right? Uh, we have, like, one shot, so we [26:35.630 --> 26:39.530] do a stack pivot. So if this heap was executable, we have a bunch of, like, NOPs and then [26:39.530 --> 26:44.130] shellcode, NOPs, shellcode, we jump to NOPs. Wee! Uh, if we have depth, we have a bunch of [26:44.130 --> 26:48.290] returns. So, you know, we shift the stack to the, the heap and then we do return, return, [26:48.290 --> 26:51.910] return, then we have our prop gadget and call virtual protect and we execute shellcode, [26:51.910 --> 26:56.810] ba-da-bing, ba-da-boom. So I start looking online and I see this. So this was from 2012, a [26:56.810 --> 27:00.950] Rockstown talk about exploiting stuff on R and blah, blah, blah, and it has this load [27:00.950 --> 27:04.810] multiple decrement before instruction. And what, what does it do really? And it's saying [27:04.810 --> 27:08.710] that, oh, you know, if you have a source register, you can populate the other registers and [27:08.710 --> 27:13.010] you can, you know, do a stack pivot because it writes to SP. I'm like, oh, man, god. So I, I [27:13.010 --> 27:17.610] open up Redere and I look for this load, uh, deduct multiple, uh, load multiple deduct before [27:17.610 --> 27:22.650] with R4 and I see some instructions, so I plug it in, very first thing, and illegal [27:22.650 --> 27:29.730] instruction. Well, what the hell? Like, what? Why? So we look at the ARM manual and we see [27:29.730 --> 27:34.450] this restriction on the second line, the register destination list cannot contain SP. The [27:34.450 --> 27:39.290] destination list that I had before has SP, the second to last one. This is now an illegal [27:39.290 --> 27:43.570] instruction. I can't use this technique on this device. So, alright, back to the drawing [27:43.570 --> 27:49.730] board. So what I do next is I develop a regex for IDA. I'm looking for load where the, the [27:49.730 --> 27:54.290] last, uh, last register, you know, second operand or whatever of that opcode is, uh, R4 [27:54.290 --> 27:58.850] being dereffed. That's all, that's what I want. So I set up a regex to do that and I find a [27:58.850 --> 28:02.690] bunch of them, I go through them by hand and I find this gadget here. And it says like [28:02.690 --> 28:08.490] dereff R4 and R3 and we add all these offsets and we get R2 and we have R1 and R0. I'm [28:08.490 --> 28:13.930] spraying 4K blocks here, hex 1000 is 4K. So we're just going to jump into another block that [28:13.930 --> 28:18.890] I, I'm in control of with my data. So this right here gives me the primitive of calling a [28:18.890 --> 28:24.370] function with two arguments. Okay, cool. But the problem is though, once, once this [28:24.370 --> 28:29.110] function, like once what I call returns, it's going to use the stack now and it's going to pop [28:29.110 --> 28:34.130] PC and I no longer have control. So I only have a one shot situation. So I'm thinking, I'm [28:34.130 --> 28:39.710] like, what can I do? I'm like, alright, so let's look at functions that write, like that write [28:39.710 --> 28:43.870] to memory that are not bounded by uh character limitations. So I started looking at mem [28:43.870 --> 28:47.430] copies. This thing has tons of them. So, you know, I'll put on my music or whatever and I [28:47.430 --> 28:55.470] start grinding through this and uh, I find this mem copy here and you don't have to read all [28:55.470 --> 28:59.770] this. I know it's probably hard in the back and I apologize. I'll sum it up. So this right [28:59.770 --> 29:04.770] here, if you look at the second to last instruction, R0, the destination, is a stack based [29:04.770 --> 29:11.230] buffer. Even though the stack frame is kind of large at like 2K, you know, hex 800, uh, we [29:11.230 --> 29:16.610] still have a destination buffer that's a stack. And R0 and R1 are in our control now because [29:16.610 --> 29:23.290] that was the last gadget that gave us control. And R1's in R4, R0's in R5, we look in, R4 is N, [29:23.290 --> 29:28.950] R5 is the source. So instead of bringing the stack pointer to the heap, like fuck it, let's [29:28.950 --> 29:33.090] just bring the heap to the stack. Just clobber the shit out of the stack. I control N. I can [29:33.090 --> 29:37.250] clobber the shit out of the stack. So that's what I do. And we look at the bottom of this thing [29:37.250 --> 29:42.030] so we adjust the stack frame so we have to be careful now. This is a large adjustment, 2K. So [29:42.030 --> 29:46.170] we're not going to jump back and do stuff. We're now just incrementing the stack. We have to be [29:46.170 --> 29:50.410] careful not to run out of stack space and cause, uh, you know, like an interrupt to happen or a [29:50.410 --> 29:54.790] signal to happen and kill the program. So now we have control of R4 to R7 because now we [29:54.790 --> 30:01.630] brought the heap to the stack. So now, next gadget. R7 is going to contain a pointer to the [30:01.630 --> 30:09.530] IAT table entry, uh, inside WPS marks where it's not ASLR'd, uh, of str2 unsigned long. But with [30:09.530 --> 30:15.130] the pointer of minus 4. And this next slide you'll see why. So then after that we pop from [30:15.130 --> 30:21.910] the stack R3 to R7 PC. Next thing. We deref R0 now, which is now going to take the IAT table [30:22.510 --> 30:28.250] plus 4 and it's going to, it's going to deref that pointer from the IAT table and now we have a [30:28.250 --> 30:33.930] libc function, uh, pointer. Now we're inside libc at str2 unsigned long. We don't need to leak [30:33.930 --> 30:41.350] it anymore. Pop from the stack. Next one. We add R3 because look, we have R3 to R7. R3, uh, it's [30:41.350 --> 30:45.490] going to be an offset now. We're going to add it, well R3 and R0 are going to be added together [30:45.490 --> 30:49.690] and we're going to save into R0. So now it takes str2 unsigned long, I take an offset and I add [30:49.690 --> 30:55.610] it and I get to, since system wasn't working and I didn't want to debug it, P open. So since [30:55.610 --> 31:00.630] the system, since the, uh, WPS monitor didn't use system, it didn't import P open or anything [31:00.630 --> 31:04.550] else I can use to execute shell commands, uh, since back in the day, like, you know, uh, with [31:04.550 --> 31:10.790] inter explorer exploitation, uh, if you had some way to get into kernel 32 DLL, you just add or [31:10.790 --> 31:15.210] minus an offset to get to virtual protect in order to make the, you know, allocation that you [31:15.210 --> 31:18.870] want executable or whatever the hell you wanted to do with the permissions. So then from there, [31:18.870 --> 31:24.170] gadget six, this looks really large, but we can pick another allocation that's like maybe a [31:24.170 --> 31:28.750] megabyte away. We don't care. We're going to write to the heap now. We have a pointer to P [31:28.750 --> 31:32.510] open and all these gadgets I found by hand. If I try to use some wrapper thing and try to [31:32.510 --> 31:35.850] automate it, I would not have found these gadgets. Wrapper and everything. So I'm going to say, [31:35.850 --> 31:41.110] hey man, there's a mem copy with R0 and R1 or R1 and R2 and R0 being stacked. It's not going to [31:41.110 --> 31:44.470] tell me that. So anyways, this right here, I'm going to write to the heap. I'm going to write [31:44.470 --> 31:50.810] the P open pointer that I just calculated into the heap now. Keep going. We're almost kind of [31:50.810 --> 31:56.070] towards the end of the stack limitations here. So now I invoke gadget one again, which is our [31:56.070 --> 32:01.350] last gadget, gadget seven. So this one, remember, I can call something with two arguments. So R2 [32:01.350 --> 32:05.810] is going to be P open. R0 is going to be a string. R1 is going to be R because you have to [32:05.810 --> 32:11.470] provide something for P open. And then, okay, cool. So let's put it all together. So we [32:11.470 --> 32:16.250] spray the heap. We save all the subscription IDs. We don't free the last subscription ID, [32:16.250 --> 32:21.550] that's our roof. We free and replace the blocks with unsubscribe and we replace everything with [32:21.550 --> 32:26.150] the soap action with base 64 encoded fake structure, our ROP chain, and ending with the [32:26.150 --> 32:31.050] command. Everything is aligned to 256, or actually, yeah, so everything is 256 by the line, [32:31.050 --> 32:36.350] whatever. So we free five, reoccupy five, free them again, go to the next five. If anything [32:36.350 --> 32:40.590] comes in multicast, fix up the heap if needed by doing resubscriptions and freeze again. [32:41.370 --> 32:48.130] Trigger volume, maybe we win. So we sue everything and we see this, right? So let's check [32:48.130 --> 33:01.930] out this guy. Why is it at 11%? No! It is at 11%. Why is it 11%? All right. So I guess I'm [33:01.930 --> 33:13.070] not doing the exploit live anymore. That sucks. Oh, that sucks. Oh, no. Why? It's on. All [33:13.070 --> 33:17.850] right. I'm sorry. I guess I'm not doing this live. It is reliable. I can demo it later if you [33:17.850 --> 33:24.770] guys want to see it. But it's all right. We're stuck at 11%. What we were doing, though, [33:27.110 --> 33:31.790] was the free and replace of everything that we were doing. We create two arenas and we're [33:31.790 --> 33:37.110] going all the way down. It should have been around 60% by now or so. So that's all right. [33:37.930 --> 33:44.610] Man, let's see down here. But anyways, if this was working properly and didn't want to just [33:45.250 --> 33:50.290] foobar out of nowhere, we would be in the context of doing all that stuff. But the funny part [33:50.290 --> 33:56.570] about this as well, just to look up, is that there's actually one process. Let's see here. [33:56.570 --> 34:02.770] One process ran by nobody. It's another UPnP server. So whoever actually made the process, [34:02.770 --> 34:08.250] you know, the process run under nobody, like, that guy deserves a high five. So anyways, let's [34:08.250 --> 34:14.870] go back to everything. Man, I really wanted to show that shell. Oh, well, it's actually still [34:14.870 --> 34:20.730] going. It's just going really slow. Anyways, so we do have a shell. And I wanted to show you [34:20.730 --> 34:25.110] guys some bonus stuff as well. So besides the shell and all that stuff, so before, remember I [34:25.110 --> 34:29.090] was saying that, you know, I was looking at daemons that were running on a particular, you [34:29.090 --> 34:34.250] know, all interfaces or just a LAN. And I found one 5916 that was being filtered by IP [34:34.250 --> 34:40.770] tables. So I started thinking, I'm like, huh, what if we use that genus stack to pivot, like a [34:40.770 --> 34:47.350] server-side request forgery, right? So we set the callback address to 120 localhost 5916 with [34:47.350 --> 34:52.530] this URL. And so we attach strace to that daemon to see if anything's coming in. We send the [34:52.530 --> 34:57.810] request, and yes, we do get that. So if you are trying to hit something that's maybe token [34:57.810 --> 35:02.510] based, so it's a TCP-based connection, and maybe it's like, oh, it's doing like structure, [35:02.510 --> 35:06.190] they start to be getting up something or stir, like a stir stir, like some sort of substring [35:06.190 --> 35:09.030] that's token based, you can use this to maybe hit that part of the code, maybe change [35:09.030 --> 35:14.470] configuration or something like that. So it's a way to pivot. So last but not least, I also [35:14.470 --> 35:20.730] wanted to give a fuzzing demo, but I'm not sure if it's, if it's going to cooperate with me. [35:20.730 --> 35:25.510] But I mean, after all this, so finding the vuln and all that stuff taught me something [35:25.510 --> 35:30.950] valuable. So I was doing this by hand, and I was like, you know what? I've been finding a lot of [35:30.950 --> 35:34.770] the same kind of programming issues with this protocol and stuff like that. I have a [35:34.770 --> 35:38.770] background in network engineering, I also have a background in QA, so I was like, let me [35:38.770 --> 35:43.310] start making a fuzzer. And I encourage everyone else to do this as well, because what do we [35:43.310 --> 35:47.430] have? We just have HP, we have XML. If you could just make something to just send out an [35:47.430 --> 35:53.010] attempt search request, get the, you know, get the, the XML file back and just parse that, [35:53.010 --> 35:57.270] make an XML parser, go through everything, save everything, make your own fuzzer. You'll save [35:57.270 --> 36:01.030] so much time. So instead of a few days, like it took me by hand to find this vuln, it would [36:01.030 --> 36:07.070] have taken me 30 seconds. So actually, let's see. Now it's going. It's going now. Alright, [36:07.070 --> 36:13.370] so maybe if we have time towards the end, I'll, I'll check up on it and see if we're, if we're [36:13.370 --> 36:21.630] all good. So anyways, man, everything going wrong is. That's awesome. So anyways, so if an [36:21.630 --> 36:27.430] ISP asks you, and this is going to be super cheesy, but whatever, I'm going to do it. If an [36:27.430 --> 36:32.630] ISP asks you, could you, would you install this router in your house? You must say, no, I do [36:32.630 --> 36:36.110] not, would not install this in my house. I do not want it here or there. I do not want it [36:36.110 --> 36:39.670] anywhere. I wouldn't want it for free. I wouldn't want it if it could download up to 10 GB. [36:39.670 --> 36:46.250] But anyways, that's enough of that stuff. This is who I am. So I go by Black Owl Online. [36:46.730 --> 36:52.150] Someone had the real name Black Owl, so I changed the L21020. Cool. Elite sauce. What up? [36:52.390 --> 36:57.670] I'm a zero-day researcher at Exodus Intelligence. I do embedded devices, both SOHO, I do [36:57.670 --> 37:02.750] enterprise network solutions, firewalls, virtual appliances, whatever. I don't care. If I can [37:02.750 --> 37:08.350] get it, I'm going to audit it. Smart devices or anything else that catches my eye. We're also [37:08.350 --> 37:11.530] hiring at Exodus Intelligence. We're looking for another zero-day researcher if you're [37:11.530 --> 37:15.630] interested for getting paid for finding no-days. I get a bonus on top of that for selling your [37:15.630 --> 37:20.250] phones to us. Like, you know, hit me up. But that's about it. So again, that's who I am. [37:20.250 --> 37:24.050] Thank you for coming to my talk labeled Green Waves in Ham. Take care.