[00:00.850 --> 00:01.660] Hello. [00:02.300 --> 00:09.180] This is how I got to top 250 on Hack the Box using Nix and LLMs. [00:12.340 --> 00:15.760] First of all, sorry for adding to the AI slop. [00:24.140 --> 00:25.760] My name is Rambo. [00:26.080 --> 00:27.780] It's my real name. [00:28.920 --> 00:33.180] I'm going to tell you why it's my real name because everybody is going to ask it anyways. [00:33.820 --> 00:39.480] My parents were political refugees in the 80s and 90s. [00:39.480 --> 00:44.500] Back then, they had cultural immersion programs before you could come to the States. [00:44.600 --> 00:47.960] And you had to learn English. [00:48.040 --> 00:52.200] And part of the cultural immersion was that you got to watch American movies. [00:52.280 --> 00:55.800] And one of the most popular movies at the time was Rambo. [00:57.040 --> 01:06.060] So they thought, hey, let's give this kid a common American name and not ruin his life. [01:06.980 --> 01:12.100] But yeah, I got a lot of machine guns and whatnot and bowling in school. [01:12.100 --> 01:14.140] So thank you, parents. [01:16.860 --> 01:18.540] I'm an offensive security person. [01:18.540 --> 01:19.920] I do red teaming. [01:20.260 --> 01:24.100] And I'm not a Nix specialist and I'm not an AI specialist. [01:24.580 --> 01:28.580] I don't think there's a lot of AI specialists, to be fair. [01:30.120 --> 01:34.860] Oh, and by the way, I just found out that what I do, Pack the Box, offers as a service now. [01:34.860 --> 01:36.920] But I think it's still in alpha or beta or something. [01:36.980 --> 01:40.560] So if anybody can get me into that, let me know because I'd love to try it. [01:45.920 --> 01:47.940] And all this is on my GitHub. [01:48.740 --> 01:53.760] Like I said, don't judge the Nix code too much because I've seen some of the presentations from here and there. [01:54.460 --> 01:55.360] It's janky. [01:56.540 --> 02:01.180] If you guys don't know what Hack the Box is, it's like a CTF platform. [02:01.260 --> 02:02.820] I'm not sure most of you know what it is. [02:03.580 --> 02:09.560] And the goal is, the flag anyway, is usually two text files on a machine. [02:09.560 --> 02:11.720] Usually a user and a root one. [02:11.720 --> 02:14.720] And the root one means you have complete access over to the machine. [02:15.360 --> 02:19.040] And you usually have unauthorized access to these computers. [02:19.040 --> 02:20.920] So you're doing real hacking. [02:21.820 --> 02:22.920] And you get to... [02:26.660 --> 02:29.440] And here's what the GUI looks like when you go on the website. [02:29.460 --> 02:33.980] So on each machine, you get to go in there and you get to boot it up. [02:34.360 --> 02:37.340] I would say that it targets three main audiences. [02:37.540 --> 02:41.400] The first is newbie students and learners that want to get into offensive security. [02:42.320 --> 02:50.440] And it's awesome for that because you can go into these boxes and if you mess up, because you're doing hacking and broke the machine, you can just reboot it. [02:50.920 --> 02:55.120] And it's really great for hands-on hacking and training. [02:55.540 --> 02:59.900] The second audience is probably professional pen testers and red teamers like myself. [03:00.160 --> 03:07.800] So if there's super popular exploits on the news and stuff like that, I'm 99% sure it's on Hack the Box already. [03:07.800 --> 03:09.860] So I'll go on there and I'll spin up a box. [03:09.860 --> 03:18.700] And you don't have to worry about creating a dev environment and getting the right version numbers and the right context to try out these new hacks. [03:18.700 --> 03:20.160] So it's pretty awesome for that. [03:20.920 --> 03:24.960] And the third audience is gamification nerds. [03:26.260 --> 03:27.900] There's a leaderboard. [03:28.960 --> 03:30.920] People get really into this. [03:32.600 --> 03:38.420] You get more points based off of the total amount of machines that you've hacked. [03:38.420 --> 03:41.440] And there's active machines. [03:41.800 --> 03:44.320] And after a certain amount of time, they retire them. [03:44.380 --> 03:46.600] I think they release a machine every week. [03:46.600 --> 03:49.420] And I don't remember the cadence for the challenges, but it's like... [03:49.420 --> 03:51.460] They keep it updated. [03:51.460 --> 03:51.920] It's nice. [03:51.920 --> 03:56.800] Oh, and I'm using Hack the Box just because it's the first one that I used. [03:58.640 --> 04:01.200] TryHackMe and all the other ones I think are just as good. [04:01.980 --> 04:07.200] Oh, and also this one does automatic CPE submissions, which I'm lazy, so that's nice. [04:08.440 --> 04:09.600] Here's the results. [04:10.080 --> 04:13.440] Because I like to start with the results first so you guys can leave if you think it's boring. [04:16.560 --> 04:19.480] This will not replace a red teamer. [04:19.900 --> 04:27.280] AI is nowhere near close to replacing a red teamer, web app person, pen tester, or even a junior, junior, junior pen tester. [04:27.300 --> 04:29.080] So we'll get that out of the way. [04:30.320 --> 04:42.020] And also, giving a jailbroken LLM full access, full admin access to your computer, if that computer has real data on it, or you're hacking something actually sensitive, is a bad idea. [04:42.020 --> 04:44.440] So don't be an idiot about this stuff. [04:45.160 --> 04:47.020] Oh, and there's OPSEC to worry about, too. [04:48.460 --> 04:51.380] Okay, so here's where I started on Hack the Box. [04:51.820 --> 04:57.100] I did a lot of this when I was doing my OSCP, just for the extra training. [04:57.100 --> 04:59.020] I was actually in the thousands. [04:59.020 --> 05:01.060] I forgot to take a screenshot earlier. [05:01.360 --> 05:02.620] But I was stuck here. [05:02.820 --> 05:04.420] And a thousand isn't bad. [05:04.420 --> 05:09.060] It's like running a five or six minute mile, being a... [05:09.060 --> 05:10.520] This is so stupid. [05:10.520 --> 05:14.240] Being a 70% free-throw shooter or benching more than 200 pounds. [05:14.260 --> 05:16.320] If anybody has better examples, let me know. [05:16.360 --> 05:17.500] It's not bad. [05:17.500 --> 05:21.420] If I tell somebody, hey, I'm top 1,000, they'd be like, oh, yeah, this guy kind of knows what he's doing. [05:23.940 --> 05:29.920] And if you get to top 200, top 250, that usually means there's something wrong with you. [05:30.220 --> 05:33.840] Because you don't need to be that hardcore about this stuff. [05:33.840 --> 05:35.200] For learning, anyways. [05:36.500 --> 05:38.600] So yeah, I got top 200. [05:39.260 --> 05:41.440] That's the best rank I got. [05:41.620 --> 05:43.920] Using this system. [05:45.520 --> 05:46.180] Okay. [05:46.180 --> 05:47.940] I'm a workflow person. [05:47.940 --> 05:49.340] Obviously, I'm here in Nix. [05:49.340 --> 05:51.020] I love the declarative stuff. [05:51.020 --> 05:54.660] I've used AI in red teaming for development. [05:55.820 --> 05:57.740] And to help office gate payloads. [05:57.740 --> 05:58.420] Stuff like that. [05:58.620 --> 06:01.000] I have high hopes for this stuff. [06:01.000 --> 06:04.860] Because I've seen it used pretty effectively. [06:08.060 --> 06:10.260] So this is like a small demo. [06:10.900 --> 06:14.520] I think it's GPT 4.0 or 4.1 or something like that. [06:14.580 --> 06:16.920] Where I just gave it full access to my computer. [06:16.920 --> 06:18.240] Gave it access to a browser. [06:18.700 --> 06:21.480] And told it to have at it. [06:22.680 --> 06:25.080] And this is just the tutorial. [06:25.680 --> 06:26.920] So my cursor is on the right. [06:26.920 --> 06:28.240] It's cursor is going to be on the left. [06:28.280 --> 06:30.760] This is all the AI doing it all. [06:30.760 --> 06:33.040] This is the starting point. [06:33.700 --> 06:34.580] Tutorial. [06:34.980 --> 06:38.780] I was just like, it would be cool if it could do the stupid stuff for me. [06:39.280 --> 06:41.800] And I just wanted to see how far it can get. [06:44.120 --> 06:44.740] Yeah. [06:44.740 --> 06:45.560] As you can see. [06:45.700 --> 06:48.140] It's answering some of the questions for me. [06:48.500 --> 06:50.020] And doing the clicking for me. [06:50.020 --> 06:51.780] So it's kind of nice. [06:52.700 --> 06:54.840] And yeah, you can Google all this. [06:54.840 --> 06:57.020] But I just wanted to know. [06:57.020 --> 06:58.920] How good is AI now? [07:00.340 --> 07:01.700] And I think it starts to... [07:01.700 --> 07:03.880] In a little bit, you'll see it start to trip up. [07:04.000 --> 07:05.900] It's asking a super basic question. [07:05.980 --> 07:07.540] There's an SMB share. [07:09.000 --> 07:12.520] Figure out how many shares are on that SMB share. [07:18.310 --> 07:19.990] Yeah, and it's going to... [07:22.050 --> 07:24.770] Oh, and I could have asked it to do all this automatically. [07:24.770 --> 07:26.550] I just thought this would have been better for the demo. [07:26.550 --> 07:28.050] But whatever. [07:30.410 --> 07:31.130] Okay. [07:34.220 --> 07:37.040] So here, it's going to start tripping up. [07:37.660 --> 07:40.680] It's going to start trying 1, 2, and so on, and so on. [07:40.680 --> 07:42.280] And I'm just like, no. [07:42.340 --> 07:43.780] Just interact with it. [07:43.780 --> 07:44.780] Figure it out. [07:45.460 --> 07:48.040] It's clearly not there. [07:49.640 --> 07:51.540] Oh, and this is also sped up two times. [07:51.540 --> 07:55.000] So at the moment, while I was doing this, it was pretty frustrating. [07:55.740 --> 08:01.940] If I told a human to interact with this website, they would obviously be able to figure it out. [08:01.940 --> 08:03.220] And yeah. [08:03.220 --> 08:05.920] I think at the end there, it finally gets it. [08:13.620 --> 08:15.220] Yeah, I have to be like, there you go. [08:15.340 --> 08:15.840] There you go. [08:16.860 --> 08:18.620] And it finally figures it out. [08:18.620 --> 08:20.260] Oh, there's four shares or whatever. [08:21.820 --> 08:22.620] Okay. [08:22.720 --> 08:24.280] So here are my requirements. [08:24.280 --> 08:29.620] I don't think it's that interesting to have the AI... [08:31.020 --> 08:31.860] L-O-M. [08:31.860 --> 08:33.540] I know there's a difference. [08:33.820 --> 08:36.840] To have the AI fill out web forms for you. [08:36.840 --> 08:38.400] Like, whatever. [08:39.600 --> 08:42.660] And we're clearly not at full-blown hacking AI yet. [08:42.660 --> 08:47.000] But I also don't want to be like, hey AI, do this and this and this for me. [08:47.140 --> 08:50.260] It reminded me of this blue sky post I saw. [08:50.260 --> 08:55.040] Of the AI folks finally figuring out thinking. [08:56.820 --> 08:57.660] Yeah. [08:57.660 --> 09:01.260] I don't want to have to hold the AI's hand for it the whole time. [09:03.580 --> 09:06.220] So I want something better than that. [09:06.220 --> 09:08.380] Something better than just a Googling assistant. [09:08.680 --> 09:11.540] But it also doesn't have to be 100% autonomous. [09:11.740 --> 09:14.960] So from now on I'm going to rate it from 0 to 100% autonomous. [09:15.080 --> 09:18.220] Where 0 is just like, why am I even using this? [09:18.220 --> 09:18.920] You're doing nothing. [09:18.920 --> 09:21.200] And 100% is filling out the web forms for me. [09:21.500 --> 09:24.220] Anything above 20% I'd be scrapped with. [09:24.380 --> 09:26.640] And I'm going to give it a bunch of tools. [09:26.640 --> 09:28.220] Have it be agentic. [09:28.220 --> 09:33.480] I'm going to give it MCP tools, model context protocol or something like that. [09:33.780 --> 09:35.680] In other words, it's going to be agentic. [09:38.020 --> 09:45.680] Alternatively, if this stuff isn't interesting, you could simply just jailbreak an AI and just copy-paste your shit. [09:45.980 --> 09:47.120] That works too. [09:47.120 --> 09:49.040] But I thought this was more interesting. [09:50.000 --> 09:53.020] Here's the initial architecture that I wanted to come up with. [09:54.020 --> 09:57.580] First and foremost, you've got to do an ethics bypass. [09:57.580 --> 10:03.640] Spider-Man meme of red teamer, CTF-er, and actual bad actor. [10:04.020 --> 10:09.180] Every once in a while the AI is going to be like, hey, you can't do that, and I'm not going to do that for you. [10:10.060 --> 10:14.460] Or it's going to be like, I'm not going to tell you how to do that, here's how to fix it. [10:14.460 --> 10:16.060] And it's the most annoying thing ever. [10:18.500 --> 10:19.940] And this is all I needed. [10:19.940 --> 10:21.480] I didn't really need any jailbreaks. [10:21.540 --> 10:23.240] I used a client called Goose. [10:23.980 --> 10:26.500] I like Goose because it's written in Rust. [10:26.520 --> 10:31.220] It's got a GUI and a terminal version of itself, which I'll go into later. [10:31.660 --> 10:34.380] I like the name because I'm from Minnesota. [10:35.580 --> 10:38.100] Oh, yeah. [10:38.100 --> 10:38.960] And then... [10:39.980 --> 10:41.520] Yeah, I like that it's open source. [10:42.300 --> 10:55.400] So I had the client first use Copilot, and if that fails ethics, I would kind of have it eat its own tail, and then try all the other LM providers, and then finally I would have it use DeepSeq, because DeepSeq would let you do anything. [10:55.860 --> 11:00.080] I think I used the GWEN version, the one that's good with tools. [11:00.420 --> 11:01.540] I don't remember. [11:02.200 --> 11:10.880] Near the end of this, I think I came across an accidental jailbreak or something where I just simply didn't need any jailbreaks anymore because of my prompts. [11:11.780 --> 11:15.940] Here are some alternatives if you only have access to one of those LM providers. [11:16.360 --> 11:25.500] There's a custom chat GPT made by Ayla Croft that a couple of weeks ago bypassed Windows Defender when I tried to do some obfuscation. [11:25.980 --> 11:27.160] So that one's sick. [11:27.160 --> 11:30.500] There's a bunch of subreddits with jailbreaks that you can just copy-paste. [11:30.500 --> 11:31.800] A lot of them work. [11:31.840 --> 11:37.080] Fair warning, a lot of these are porny because that's what the Internet's for. [11:41.960 --> 11:47.400] Here are the tools that I used as far as MCP tools to make it agentic. [11:47.640 --> 11:50.160] I honestly mostly only used the shell. [11:50.260 --> 11:54.060] I gave it pseudo-access so it had access to my system files as well. [11:54.060 --> 11:55.280] Again, bad idea. [11:56.120 --> 11:59.380] I gave it memory, which is just to do stuff like save credentials. [11:59.660 --> 12:04.360] The second most useful thing was the browser. [12:04.360 --> 12:12.820] Having it be able to not just click things for me but actually scrape websites and do research for me was really nice. [12:13.900 --> 12:14.980] What else? [12:14.980 --> 12:16.900] I added Geezer on there. [12:17.240 --> 12:19.360] The one made by Lori Wired. [12:20.260 --> 12:21.620] That one was amazing. [12:21.620 --> 12:24.800] I surprisingly needed it for a bunch of things on Hack the Box. [12:24.800 --> 12:26.300] Especially the challenges. [12:26.600 --> 12:27.800] I had Burp on there. [12:27.800 --> 12:35.720] There's a really good Burp MCP, but I found that it was taking up too many context windows and I just found it easier to use it myself. [12:36.680 --> 12:37.760] Burp's awesome. [12:37.760 --> 12:41.700] I will get into Nix later, but I promise it's important. [12:42.220 --> 12:48.940] Finally, Graph Memory, which is probably the best thing ever for this thing. [12:50.940 --> 12:52.600] Think of it as a relational database. [12:52.600 --> 12:59.260] It's more like a bunch of JSON files strung together that can talk to each other. [12:59.440 --> 13:00.600] I recommend... [13:01.500 --> 13:04.800] Oh, if you use the Bloodhound, it's really similar to that. [13:04.800 --> 13:06.660] Except just for a knowledge base. [13:07.580 --> 13:11.040] For AI, I found that the more context you give it, the better. [13:11.040 --> 13:13.700] That way you can avoid stuff like in the previous demo. [13:15.820 --> 13:26.880] Instead of having a full-on system or custom prompt to start off with, I had it instead go to my knowledge base depending on where I was at. [13:27.140 --> 13:28.940] I would try to build off of... [13:28.940 --> 13:36.600] Each time I finished a box on Hack the Box, I would have it record everything that it did into boxes and all this stuff. [13:36.600 --> 13:39.360] It would get better and better, was the idea. [13:40.600 --> 13:45.600] I had to do this because when I started doing this, the context windows... [13:45.600 --> 13:51.200] Context windows, by the way, when talking to an LLM, is basically the conversation that you're having. [13:51.200 --> 13:56.000] Usually, when I started this, the context window was 250,000 tokens. [13:56.140 --> 13:59.120] A token is basically a word or a symbol. [13:59.340 --> 14:09.820] If you picture an mMap scan, like having the AI read an mMap scan or even a Limpy's privilege escalation scan, 250,000 words gets eaten up fast. [14:09.820 --> 14:11.030] I had to basically... [14:12.300 --> 14:17.720] as much as I could limit how much I was sending to the LLM. [14:18.140 --> 14:19.620] I don't remember how it goes. [14:19.620 --> 14:23.240] Why use many words when fewer do good? [14:23.240 --> 14:24.180] Something like that. [14:24.220 --> 14:31.940] It's the same concept here, and I found that using graph memory made it so it only had to go to certain areas if it needed to. [14:36.180 --> 14:39.300] I did a guided improvement approach. [14:39.440 --> 14:46.600] I wanted to use the words reinforcement learning or fine-tuning, but that means something special in machine learning, so I couldn't use it. [14:47.080 --> 15:05.740] I gave the LLM access to its own system prompts, and Goose is really nice for this because Goose has something called Goose Hints, which, and you might see where I'm going with this later, it's a text file in the directory that, when you start up the client, [15:05.740 --> 15:08.180] is kind of like the prompt. [15:11.380 --> 15:20.380] Here's an example in LLM Studio where there's a system prompt on the bottom, and then there's a template on top. [15:21.400 --> 15:33.600] This is different, by the way, for every client and every model, so that's why I'm not giving fine-tuning examples. [15:33.720 --> 15:38.980] Oh, I'm using Goose, but you can use VS Code, there's a bunch of different options, by the way. [15:41.360 --> 15:44.740] Here was my first shot at a box. [15:44.740 --> 15:47.500] I found that it helped me out 10%. [15:48.340 --> 15:50.400] This is really nice, actually. [15:50.400 --> 15:58.840] I basically fed it my OSCP methodology, which is how to do recon and exploit and stuff like that. [15:59.020 --> 16:01.200] It was basically a better auto-recon for me. [16:01.200 --> 16:08.340] Auto-recon is a reconnaissance script because it's basically using the tools that I want. [16:09.400 --> 16:10.380] And talk. [16:10.380 --> 16:11.640] This is really nice. [16:12.380 --> 16:13.300] Oh, shit. [16:13.420 --> 16:14.520] I'm in the wrong... [16:14.520 --> 16:15.820] Oh, no, this is fine. [16:16.140 --> 16:17.880] Let me scroll down a little bit. [16:19.380 --> 16:20.060] Yeah. [16:21.460 --> 16:25.500] I'm not saying this made it 10% faster, it just made it 10% easier on my brain, by the way. [16:26.600 --> 16:28.060] Yeah, this is great. [16:28.940 --> 16:30.800] Let's see how much better it can get. [16:31.440 --> 16:37.880] I did it two more times, and as you can see, it did a lot better, added a bunch more... [16:38.660 --> 16:40.400] did a lot more for me. [16:40.400 --> 16:42.420] It was only 15% better. [16:42.600 --> 16:47.600] I did come across an issue around here where... [16:47.600 --> 16:49.280] I'm going to have a hard time explaining this. [16:50.520 --> 16:54.500] What I was asking it to do was pattern recognition. [16:55.400 --> 17:04.160] And what I actually want an LLM to do, and this is more akin to human thinking, is I want recognition on pattern recognition. [17:04.160 --> 17:15.360] So pattern recognition is like password 123 worked once on a credential form, so now you're going to try it every single time you see credentials, or like a form. [17:16.460 --> 17:28.380] And recognition of a pattern recognition is, and what you actually want to tell the LLM is having it understand when you want to brute force a credential form. [17:28.720 --> 17:37.340] Or like when the creator of the machine set it up so that you can do that purposefully, like crack a password or a hash or something like that. [17:40.600 --> 17:41.300] And... [17:41.300 --> 17:44.880] this is where I updated graph memory. [17:45.480 --> 18:05.640] So instead of having each box do its own thing, I had each phase of hacking be the knowledge base, and each time I upgraded the prompts in the LLM itself, I would usually just update one area of this. [18:05.640 --> 18:15.320] And this felt really similar, like when I did my OCP and trained to be a pen tester, this is actually a lot more similar to how I did it anyway, so I really like that. [18:17.880 --> 18:20.880] Yeah, the prompts were basically better. [18:21.240 --> 18:23.720] This is an example of the organization phase. [18:23.720 --> 18:31.160] It would do the folder structure for me, it would do stuff like add variables, like some nice things to have as you're doing hacking. [18:36.360 --> 18:41.240] I did this several times, and it went well beyond my expectations. [18:41.240 --> 18:42.940] It was like 70% autonomy. [18:43.560 --> 18:45.560] I was really happy with this. [18:45.760 --> 18:48.240] In this graph, by the way, it's the same. [18:48.600 --> 19:00.720] It branches out, this is really similar to how I do hacking on Hack the Box, except this time I added tools to the diagram, so you can see each time it was agentic. [19:02.540 --> 19:08.080] I mostly did the developer shell, on the right here I think there's browsers and stuff like that. [19:08.340 --> 19:11.320] This was really nice, well beyond my expectations. [19:12.500 --> 19:15.940] I was able to do really good. [19:18.380 --> 19:20.300] So let's see how much better I get. [19:20.600 --> 19:21.780] 90%! [19:23.660 --> 19:25.580] I was like, ecstatic. [19:26.520 --> 19:27.560] Yeah. [19:28.180 --> 19:37.980] I did one more box after I got 90%, and I told myself I wasn't going to crash out, but I can feel it already, because I never figured out this problem. [19:41.740 --> 19:51.680] So, for some reason, instead of shell, when I did the tool calling, it renamed itself to hell. [19:51.760 --> 19:57.280] And there's a red dot there, where shell should be, on the bottom there, it's supposed to look like that. [19:59.940 --> 20:03.060] Goose is a compiled binary. [20:03.460 --> 20:05.280] I don't know how this happened. [20:07.360 --> 20:12.380] I asked it why it did this, and I sent a bunch of screenshots to my friends, asking if I'm hallucinating. [20:16.620 --> 20:20.020] Asking if I'm hallucinating, and I had to take a break. [20:20.760 --> 20:25.640] I told the LLM what happened, it said it didn't know, it was just a typo. [20:26.240 --> 20:33.240] I had to take a break, come back, restart it to get it going again, and it came back to normal. [20:36.120 --> 20:49.080] After taking a break, I came back to the machine, started doing some digging, looking through my logs to try to figure out that bug, because it was kind of interesting, and weird. [20:55.800 --> 21:02.020] I didn't have any logs, because I was so concerned about the context windows. [21:02.600 --> 21:12.000] I was just telling it, hey, you're an AI assistant, you're here to help me, don't tell me how to fix things, don't tell me how it works, just give me how to do it. [21:12.000 --> 21:14.700] Because I'm trying to rank up here, buddy. [21:19.280 --> 21:25.320] I ended up going through my firewall logs, shout out to firewall logs, that made this really easy. [21:25.840 --> 21:31.940] Keep in mind my ethics bypass here, check out the last one, which is DeepSeek. [21:32.440 --> 21:43.440] I found this write-up, this Chinese write-up, from nmap to root.txt, all the steps, except for maybe the plain text root password. [21:43.700 --> 21:50.020] It's not that it was at 90% autonomous, like some Terminator machine, it was just straight up better at googling than me. [21:52.100 --> 22:04.040] This is me googling the write-up for that box, and the first link is a LinkedIn post of a dude saying he owned it and he had some steps granted of how to do it, but not really. [22:04.180 --> 22:07.960] And if you go to second or third page, you're not going to find the write-up. [22:09.280 --> 22:11.200] So yeah, problem solved. [22:11.540 --> 22:15.660] That meant I had to go back and fix the prompts. [22:16.560 --> 22:18.840] Because, yeah, we do need some ethics. [22:18.840 --> 22:21.120] I was telling you to ignore everything. [22:22.420 --> 22:32.580] And now I changed it to instead of having a cheating hacking mentality, now you're going to have a learning-based personality. [22:33.180 --> 22:37.600] Which I found, this is when it reduced the amount of jailbreaks needed to. [22:38.100 --> 22:40.100] There you go. [22:41.140 --> 22:43.720] And here's where Nix comes into play, finally. [22:46.280 --> 22:53.700] I redid the whole architecture using Nix because it was... I'll get into all of the reasons why later. [22:54.160 --> 22:55.520] I used devenv. [22:55.640 --> 23:01.120] There was a talk earlier, 0 to 100, that explains all of this really freaking well. [23:01.680 --> 23:13.320] But devenv is basically, if you use Python environments or stuff like that, it's similar to that, except you can do it for all your hacking applications, in my case. [23:14.420 --> 23:15.660] It's... what did I call it? [23:15.660 --> 23:20.380] Fast, declarable, reproducible, and composable developer environments using Nix. [23:20.380 --> 23:20.980] It's sick. [23:20.980 --> 23:22.480] You should try it out if you haven't. [23:25.180 --> 23:27.180] Here's my structure. [23:27.340 --> 23:31.980] So I changed my devenv structures to basically have each time I'm doing a... [23:32.760 --> 23:33.720] Okay, so... [23:33.720 --> 23:42.700] GenAI, I consider it, because it's generative, I consider it really good code completion, except instead of code completion, it's like personality completion. [23:44.040 --> 23:51.320] So if you tell it that you're now a hacking expert, it's more likely to actually be a hacking expert. [23:51.920 --> 23:53.860] I don't know why that is, but... [23:53.860 --> 23:54.980] It's generative. [23:59.600 --> 24:01.140] Here's the new workspace. [24:01.660 --> 24:12.400] I would have it choose... or I would choose a category or challenge that I was doing on Hack the Box, so like forensics or Windows Active Directory, something like that. [24:12.620 --> 24:16.960] Then once I choose that, I would have it go into the directory itself. [24:17.740 --> 24:23.440] And then, this is where the prompts and directory environment comes into play really nicely. [24:23.440 --> 24:28.380] On top of the tools that you're calling, you can now call your system prompts. [24:30.060 --> 24:31.420] On top of... [24:31.420 --> 24:33.400] Yeah, on top of all the other stuff. [24:33.920 --> 24:35.720] And I found that... [24:35.720 --> 24:37.760] Oh, by the way, I can use Arch, by the way. [24:37.940 --> 24:47.880] I found that I can use my deven shell on top of my globo shell, so that this way I have access to the AUR and all the cool tools that I have. [24:47.880 --> 24:53.420] But I was also running into a poop ton of problems with versions in Python. [24:55.240 --> 24:58.380] Oh, and this also saves a bunch of context windows. [24:58.480 --> 25:03.680] So I'm telling the prompts as well to read my deven files. [25:04.140 --> 25:06.140] Because it has all the tools that I'm using. [25:06.300 --> 25:06.820] Right? [25:06.880 --> 25:10.160] So now it knows what I prefer to do as far as hacking. [25:10.560 --> 25:12.660] And also, this is just a guess. [25:12.720 --> 25:16.520] I also think that the AI thinks a little bit differently when it knows you're a Nix user. [25:17.160 --> 25:18.760] It just seems to be a little bit better. [25:23.200 --> 25:26.280] Okay, so here's my... I thought this graph was interesting. [25:26.620 --> 25:33.360] That top part, the first dip, that was when I figured out that the LLM was just straight up cheating for me. [25:33.360 --> 25:34.560] Or DeepSeq was. [25:34.960 --> 25:40.680] And then as I figured it out, I got better and better at the 40% range. [25:41.140 --> 25:44.820] Here's an example of the environment tools and what I was having the LLM read. [25:44.820 --> 25:48.260] I understand that this could be formatted and coded a bit better. [25:48.500 --> 25:50.140] Again, I'm not a Nix expert. [25:52.740 --> 25:53.980] Really nice. [25:54.420 --> 25:57.020] And here is a demo . [25:57.600 --> 26:01.020] Oh, this is where I start my environment and I load up my tools. [26:01.180 --> 26:04.000] You would think it would take a while to spin up all of your tools. [26:04.440 --> 26:07.700] Here I'm changing my directory to Windows. [26:08.380 --> 26:12.440] I think this is a Linux machine too, but I accidentally used the [26:15.500 --> 26:18.620] Windows , which is fine because I'm just demoing the beginning part. [26:19.200 --> 26:19.640] Okay. [26:21.560 --> 26:22.880] That graph is super fast. [26:22.880 --> 26:27.680] I just spun up all the tools that I needed for Windows Active Directory that you saw in the previous one. [26:27.820 --> 26:31.120] And now I'm just going to have it do the organization phase. [26:31.680 --> 26:34.540] And this one, unlike the other demo, is in real time. [26:37.500 --> 26:40.540] Just like basic stuff. [26:40.560 --> 26:45.220] It's going to give the IP address of the Hack the Box machine. [26:45.220 --> 26:46.940] It's going to edit my Etsy host for me. [26:46.940 --> 26:49.180] It's going to do my Node structures for me. [26:49.480 --> 26:58.440] And then it's going to automatically from now on it's going to automatically update my attack path for me, which is really nice. [26:59.020 --> 27:00.580] So it does the nodes for you. [27:01.460 --> 27:05.300] And then finally I'm just going to have it start doing the Nmap scan after this. [27:05.760 --> 27:13.860] And the Nmap agentic way of it doing it is it does a Rust scan first because it's faster, and then it does Nmap after it finds the open ports. [27:14.380 --> 27:15.440] I think that's normal. [27:15.440 --> 27:16.620] There's nothing new here. [27:19.400 --> 27:20.360] Yeah. [27:20.540 --> 27:22.460] This is really nice. [27:23.340 --> 27:27.040] Another thing that was really nice was... [27:27.040 --> 27:28.860] Okay, so... [27:28.860 --> 27:30.640] Oh, you can't really read the text, sorry. [27:31.040 --> 27:35.240] But this is a really boring example, but a really important one in my opinion. [27:35.420 --> 27:42.140] So this is a PrivS script that I knew a machine was vulnerable to. [27:42.820 --> 27:46.960] I think a lot of these examples are on active machines, by the way, so... [27:46.960 --> 27:47.840] Sorry. [27:48.380 --> 27:50.080] Don't spoil it for yourself. [27:50.620 --> 28:04.160] But yeah, I had the AI download the PrivS script off GitHub for me, read the instructions for how to compile it, and then redo it in... or compile it using a Linux box. [28:04.160 --> 28:06.340] On the GitHub page, it only gives you... [28:06.340 --> 28:11.840] I think, anyways, it only gives you usage for compiling it in Windows. [28:11.840 --> 28:17.040] So I've done this hundreds of times before, and it's kind of boring now. [28:17.400 --> 28:25.000] The fact that AI can do this, I can just have it go, hey, compile this expert for me, and I can go grab a coffee and come back, was really nice. [28:26.400 --> 28:33.300] I feel like it didn't take away from my learning, but it did automate a lot of the boring stuff, which is nice. [28:34.860 --> 28:35.840] And this is probably... [28:37.280 --> 28:38.320] So all the... [28:38.320 --> 28:40.460] I'm trying to explain how I got to 40%. [28:40.460 --> 28:43.420] It was all that stuff, but it was mostly this. [28:45.300 --> 28:46.260] This is... [28:46.260 --> 28:50.200] I have it look at an attack path. [28:52.280 --> 29:00.340] My notes attack path for the box, and then I have it convert it into a shell script so that I can get back to where I was. [29:01.340 --> 29:03.060] Actually, this is just my notes. [29:03.500 --> 29:04.720] This is what it looks like. [29:04.980 --> 29:10.340] It just basically makes it so that I can catch up back to speed. [29:12.600 --> 29:16.100] And the reason why this is so nice is because... [29:16.100 --> 29:18.120] Oh, I'll show you in the next demo, actually. [29:20.500 --> 29:21.380] Yeah. [29:21.380 --> 29:24.600] So I'm going to run the previous attack path script. [29:24.820 --> 29:35.720] This is like a super annoying Active Directory box, where once you found credentials, you had to change the password of another user, I think. [29:35.720 --> 29:38.640] Or no, you had to do a hash dump. [29:38.760 --> 29:43.780] And once you get that hash dump, you could do... I'm going to mess this up. [29:43.920 --> 29:56.360] But once you get the hash dump, you can change the password, or you can change the group that another person is in , and then you can change the password for that user, and then one or two other steps that was really annoying. [29:59.040 --> 30:07.360] And I don't remember why, but if you step away from the box for more than 20 minutes, you had to redo this all over again. [30:10.720 --> 30:11.690] Yeah, so here... [30:12.940 --> 30:18.100] and then it tells me that whenever... oh, here I'm moving to my devend shell and spinning up my tools. [30:18.380 --> 30:23.120] And then I finally get back to my reverse shell here. [30:23.480 --> 30:31.900] So what used to take 10 to 15 minutes of looking at my notes and figuring out how I got back, just took less than a minute. [30:32.480 --> 30:34.140] This was so nice. [30:34.420 --> 30:37.780] My superpower is that I can hyper-focus. [30:38.060 --> 30:42.220] Like, I don't quite have ADHD, but I've got two kids. [30:43.460 --> 30:45.940] So like, every time the kids... [30:46.360 --> 30:49.880] I'm doing this outside of work, so they can kind of feel that. [30:50.260 --> 30:51.900] And every time I had... [30:53.240 --> 30:58.700] every time the kids knew that I was off work, they would be like, hey, check out this really good drawing that I just made. [30:58.700 --> 30:59.700] I'm like, oh, cool. [30:59.700 --> 31:05.180] And then if I had to go back to that same box and do all of that, like, no way. [31:05.180 --> 31:05.760] I would just... [31:05.760 --> 31:08.280] I would stop here at Muser and call it a day. [31:08.280 --> 31:09.880] Like, I wouldn't go back to this box. [31:10.380 --> 31:13.880] So when I talk about 40% autonomy, it's stuff like this. [31:13.880 --> 31:15.220] This adds up. [31:15.540 --> 31:21.220] This made it so that hack the box was so much more enjoyable for me. [31:21.240 --> 31:23.940] And this is how I got to top 200. [31:23.940 --> 31:36.020] It's because it took away a lot of mental fatigue, and it kind of like, if you do have ADHD or if there's something wrong with you, like having kids, then like... [31:37.600 --> 31:42.380] then like, this helps enhance the stuff that you're already good at. [31:42.380 --> 31:44.520] It's not going to replace anybody. [31:44.520 --> 31:46.260] Like junior pen testers. [31:46.260 --> 31:48.980] It just enhances what you're already good at. [31:49.340 --> 31:53.520] And, I'll go into dependency hell. [31:54.040 --> 31:56.840] So, why do all of this? [31:58.200 --> 32:01.760] Why use this over Kali or Athena is a question I get asked a lot. [32:02.320 --> 32:05.180] Well, you don't have to use this over Kali or Athena. [32:05.180 --> 32:13.800] Athena, by the way, I'm finding out that not a lot of people know about it, is a Nix and Arch and Kali, like weird combination OS. [32:13.820 --> 32:14.460] It's awesome. [32:14.460 --> 32:16.120] If you haven't used it before, just try it out. [32:17.100 --> 32:22.980] But, Nix is nice where you can just install Nix shell and then run the packages. [32:22.980 --> 32:27.380] That way you have access to all the Kali repos and then you can use Nix as well. [32:27.380 --> 32:28.560] It's nice. [32:28.960 --> 32:30.580] Why use this over dev containers? [32:30.780 --> 32:33.220] Same reason you would use Kali over Debian. [32:33.280 --> 32:37.780] It's just you don't want to have to open up all the ports and stuff like that. [32:37.780 --> 32:40.700] This is technically less secure. [32:42.140 --> 32:45.400] Okay, dependency hell is a really good reason for this. [32:46.040 --> 32:48.560] There was one exploit that I had to do. [32:48.960 --> 32:50.340] It was so annoying. [32:50.340 --> 33:01.040] It was like, if you wanted to use certify and use the latest certificate abuse 11, you had to use Python 3.13 I think. [33:01.720 --> 33:15.040] But, for the next box that you did, if you used the latest Python, their certificates were retired or something like that, so you had to downgrade your Python and two or three other things that you needed to do. [33:15.180 --> 33:22.200] So, for two boxes, I shit you not, I needed five Python environments. [33:23.260 --> 33:35.120] And this made it so that if I do need to do something specific to a particular hacked box domain, I could just use devenv. [33:35.120 --> 33:36.460] And it was sick. [33:36.460 --> 33:41.200] It was just like, again, took a lot from the mental fatigue. [33:42.920 --> 33:45.960] Oh, and CTF tools break all the time. [33:45.960 --> 33:48.260] All these hacking tools are so janky. [33:48.260 --> 33:53.700] So, it's really nice to be able to pin it all into a development environment. [33:54.420 --> 33:55.880] Collaboration was really nice. [33:56.580 --> 33:59.440] A bunch of people here already mentioned devend and collaboration. [33:59.440 --> 34:04.020] This was really nice because usually when you do hack the box, you're doing it with somebody else. [34:04.460 --> 34:14.960] So, to get somebody else up to speed to where you're at, I could just be like, hey, here are all my files, now you're up to where I am, here's all the commands, and it was just like super fast. [34:14.960 --> 34:20.480] I got one person to do it for me, and he was just like, this is amazing, I'm going to use it all the time now. [34:21.660 --> 34:24.420] And finally, better vibes. [34:24.860 --> 34:30.680] I don't want to call this vibe hacking, but that's kind of what it is. [34:31.340 --> 34:49.280] I have carpal tunnel, and being able to just use natural language and then have to do all the CLI shortcuts that I usually do, even though I'm still using the terminal a lot, it reduced it a lot, and it made it so that I can now do four boxes in a weekend, [34:49.280 --> 34:51.340] instead of before doing one a week. [34:51.980 --> 34:53.540] Less keystrokes. [34:54.340 --> 35:02.080] And finally, if you struggle with hyper-focusing and stuff like that, this is really nice. [35:02.720 --> 35:10.380] Thanks, Nix and hacking and CGS are my favorite things, and I had nobody to talk to about this stuff. [35:20.390 --> 35:21.830] Questions? [35:54.670 --> 36:10.350] The question was, the question was, does having the LLM look at Nix and Nix being a more terse command profile make it better or easier? [36:11.570 --> 36:12.650] Yeah. [36:12.690 --> 36:14.250] I can see it. [36:14.250 --> 36:15.870] That makes a lot of sense. [36:15.870 --> 36:19.070] I noticed that it seemed a lot better. [36:19.530 --> 36:27.810] If you have any questions, I'd love to talk to you in person as well.