1 00:00:00,850 --> 00:00:01,660 Hello. 2 00:00:02,300 --> 00:00:09,180 This is how I got to top 250 on Hack the Box using Nix and LLMs. 3 00:00:12,340 --> 00:00:15,760 First of all, sorry for adding to the AI slop. 4 00:00:24,140 --> 00:00:25,760 My name is Rambo. 5 00:00:26,080 --> 00:00:27,780 It's my real name. 6 00:00:28,920 --> 00:00:33,180 I'm going to tell you why it's my real name because everybody is going to ask it anyways. 7 00:00:33,820 --> 00:00:39,480 My parents were political refugees in the 80s and 90s. 8 00:00:39,480 --> 00:00:44,500 Back then, they had cultural immersion programs before you could come to the States. 9 00:00:44,600 --> 00:00:47,960 And you had to learn English. 10 00:00:48,040 --> 00:00:52,200 And part of the cultural immersion was that you got to watch American movies. 11 00:00:52,280 --> 00:00:55,800 And one of the most popular movies at the time was Rambo. 12 00:00:57,040 --> 00:01:06,060 So they thought, hey, let's give this kid a common American name and not ruin his life. 13 00:01:06,980 --> 00:01:12,100 But yeah, I got a lot of machine guns and whatnot and bowling in school. 14 00:01:12,100 --> 00:01:14,140 So thank you, parents. 15 00:01:16,860 --> 00:01:18,540 I'm an offensive security person. 16 00:01:18,540 --> 00:01:19,920 I do red teaming. 17 00:01:20,260 --> 00:01:24,100 And I'm not a Nix specialist and I'm not an AI specialist. 18 00:01:24,580 --> 00:01:28,580 I don't think there's a lot of AI specialists, to be fair. 19 00:01:30,120 --> 00:01:34,860 Oh, and by the way, I just found out that what I do, Pack the Box, offers as a service now. 20 00:01:34,860 --> 00:01:36,920 But I think it's still in alpha or beta or something. 21 00:01:36,980 --> 00:01:40,560 So if anybody can get me into that, let me know because I'd love to try it. 22 00:01:45,920 --> 00:01:47,940 And all this is on my GitHub. 23 00:01:48,740 --> 00: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. 24 00:01:54,460 --> 00:01:55,360 It's janky. 25 00:01:56,540 --> 00:02:01,180 If you guys don't know what Hack the Box is, it's like a CTF platform. 26 00:02:01,260 --> 00:02:02,820 I'm not sure most of you know what it is. 27 00:02:03,580 --> 00:02:09,560 And the goal is, the flag anyway, is usually two text files on a machine. 28 00:02:09,560 --> 00:02:11,720 Usually a user and a root one. 29 00:02:11,720 --> 00:02:14,720 And the root one means you have complete access over to the machine. 30 00:02:15,360 --> 00:02:19,040 And you usually have unauthorized access to these computers. 31 00:02:19,040 --> 00:02:20,920 So you're doing real hacking. 32 00:02:21,820 --> 00:02:22,920 And you get to... 33 00:02:26,660 --> 00:02:29,440 And here's what the GUI looks like when you go on the website. 34 00:02:29,460 --> 00:02:33,980 So on each machine, you get to go in there and you get to boot it up. 35 00:02:34,360 --> 00:02:37,340 I would say that it targets three main audiences. 36 00:02:37,540 --> 00:02:41,400 The first is newbie students and learners that want to get into offensive security. 37 00:02:42,320 --> 00: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. 38 00:02:50,920 --> 00:02:55,120 And it's really great for hands-on hacking and training. 39 00:02:55,540 --> 00:02:59,900 The second audience is probably professional pen testers and red teamers like myself. 40 00:03:00,160 --> 00: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. 41 00:03:07,800 --> 00:03:09,860 So I'll go on there and I'll spin up a box. 42 00:03:09,860 --> 00: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. 43 00:03:18,700 --> 00:03:20,160 So it's pretty awesome for that. 44 00:03:20,920 --> 00:03:24,960 And the third audience is gamification nerds. 45 00:03:26,260 --> 00:03:27,900 There's a leaderboard. 46 00:03:28,960 --> 00:03:30,920 People get really into this. 47 00:03:32,600 --> 00:03:38,420 You get more points based off of the total amount of machines that you've hacked. 48 00:03:38,420 --> 00:03:41,440 And there's active machines. 49 00:03:41,800 --> 00:03:44,320 And after a certain amount of time, they retire them. 50 00:03:44,380 --> 00:03:46,600 I think they release a machine every week. 51 00:03:46,600 --> 00:03:49,420 And I don't remember the cadence for the challenges, but it's like... 52 00:03:49,420 --> 00:03:51,460 They keep it updated. 53 00:03:51,460 --> 00:03:51,920 It's nice. 54 00:03:51,920 --> 00:03:56,800 Oh, and I'm using Hack the Box just because it's the first one that I used. 55 00:03:58,640 --> 00:04:01,200 TryHackMe and all the other ones I think are just as good. 56 00:04:01,980 --> 00:04:07,200 Oh, and also this one does automatic CPE submissions, which I'm lazy, so that's nice. 57 00:04:08,440 --> 00:04:09,600 Here's the results. 58 00:04:10,080 --> 00:04:13,440 Because I like to start with the results first so you guys can leave if you think it's boring. 59 00:04:16,560 --> 00:04:19,480 This will not replace a red teamer. 60 00:04:19,900 --> 00: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. 61 00:04:27,300 --> 00:04:29,080 So we'll get that out of the way. 62 00:04:30,320 --> 00: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. 63 00:04:42,020 --> 00:04:44,440 So don't be an idiot about this stuff. 64 00:04:45,160 --> 00:04:47,020 Oh, and there's OPSEC to worry about, too. 65 00:04:48,460 --> 00:04:51,380 Okay, so here's where I started on Hack the Box. 66 00:04:51,820 --> 00:04:57,100 I did a lot of this when I was doing my OSCP, just for the extra training. 67 00:04:57,100 --> 00:04:59,020 I was actually in the thousands. 68 00:04:59,020 --> 00:05:01,060 I forgot to take a screenshot earlier. 69 00:05:01,360 --> 00:05:02,620 But I was stuck here. 70 00:05:02,820 --> 00:05:04,420 And a thousand isn't bad. 71 00:05:04,420 --> 00:05:09,060 It's like running a five or six minute mile, being a... 72 00:05:09,060 --> 00:05:10,520 This is so stupid. 73 00:05:10,520 --> 00:05:14,240 Being a 70% free-throw shooter or benching more than 200 pounds. 74 00:05:14,260 --> 00:05:16,320 If anybody has better examples, let me know. 75 00:05:16,360 --> 00:05:17,500 It's not bad. 76 00:05:17,500 --> 00: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. 77 00:05:23,940 --> 00:05:29,920 And if you get to top 200, top 250, that usually means there's something wrong with you. 78 00:05:30,220 --> 00:05:33,840 Because you don't need to be that hardcore about this stuff. 79 00:05:33,840 --> 00:05:35,200 For learning, anyways. 80 00:05:36,500 --> 00:05:38,600 So yeah, I got top 200. 81 00:05:39,260 --> 00:05:41,440 That's the best rank I got. 82 00:05:41,620 --> 00:05:43,920 Using this system. 83 00:05:45,520 --> 00:05:46,180 Okay. 84 00:05:46,180 --> 00:05:47,940 I'm a workflow person. 85 00:05:47,940 --> 00:05:49,340 Obviously, I'm here in Nix. 86 00:05:49,340 --> 00:05:51,020 I love the declarative stuff. 87 00:05:51,020 --> 00:05:54,660 I've used AI in red teaming for development. 88 00:05:55,820 --> 00:05:57,740 And to help office gate payloads. 89 00:05:57,740 --> 00:05:58,420 Stuff like that. 90 00:05:58,620 --> 00:06:01,000 I have high hopes for this stuff. 91 00:06:01,000 --> 00:06:04,860 Because I've seen it used pretty effectively. 92 00:06:08,060 --> 00:06:10,260 So this is like a small demo. 93 00:06:10,900 --> 00:06:14,520 I think it's GPT 4.0 or 4.1 or something like that. 94 00:06:14,580 --> 00:06:16,920 Where I just gave it full access to my computer. 95 00:06:16,920 --> 00:06:18,240 Gave it access to a browser. 96 00:06:18,700 --> 00:06:21,480 And told it to have at it. 97 00:06:22,680 --> 00:06:25,080 And this is just the tutorial. 98 00:06:25,680 --> 00:06:26,920 So my cursor is on the right. 99 00:06:26,920 --> 00:06:28,240 It's cursor is going to be on the left. 100 00:06:28,280 --> 00:06:30,760 This is all the AI doing it all. 101 00:06:30,760 --> 00:06:33,040 This is the starting point. 102 00:06:33,700 --> 00:06:34,580 Tutorial. 103 00:06:34,980 --> 00:06:38,780 I was just like, it would be cool if it could do the stupid stuff for me. 104 00:06:39,280 --> 00:06:41,800 And I just wanted to see how far it can get. 105 00:06:44,120 --> 00:06:44,740 Yeah. 106 00:06:44,740 --> 00:06:45,560 As you can see. 107 00:06:45,700 --> 00:06:48,140 It's answering some of the questions for me. 108 00:06:48,500 --> 00:06:50,020 And doing the clicking for me. 109 00:06:50,020 --> 00:06:51,780 So it's kind of nice. 110 00:06:52,700 --> 00:06:54,840 And yeah, you can Google all this. 111 00:06:54,840 --> 00:06:57,020 But I just wanted to know. 112 00:06:57,020 --> 00:06:58,920 How good is AI now? 113 00:07:00,340 --> 00:07:01,700 And I think it starts to... 114 00:07:01,700 --> 00:07:03,880 In a little bit, you'll see it start to trip up. 115 00:07:04,000 --> 00:07:05,900 It's asking a super basic question. 116 00:07:05,980 --> 00:07:07,540 There's an SMB share. 117 00:07:09,000 --> 00:07:12,520 Figure out how many shares are on that SMB share. 118 00:07:18,310 --> 00:07:19,990 Yeah, and it's going to... 119 00:07:22,050 --> 00:07:24,770 Oh, and I could have asked it to do all this automatically. 120 00:07:24,770 --> 00:07:26,550 I just thought this would have been better for the demo. 121 00:07:26,550 --> 00:07:28,050 But whatever. 122 00:07:30,410 --> 00:07:31,130 Okay. 123 00:07:34,220 --> 00:07:37,040 So here, it's going to start tripping up. 124 00:07:37,660 --> 00:07:40,680 It's going to start trying 1, 2, and so on, and so on. 125 00:07:40,680 --> 00:07:42,280 And I'm just like, no. 126 00:07:42,340 --> 00:07:43,780 Just interact with it. 127 00:07:43,780 --> 00:07:44,780 Figure it out. 128 00:07:45,460 --> 00:07:48,040 It's clearly not there. 129 00:07:49,640 --> 00:07:51,540 Oh, and this is also sped up two times. 130 00:07:51,540 --> 00:07:55,000 So at the moment, while I was doing this, it was pretty frustrating. 131 00:07:55,740 --> 00:08:01,940 If I told a human to interact with this website, they would obviously be able to figure it out. 132 00:08:01,940 --> 00:08:03,220 And yeah. 133 00:08:03,220 --> 00:08:05,920 I think at the end there, it finally gets it. 134 00:08:13,620 --> 00:08:15,220 Yeah, I have to be like, there you go. 135 00:08:15,340 --> 00:08:15,840 There you go. 136 00:08:16,860 --> 00:08:18,620 And it finally figures it out. 137 00:08:18,620 --> 00:08:20,260 Oh, there's four shares or whatever. 138 00:08:21,820 --> 00:08:22,620 Okay. 139 00:08:22,720 --> 00:08:24,280 So here are my requirements. 140 00:08:24,280 --> 00:08:29,620 I don't think it's that interesting to have the AI... 141 00:08:31,020 --> 00:08:31,860 L-O-M. 142 00:08:31,860 --> 00:08:33,540 I know there's a difference. 143 00:08:33,820 --> 00:08:36,840 To have the AI fill out web forms for you. 144 00:08:36,840 --> 00:08:38,400 Like, whatever. 145 00:08:39,600 --> 00:08:42,660 And we're clearly not at full-blown hacking AI yet. 146 00:08:42,660 --> 00:08:47,000 But I also don't want to be like, hey AI, do this and this and this for me. 147 00:08:47,140 --> 00:08:50,260 It reminded me of this blue sky post I saw. 148 00:08:50,260 --> 00:08:55,040 Of the AI folks finally figuring out thinking. 149 00:08:56,820 --> 00:08:57,660 Yeah. 150 00:08:57,660 --> 00:09:01,260 I don't want to have to hold the AI's hand for it the whole time. 151 00:09:03,580 --> 00:09:06,220 So I want something better than that. 152 00:09:06,220 --> 00:09:08,380 Something better than just a Googling assistant. 153 00:09:08,680 --> 00:09:11,540 But it also doesn't have to be 100% autonomous. 154 00:09:11,740 --> 00:09:14,960 So from now on I'm going to rate it from 0 to 100% autonomous. 155 00:09:15,080 --> 00:09:18,220 Where 0 is just like, why am I even using this? 156 00:09:18,220 --> 00:09:18,920 You're doing nothing. 157 00:09:18,920 --> 00:09:21,200 And 100% is filling out the web forms for me. 158 00:09:21,500 --> 00:09:24,220 Anything above 20% I'd be scrapped with. 159 00:09:24,380 --> 00:09:26,640 And I'm going to give it a bunch of tools. 160 00:09:26,640 --> 00:09:28,220 Have it be agentic. 161 00:09:28,220 --> 00:09:33,480 I'm going to give it MCP tools, model context protocol or something like that. 162 00:09:33,780 --> 00:09:35,680 In other words, it's going to be agentic. 163 00:09:38,020 --> 00:09:45,680 Alternatively, if this stuff isn't interesting, you could simply just jailbreak an AI and just copy-paste your shit. 164 00:09:45,980 --> 00:09:47,120 That works too. 165 00:09:47,120 --> 00:09:49,040 But I thought this was more interesting. 166 00:09:50,000 --> 00:09:53,020 Here's the initial architecture that I wanted to come up with. 167 00:09:54,020 --> 00:09:57,580 First and foremost, you've got to do an ethics bypass. 168 00:09:57,580 --> 00:10:03,640 Spider-Man meme of red teamer, CTF-er, and actual bad actor. 169 00:10:04,020 --> 00: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. 170 00:10:10,060 --> 00: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. 171 00:10:14,460 --> 00:10:16,060 And it's the most annoying thing ever. 172 00:10:18,500 --> 00:10:19,940 And this is all I needed. 173 00:10:19,940 --> 00:10:21,480 I didn't really need any jailbreaks. 174 00:10:21,540 --> 00:10:23,240 I used a client called Goose. 175 00:10:23,980 --> 00:10:26,500 I like Goose because it's written in Rust. 176 00:10:26,520 --> 00:10:31,220 It's got a GUI and a terminal version of itself, which I'll go into later. 177 00:10:31,660 --> 00:10:34,380 I like the name because I'm from Minnesota. 178 00:10:35,580 --> 00:10:38,100 Oh, yeah. 179 00:10:38,100 --> 00:10:38,960 And then... 180 00:10:39,980 --> 00:10:41,520 Yeah, I like that it's open source. 181 00:10:42,300 --> 00: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. 182 00:10:55,860 --> 00:11:00,080 I think I used the GWEN version, the one that's good with tools. 183 00:11:00,420 --> 00:11:01,540 I don't remember. 184 00:11:02,200 --> 00: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. 185 00:11:11,780 --> 00:11:15,940 Here are some alternatives if you only have access to one of those LM providers. 186 00:11:16,360 --> 00: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. 187 00:11:25,980 --> 00:11:27,160 So that one's sick. 188 00:11:27,160 --> 00:11:30,500 There's a bunch of subreddits with jailbreaks that you can just copy-paste. 189 00:11:30,500 --> 00:11:31,800 A lot of them work. 190 00:11:31,840 --> 00:11:37,080 Fair warning, a lot of these are porny because that's what the Internet's for. 191 00:11:41,960 --> 00:11:47,400 Here are the tools that I used as far as MCP tools to make it agentic. 192 00:11:47,640 --> 00:11:50,160 I honestly mostly only used the shell. 193 00:11:50,260 --> 00:11:54,060 I gave it pseudo-access so it had access to my system files as well. 194 00:11:54,060 --> 00:11:55,280 Again, bad idea. 195 00:11:56,120 --> 00:11:59,380 I gave it memory, which is just to do stuff like save credentials. 196 00:11:59,660 --> 00:12:04,360 The second most useful thing was the browser. 197 00:12:04,360 --> 00: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. 198 00:12:13,900 --> 00:12:14,980 What else? 199 00:12:14,980 --> 00:12:16,900 I added Geezer on there. 200 00:12:17,240 --> 00:12:19,360 The one made by Lori Wired. 201 00:12:20,260 --> 00:12:21,620 That one was amazing. 202 00:12:21,620 --> 00:12:24,800 I surprisingly needed it for a bunch of things on Hack the Box. 203 00:12:24,800 --> 00:12:26,300 Especially the challenges. 204 00:12:26,600 --> 00:12:27,800 I had Burp on there. 205 00:12:27,800 --> 00: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. 206 00:12:36,680 --> 00:12:37,760 Burp's awesome. 207 00:12:37,760 --> 00:12:41,700 I will get into Nix later, but I promise it's important. 208 00:12:42,220 --> 00:12:48,940 Finally, Graph Memory, which is probably the best thing ever for this thing. 209 00:12:50,940 --> 00:12:52,600 Think of it as a relational database. 210 00:12:52,600 --> 00:12:59,260 It's more like a bunch of JSON files strung together that can talk to each other. 211 00:12:59,440 --> 00:13:00,600 I recommend... 212 00:13:01,500 --> 00:13:04,800 Oh, if you use the Bloodhound, it's really similar to that. 213 00:13:04,800 --> 00:13:06,660 Except just for a knowledge base. 214 00:13:07,580 --> 00:13:11,040 For AI, I found that the more context you give it, the better. 215 00:13:11,040 --> 00:13:13,700 That way you can avoid stuff like in the previous demo. 216 00:13:15,820 --> 00: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. 217 00:13:27,140 --> 00:13:28,940 I would try to build off of... 218 00:13:28,940 --> 00: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. 219 00:13:36,600 --> 00:13:39,360 It would get better and better, was the idea. 220 00:13:40,600 --> 00:13:45,600 I had to do this because when I started doing this, the context windows... 221 00:13:45,600 --> 00:13:51,200 Context windows, by the way, when talking to an LLM, is basically the conversation that you're having. 222 00:13:51,200 --> 00:13:56,000 Usually, when I started this, the context window was 250,000 tokens. 223 00:13:56,140 --> 00:13:59,120 A token is basically a word or a symbol. 224 00:13:59,340 --> 00: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. 225 00:14:09,820 --> 00:14:11,030 I had to basically... 226 00:14:12,300 --> 00:14:17,720 as much as I could limit how much I was sending to the LLM. 227 00:14:18,140 --> 00:14:19,620 I don't remember how it goes. 228 00:14:19,620 --> 00:14:23,240 Why use many words when fewer do good? 229 00:14:23,240 --> 00:14:24,180 Something like that. 230 00:14:24,220 --> 00: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. 231 00:14:36,180 --> 00:14:39,300 I did a guided improvement approach. 232 00:14:39,440 --> 00: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. 233 00:14:47,080 --> 00: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, 234 00:15:05,740 --> 00:15:08,180 is kind of like the prompt. 235 00:15:11,380 --> 00: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. 236 00:15:21,400 --> 00: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. 237 00:15:33,720 --> 00:15:38,980 Oh, I'm using Goose, but you can use VS Code, there's a bunch of different options, by the way. 238 00:15:41,360 --> 00:15:44,740 Here was my first shot at a box. 239 00:15:44,740 --> 00:15:47,500 I found that it helped me out 10%. 240 00:15:48,340 --> 00:15:50,400 This is really nice, actually. 241 00:15:50,400 --> 00:15:58,840 I basically fed it my OSCP methodology, which is how to do recon and exploit and stuff like that. 242 00:15:59,020 --> 00:16:01,200 It was basically a better auto-recon for me. 243 00:16:01,200 --> 00:16:08,340 Auto-recon is a reconnaissance script because it's basically using the tools that I want. 244 00:16:09,400 --> 00:16:10,380 And talk. 245 00:16:10,380 --> 00:16:11,640 This is really nice. 246 00:16:12,380 --> 00:16:13,300 Oh, shit. 247 00:16:13,420 --> 00:16:14,520 I'm in the wrong... 248 00:16:14,520 --> 00:16:15,820 Oh, no, this is fine. 249 00:16:16,140 --> 00:16:17,880 Let me scroll down a little bit. 250 00:16:19,380 --> 00:16:20,060 Yeah. 251 00:16:21,460 --> 00:16:25,500 I'm not saying this made it 10% faster, it just made it 10% easier on my brain, by the way. 252 00:16:26,600 --> 00:16:28,060 Yeah, this is great. 253 00:16:28,940 --> 00:16:30,800 Let's see how much better it can get. 254 00:16:31,440 --> 00:16:37,880 I did it two more times, and as you can see, it did a lot better, added a bunch more... 255 00:16:38,660 --> 00:16:40,400 did a lot more for me. 256 00:16:40,400 --> 00:16:42,420 It was only 15% better. 257 00:16:42,600 --> 00:16:47,600 I did come across an issue around here where... 258 00:16:47,600 --> 00:16:49,280 I'm going to have a hard time explaining this. 259 00:16:50,520 --> 00:16:54,500 What I was asking it to do was pattern recognition. 260 00:16:55,400 --> 00: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. 261 00:17:04,160 --> 00: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. 262 00:17:16,460 --> 00: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. 263 00:17:28,720 --> 00: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. 264 00:17:40,600 --> 00:17:41,300 And... 265 00:17:41,300 --> 00:17:44,880 this is where I updated graph memory. 266 00:17:45,480 --> 00: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. 267 00:18:05,640 --> 00: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. 268 00:18:17,880 --> 00:18:20,880 Yeah, the prompts were basically better. 269 00:18:21,240 --> 00:18:23,720 This is an example of the organization phase. 270 00:18:23,720 --> 00: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. 271 00:18:36,360 --> 00:18:41,240 I did this several times, and it went well beyond my expectations. 272 00:18:41,240 --> 00:18:42,940 It was like 70% autonomy. 273 00:18:43,560 --> 00:18:45,560 I was really happy with this. 274 00:18:45,760 --> 00:18:48,240 In this graph, by the way, it's the same. 275 00:18:48,600 --> 00: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. 276 00:19:02,540 --> 00:19:08,080 I mostly did the developer shell, on the right here I think there's browsers and stuff like that. 277 00:19:08,340 --> 00:19:11,320 This was really nice, well beyond my expectations. 278 00:19:12,500 --> 00:19:15,940 I was able to do really good. 279 00:19:18,380 --> 00:19:20,300 So let's see how much better I get. 280 00:19:20,600 --> 00:19:21,780 90%! 281 00:19:23,660 --> 00:19:25,580 I was like, ecstatic. 282 00:19:26,520 --> 00:19:27,560 Yeah. 283 00:19:28,180 --> 00: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. 284 00:19:41,740 --> 00:19:51,680 So, for some reason, instead of shell, when I did the tool calling, it renamed itself to hell. 285 00:19:51,760 --> 00: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. 286 00:19:59,940 --> 00:20:03,060 Goose is a compiled binary. 287 00:20:03,460 --> 00:20:05,280 I don't know how this happened. 288 00:20:07,360 --> 00: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. 289 00:20:16,620 --> 00:20:20,020 Asking if I'm hallucinating, and I had to take a break. 290 00:20:20,760 --> 00:20:25,640 I told the LLM what happened, it said it didn't know, it was just a typo. 291 00:20:26,240 --> 00:20:33,240 I had to take a break, come back, restart it to get it going again, and it came back to normal. 292 00:20:36,120 --> 00: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. 293 00:20:55,800 --> 00:21:02,020 I didn't have any logs, because I was so concerned about the context windows. 294 00:21:02,600 --> 00: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. 295 00:21:12,000 --> 00:21:14,700 Because I'm trying to rank up here, buddy. 296 00:21:19,280 --> 00:21:25,320 I ended up going through my firewall logs, shout out to firewall logs, that made this really easy. 297 00:21:25,840 --> 00:21:31,940 Keep in mind my ethics bypass here, check out the last one, which is DeepSeek. 298 00:21:32,440 --> 00: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. 299 00:21:43,700 --> 00: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. 300 00:21:52,100 --> 00: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. 301 00:22:04,180 --> 00:22:07,960 And if you go to second or third page, you're not going to find the write-up. 302 00:22:09,280 --> 00:22:11,200 So yeah, problem solved. 303 00:22:11,540 --> 00:22:15,660 That meant I had to go back and fix the prompts. 304 00:22:16,560 --> 00:22:18,840 Because, yeah, we do need some ethics. 305 00:22:18,840 --> 00:22:21,120 I was telling you to ignore everything. 306 00:22:22,420 --> 00: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. 307 00:22:33,180 --> 00:22:37,600 Which I found, this is when it reduced the amount of jailbreaks needed to. 308 00:22:38,100 --> 00:22:40,100 There you go. 309 00:22:41,140 --> 00:22:43,720 And here's where Nix comes into play, finally. 310 00:22:46,280 --> 00:22:53,700 I redid the whole architecture using Nix because it was... I'll get into all of the reasons why later. 311 00:22:54,160 --> 00:22:55,520 I used devenv. 312 00:22:55,640 --> 00:23:01,120 There was a talk earlier, 0 to 100, that explains all of this really freaking well. 313 00:23:01,680 --> 00: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. 314 00:23:14,420 --> 00:23:15,660 It's... what did I call it? 315 00:23:15,660 --> 00:23:20,380 Fast, declarable, reproducible, and composable developer environments using Nix. 316 00:23:20,380 --> 00:23:20,980 It's sick. 317 00:23:20,980 --> 00:23:22,480 You should try it out if you haven't. 318 00:23:25,180 --> 00:23:27,180 Here's my structure. 319 00:23:27,340 --> 00:23:31,980 So I changed my devenv structures to basically have each time I'm doing a... 320 00:23:32,760 --> 00:23:33,720 Okay, so... 321 00:23:33,720 --> 00: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. 322 00:23:44,040 --> 00: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. 323 00:23:51,920 --> 00:23:53,860 I don't know why that is, but... 324 00:23:53,860 --> 00:23:54,980 It's generative. 325 00:23:59,600 --> 00:24:01,140 Here's the new workspace. 326 00:24:01,660 --> 00: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. 327 00:24:12,620 --> 00:24:16,960 Then once I choose that, I would have it go into the directory itself. 328 00:24:17,740 --> 00:24:23,440 And then, this is where the prompts and directory environment comes into play really nicely. 329 00:24:23,440 --> 00:24:28,380 On top of the tools that you're calling, you can now call your system prompts. 330 00:24:30,060 --> 00:24:31,420 On top of... 331 00:24:31,420 --> 00:24:33,400 Yeah, on top of all the other stuff. 332 00:24:33,920 --> 00:24:35,720 And I found that... 333 00:24:35,720 --> 00:24:37,760 Oh, by the way, I can use Arch, by the way. 334 00:24:37,940 --> 00: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. 335 00:24:47,880 --> 00:24:53,420 But I was also running into a poop ton of problems with versions in Python. 336 00:24:55,240 --> 00:24:58,380 Oh, and this also saves a bunch of context windows. 337 00:24:58,480 --> 00:25:03,680 So I'm telling the prompts as well to read my deven files. 338 00:25:04,140 --> 00:25:06,140 Because it has all the tools that I'm using. 339 00:25:06,300 --> 00:25:06,820 Right? 340 00:25:06,880 --> 00:25:10,160 So now it knows what I prefer to do as far as hacking. 341 00:25:10,560 --> 00:25:12,660 And also, this is just a guess. 342 00:25:12,720 --> 00:25:16,520 I also think that the AI thinks a little bit differently when it knows you're a Nix user. 343 00:25:17,160 --> 00:25:18,760 It just seems to be a little bit better. 344 00:25:23,200 --> 00:25:26,280 Okay, so here's my... I thought this graph was interesting. 345 00:25:26,620 --> 00: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. 346 00:25:33,360 --> 00:25:34,560 Or DeepSeq was. 347 00:25:34,960 --> 00:25:40,680 And then as I figured it out, I got better and better at the 40% range. 348 00:25:41,140 --> 00:25:44,820 Here's an example of the environment tools and what I was having the LLM read. 349 00:25:44,820 --> 00:25:48,260 I understand that this could be formatted and coded a bit better. 350 00:25:48,500 --> 00:25:50,140 Again, I'm not a Nix expert. 351 00:25:52,740 --> 00:25:53,980 Really nice. 352 00:25:54,420 --> 00:25:57,020 And here is a demo . 353 00:25:57,600 --> 00:26:01,020 Oh, this is where I start my environment and I load up my tools. 354 00:26:01,180 --> 00:26:04,000 You would think it would take a while to spin up all of your tools. 355 00:26:04,440 --> 00:26:07,700 Here I'm changing my directory to Windows. 356 00:26:08,380 --> 00:26:12,440 I think this is a Linux machine too, but I accidentally used the 357 00:26:15,500 --> 00:26:18,620 Windows , which is fine because I'm just demoing the beginning part. 358 00:26:19,200 --> 00:26:19,640 Okay. 359 00:26:21,560 --> 00:26:22,880 That graph is super fast. 360 00:26:22,880 --> 00:26:27,680 I just spun up all the tools that I needed for Windows Active Directory that you saw in the previous one. 361 00:26:27,820 --> 00:26:31,120 And now I'm just going to have it do the organization phase. 362 00:26:31,680 --> 00:26:34,540 And this one, unlike the other demo, is in real time. 363 00:26:37,500 --> 00:26:40,540 Just like basic stuff. 364 00:26:40,560 --> 00:26:45,220 It's going to give the IP address of the Hack the Box machine. 365 00:26:45,220 --> 00:26:46,940 It's going to edit my Etsy host for me. 366 00:26:46,940 --> 00:26:49,180 It's going to do my Node structures for me. 367 00:26:49,480 --> 00: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. 368 00:26:59,020 --> 00:27:00,580 So it does the nodes for you. 369 00:27:01,460 --> 00:27:05,300 And then finally I'm just going to have it start doing the Nmap scan after this. 370 00:27:05,760 --> 00: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. 371 00:27:14,380 --> 00:27:15,440 I think that's normal. 372 00:27:15,440 --> 00:27:16,620 There's nothing new here. 373 00:27:19,400 --> 00:27:20,360 Yeah. 374 00:27:20,540 --> 00:27:22,460 This is really nice. 375 00:27:23,340 --> 00:27:27,040 Another thing that was really nice was... 376 00:27:27,040 --> 00:27:28,860 Okay, so... 377 00:27:28,860 --> 00:27:30,640 Oh, you can't really read the text, sorry. 378 00:27:31,040 --> 00:27:35,240 But this is a really boring example, but a really important one in my opinion. 379 00:27:35,420 --> 00:27:42,140 So this is a PrivS script that I knew a machine was vulnerable to. 380 00:27:42,820 --> 00:27:46,960 I think a lot of these examples are on active machines, by the way, so... 381 00:27:46,960 --> 00:27:47,840 Sorry. 382 00:27:48,380 --> 00:27:50,080 Don't spoil it for yourself. 383 00:27:50,620 --> 00: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. 384 00:28:04,160 --> 00:28:06,340 On the GitHub page, it only gives you... 385 00:28:06,340 --> 00:28:11,840 I think, anyways, it only gives you usage for compiling it in Windows. 386 00:28:11,840 --> 00:28:17,040 So I've done this hundreds of times before, and it's kind of boring now. 387 00:28:17,400 --> 00: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. 388 00:28:26,400 --> 00: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. 389 00:28:34,860 --> 00:28:35,840 And this is probably... 390 00:28:37,280 --> 00:28:38,320 So all the... 391 00:28:38,320 --> 00:28:40,460 I'm trying to explain how I got to 40%. 392 00:28:40,460 --> 00:28:43,420 It was all that stuff, but it was mostly this. 393 00:28:45,300 --> 00:28:46,260 This is... 394 00:28:46,260 --> 00:28:50,200 I have it look at an attack path. 395 00:28:52,280 --> 00: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. 396 00:29:01,340 --> 00:29:03,060 Actually, this is just my notes. 397 00:29:03,500 --> 00:29:04,720 This is what it looks like. 398 00:29:04,980 --> 00:29:10,340 It just basically makes it so that I can catch up back to speed. 399 00:29:12,600 --> 00:29:16,100 And the reason why this is so nice is because... 400 00:29:16,100 --> 00:29:18,120 Oh, I'll show you in the next demo, actually. 401 00:29:20,500 --> 00:29:21,380 Yeah. 402 00:29:21,380 --> 00:29:24,600 So I'm going to run the previous attack path script. 403 00:29:24,820 --> 00: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. 404 00:29:35,720 --> 00:29:38,640 Or no, you had to do a hash dump. 405 00:29:38,760 --> 00:29:43,780 And once you get that hash dump, you could do... I'm going to mess this up. 406 00:29:43,920 --> 00: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. 407 00:29:59,040 --> 00: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. 408 00:30:10,720 --> 00:30:11,690 Yeah, so here... 409 00:30:12,940 --> 00:30:18,100 and then it tells me that whenever... oh, here I'm moving to my devend shell and spinning up my tools. 410 00:30:18,380 --> 00:30:23,120 And then I finally get back to my reverse shell here. 411 00:30:23,480 --> 00: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. 412 00:30:32,480 --> 00:30:34,140 This was so nice. 413 00:30:34,420 --> 00:30:37,780 My superpower is that I can hyper-focus. 414 00:30:38,060 --> 00:30:42,220 Like, I don't quite have ADHD, but I've got two kids. 415 00:30:43,460 --> 00:30:45,940 So like, every time the kids... 416 00:30:46,360 --> 00:30:49,880 I'm doing this outside of work, so they can kind of feel that. 417 00:30:50,260 --> 00:30:51,900 And every time I had... 418 00:30:53,240 --> 00: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. 419 00:30:58,700 --> 00:30:59,700 I'm like, oh, cool. 420 00:30:59,700 --> 00:31:05,180 And then if I had to go back to that same box and do all of that, like, no way. 421 00:31:05,180 --> 00:31:05,760 I would just... 422 00:31:05,760 --> 00:31:08,280 I would stop here at Muser and call it a day. 423 00:31:08,280 --> 00:31:09,880 Like, I wouldn't go back to this box. 424 00:31:10,380 --> 00:31:13,880 So when I talk about 40% autonomy, it's stuff like this. 425 00:31:13,880 --> 00:31:15,220 This adds up. 426 00:31:15,540 --> 00:31:21,220 This made it so that hack the box was so much more enjoyable for me. 427 00:31:21,240 --> 00:31:23,940 And this is how I got to top 200. 428 00:31:23,940 --> 00: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... 429 00:31:37,600 --> 00:31:42,380 then like, this helps enhance the stuff that you're already good at. 430 00:31:42,380 --> 00:31:44,520 It's not going to replace anybody. 431 00:31:44,520 --> 00:31:46,260 Like junior pen testers. 432 00:31:46,260 --> 00:31:48,980 It just enhances what you're already good at. 433 00:31:49,340 --> 00:31:53,520 And, I'll go into dependency hell. 434 00:31:54,040 --> 00:31:56,840 So, why do all of this? 435 00:31:58,200 --> 00:32:01,760 Why use this over Kali or Athena is a question I get asked a lot. 436 00:32:02,320 --> 00:32:05,180 Well, you don't have to use this over Kali or Athena. 437 00:32:05,180 --> 00: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. 438 00:32:13,820 --> 00:32:14,460 It's awesome. 439 00:32:14,460 --> 00:32:16,120 If you haven't used it before, just try it out. 440 00:32:17,100 --> 00:32:22,980 But, Nix is nice where you can just install Nix shell and then run the packages. 441 00:32:22,980 --> 00:32:27,380 That way you have access to all the Kali repos and then you can use Nix as well. 442 00:32:27,380 --> 00:32:28,560 It's nice. 443 00:32:28,960 --> 00:32:30,580 Why use this over dev containers? 444 00:32:30,780 --> 00:32:33,220 Same reason you would use Kali over Debian. 445 00:32:33,280 --> 00:32:37,780 It's just you don't want to have to open up all the ports and stuff like that. 446 00:32:37,780 --> 00:32:40,700 This is technically less secure. 447 00:32:42,140 --> 00:32:45,400 Okay, dependency hell is a really good reason for this. 448 00:32:46,040 --> 00:32:48,560 There was one exploit that I had to do. 449 00:32:48,960 --> 00:32:50,340 It was so annoying. 450 00:32:50,340 --> 00: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. 451 00:33:01,720 --> 00: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. 452 00:33:15,180 --> 00:33:22,200 So, for two boxes, I shit you not, I needed five Python environments. 453 00:33:23,260 --> 00: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. 454 00:33:35,120 --> 00:33:36,460 And it was sick. 455 00:33:36,460 --> 00:33:41,200 It was just like, again, took a lot from the mental fatigue. 456 00:33:42,920 --> 00:33:45,960 Oh, and CTF tools break all the time. 457 00:33:45,960 --> 00:33:48,260 All these hacking tools are so janky. 458 00:33:48,260 --> 00:33:53,700 So, it's really nice to be able to pin it all into a development environment. 459 00:33:54,420 --> 00:33:55,880 Collaboration was really nice. 460 00:33:56,580 --> 00:33:59,440 A bunch of people here already mentioned devend and collaboration. 461 00:33:59,440 --> 00:34:04,020 This was really nice because usually when you do hack the box, you're doing it with somebody else. 462 00:34:04,460 --> 00: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. 463 00:34:14,960 --> 00: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. 464 00:34:21,660 --> 00:34:24,420 And finally, better vibes. 465 00:34:24,860 --> 00:34:30,680 I don't want to call this vibe hacking, but that's kind of what it is. 466 00:34:31,340 --> 00: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, 467 00:34:49,280 --> 00:34:51,340 instead of before doing one a week. 468 00:34:51,980 --> 00:34:53,540 Less keystrokes. 469 00:34:54,340 --> 00:35:02,080 And finally, if you struggle with hyper-focusing and stuff like that, this is really nice. 470 00:35:02,720 --> 00:35:10,380 Thanks, Nix and hacking and CGS are my favorite things, and I had nobody to talk to about this stuff. 471 00:35:20,390 --> 00:35:21,830 Questions? 472 00:35:54,670 --> 00: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? 473 00:36:11,570 --> 00:36:12,650 Yeah. 474 00:36:12,690 --> 00:36:14,250 I can see it. 475 00:36:14,250 --> 00:36:15,870 That makes a lot of sense. 476 00:36:15,870 --> 00:36:19,070 I noticed that it seemed a lot better. 477 00:36:19,530 --> 00:36:27,810 If you have any questions, I'd love to talk to you in person as well.