1 00:00:00,000 --> 00:00:03,220 Now this is going to be the last talk for today. 2 00:00:03,240 --> 00:00:11,140 And before I go ahead and start introducing the speaker, I'd like to give a small thanks to our sponsors. 3 00:00:11,140 --> 00:00:19,540 OSINT Industries, Pentester, Squarex, Synapt, Argilis Labs, Kado Networks, and Radon Labs. 4 00:00:21,440 --> 00:00:31,580 Right, up next is... up next is Osgun Klingin, who is a security researcher by day and a bug hunter by night. 5 00:00:35,700 --> 00:00:43,280 He's spoken at several conferences, such as DefCon, ResearchFrog, Hacktivity, and a lot more conferences as well. 6 00:00:43,300 --> 00:00:48,380 This time, his talk is going to be on Enumerate, quite a catchy name. 7 00:00:49,160 --> 00:00:52,960 It is an AI-assisted web attack surface enumeration tool. 8 00:00:53,240 --> 00:00:56,640 We'll get to see about AI being used in the right way. 9 00:00:56,640 --> 00:00:58,680 I completely agree with you, my friend. 10 00:00:58,680 --> 00:01:00,260 AI in everything is not fun. 11 00:01:00,260 --> 00:01:01,040 I completely agree. 12 00:01:01,040 --> 00:01:05,260 So having AI used in the right way is something we definitely want to look forward to. 13 00:01:05,480 --> 00:01:12,320 So, yeah, we'll get to see you come across some sharp, smart techniques to use AI in the right way and see where it counts. 14 00:01:12,320 --> 00:01:14,820 So please welcome our speaker on stage. 15 00:01:20,600 --> 00:01:21,720 Hello everyone. 16 00:01:21,720 --> 00:01:23,620 Thank you for introducing me. 17 00:01:23,760 --> 00:01:26,020 So I hope you can hear me well. 18 00:01:26,480 --> 00:01:33,940 So today I'll be talking about AI-assisted web attack surface enumeration, which is my latest research. 19 00:01:33,940 --> 00:01:35,080 So where am I? 20 00:01:35,840 --> 00:01:48,720 I'm currently working as an offensive security engineer at Trendule Group, which is like the biggest e-commerce company in Trendule, so that I can have a chance to review lots of products, starting from Active Directory to desktop applications. 21 00:01:49,280 --> 00:01:54,160 And after my daily work, I generally deal with web security and AI stuff lately. 22 00:01:54,160 --> 00:02:04,740 I got a bunch of useless certifications and I talked at DEF CON 32 Red Team Village last year, activity and a bunch of B-sides around Europe. 23 00:02:05,140 --> 00:02:06,520 So let's get it started. 24 00:02:06,520 --> 00:02:15,040 I would like to start with this talk, what this talk is not about, because there's very AI hype-driven things around there. 25 00:02:15,040 --> 00:02:19,680 So it's not about overusing the AI at all, and you'll see. 26 00:02:19,700 --> 00:02:26,500 And it's not like more AI better researching, because AI is a complete sales magnet, as you know. 27 00:02:26,680 --> 00:02:33,380 And there won't be any endless theoretical slides, because I'm not, of course, a professor and we are not in a master's degree class. 28 00:02:33,720 --> 00:02:37,020 And it's not like a tool sales pitch. 29 00:02:37,020 --> 00:02:41,220 It's more like redefining the way we do reconnaissance. 30 00:02:42,020 --> 00:02:56,340 What we're going to do today, we will be talking about web attack services a bit, then talk about our current problem, the moment of Eureka, talking about science and boring stuff a bit, and then a fun part is upcoming. 31 00:02:57,000 --> 00:02:59,060 Okay, so what's a web attack service? 32 00:02:59,060 --> 00:03:03,440 Web attack service is basically everything that an attacker has access to, right? 33 00:03:03,440 --> 00:03:13,400 Which includes all accessible paths, subdomains, JavaScript endpoints, APIs, CDNs, any third-party integrations. 34 00:03:13,400 --> 00:03:23,260 So it might include both obvious URLs you can just find on the main page, but it also includes deep and hard-to-find assets of the target. 35 00:03:23,540 --> 00:03:25,860 And this is where it gets hard. 36 00:03:26,280 --> 00:03:27,780 And why is mapping so hard? 37 00:03:27,780 --> 00:03:38,580 Because, I mean, if you are working in a company where more than thousands of software engineers are working, or system engineers, or DevOps engineers, there's a big problem called shadow IT. 38 00:03:38,580 --> 00:03:40,860 So you never know where your real assets are. 39 00:03:40,860 --> 00:03:45,920 You never know which assets are accessible from the public, right? 40 00:03:45,920 --> 00:03:52,320 And there's also third-party applications, forgotten assets, and lack of inventory. 41 00:03:52,320 --> 00:03:57,820 And of course, companies can protect what they don't know exists. 42 00:03:59,280 --> 00:04:01,320 And what's our problem here? 43 00:04:02,000 --> 00:04:04,400 Okay, so there's huge attack services. 44 00:04:04,400 --> 00:04:07,740 I mean, can anyone guess what this map represents? 45 00:04:08,100 --> 00:04:10,020 I'll give you some hints. 46 00:04:10,340 --> 00:04:17,920 Red Brain, Defcon fake Wi-Fi map, or Twitter infosec argument map, Zoomda. 47 00:04:17,920 --> 00:04:20,000 Does anyone have a guess? 48 00:04:21,380 --> 00:04:22,240 Twitter? 49 00:04:23,000 --> 00:04:26,760 It's actually Netflix architecture from like nine years ago. 50 00:04:26,760 --> 00:04:29,800 So, I mean, imagine how it looks like right now. 51 00:04:30,280 --> 00:04:33,240 So yeah, it's a big problem. 52 00:04:33,440 --> 00:04:33,980 And why? 53 00:04:33,980 --> 00:04:35,540 Because it's enumeration hell. 54 00:04:35,540 --> 00:04:40,400 It's not easy to discover all the functionalities that target web application have. 55 00:04:40,400 --> 00:04:46,680 And if you try to enumerate all the paths, there will be some problems about the cloud flair and rate limiting as well. 56 00:04:46,680 --> 00:04:55,560 And also there is complexity to confusion, like multiple frameworks, probably left over third-party libraries and hidden parameters as well. 57 00:04:55,760 --> 00:04:59,880 And you probably can't prioritize it as well. 58 00:05:00,520 --> 00:05:06,760 And when you start dealing with web security and when you open your web suite, it generally looks like this, right? 59 00:05:06,760 --> 00:05:19,900 I mean, you've got like 120 repeated tabs, about 90k requests, and like tons of audit items. 60 00:05:20,860 --> 00:05:25,380 Okay, here is another problem that I deal with most. 61 00:05:25,380 --> 00:05:27,720 It's called hidden attack services. 62 00:05:27,720 --> 00:05:31,100 I mean, we talked about there's thousands of subdomains and endpoints to check. 63 00:05:31,100 --> 00:05:33,780 I mean, yeah, it's a real problem. 64 00:05:33,780 --> 00:05:40,600 But the real problem here is there is thousands of subdomains and endpoints to discover on our targets. 65 00:05:41,600 --> 00:05:44,340 And this is what it generally goes like. 66 00:05:44,340 --> 00:05:54,400 I mean, they generally pause everything, but there are always some paths that are not accessed by any bug bounty hunter or any red teamer person. 67 00:05:56,180 --> 00:06:02,500 Okay, so as I said, there are tons of subdomains and it's not easy to manage that kind of exponential growth. 68 00:06:02,500 --> 00:06:07,140 For example, it's the Apple subdomains retreat from Turkish inventory. 69 00:06:07,140 --> 00:06:10,880 I think it's got like updated every certain period of time. 70 00:06:10,880 --> 00:06:14,120 So there's like very complex subdomains as well. 71 00:06:14,720 --> 00:06:17,760 And there are also target-specific naming conventions. 72 00:06:18,140 --> 00:06:26,940 What I mean by that is, let's say you don't see that ius-dr-oldapple.com. 73 00:06:26,940 --> 00:06:32,400 I mean, how would you possibly find this subdomain if it doesn't show up in a standard word list, right? 74 00:06:33,060 --> 00:06:37,280 And there are also like unusual patterns, nonsense things all over there. 75 00:06:37,280 --> 00:06:45,200 I mean, there's no way you can find out these subdomains if they didn't get exposed from certifications or Google Docs. 76 00:06:47,360 --> 00:06:49,400 And how to get more of them? 77 00:06:49,400 --> 00:06:57,600 We should first reverse engineering the naming logic and identify if there's like any environment region flags or numbers. 78 00:06:57,600 --> 00:06:59,440 For example, ius-diags. 79 00:06:59,440 --> 00:07:01,220 It's got to be ius-diagnostics, right? 80 00:07:01,220 --> 00:07:02,540 I mean, we can understand it. 81 00:07:02,540 --> 00:07:05,540 So we will find some abbreviations. 82 00:07:05,540 --> 00:07:08,540 For example, again, diagnostics to diags. 83 00:07:08,540 --> 00:07:11,160 And then we can work for smartly. 84 00:07:11,160 --> 00:07:13,440 And talk is cheap. 85 00:07:13,440 --> 00:07:14,660 It's easy. 86 00:07:14,660 --> 00:07:19,520 But let's try on an real example subdomain. 87 00:07:19,660 --> 00:07:22,500 So what you see is ius-diags-mdn-apple.com. 88 00:07:22,500 --> 00:07:26,360 Has anyone have any guess what this is about? 89 00:07:27,420 --> 00:07:30,860 I mean, let's start decoding it. 90 00:07:31,700 --> 00:07:34,900 I mean, the first part is, come on, it's easy. 91 00:07:34,900 --> 00:07:37,060 Ius-diagnostics, right? 92 00:07:37,300 --> 00:07:40,460 But I had no idea what mdn is. 93 00:07:41,200 --> 00:07:46,860 So I finished my research, so I'll just give you a spoiler here. 94 00:07:46,860 --> 00:07:48,160 The real answer. 95 00:07:48,180 --> 00:07:51,160 It's actually made in North Carolina. 96 00:07:51,160 --> 00:07:53,740 It's because there's an Apple data center as well. 97 00:07:53,740 --> 00:07:59,540 And there are also like other subdomains like mdn-reno-nevada and Newark-New Jersey. 98 00:08:00,060 --> 00:08:09,480 But how should I supposed to know that this mdn was standing for maiden and then after I can generate more subdomains to discover? 99 00:08:10,480 --> 00:08:15,440 Of course, there's something that everything can think of, right? 100 00:08:15,440 --> 00:08:25,680 I mean, we know a guy who knows a subdomain, who knows English, who knows Turkish, who knows Spanish, who knows like every published paper in the world, right? 101 00:08:25,680 --> 00:08:29,620 So let's ask to Cecikci. 102 00:08:29,840 --> 00:08:37,820 And he will ask for that mdn is likely stands for mobile device network or mobile diagnosis network. 103 00:08:37,820 --> 00:08:43,540 And it says it's possibly a centralized server or endpoint involved in routing diagnostics. 104 00:08:43,560 --> 00:08:48,500 And for Newark, it says it's not Newark, it's network, it says. 105 00:08:48,500 --> 00:08:50,640 And for network diagnostics. 106 00:08:51,060 --> 00:08:59,280 I mean, to be honest, in the first round, if I ask directly to Cecikci and if I get this answer, I will be convinced. 107 00:08:59,280 --> 00:09:01,320 I mean, I will not look further. 108 00:09:01,960 --> 00:09:04,680 But it turns out that it's not right. 109 00:09:04,680 --> 00:09:17,700 So what I want to emphasize here is we need to give more context to LLMs or Cecikci as well, because they are just trying to tell the person that comes to their mind. 110 00:09:17,740 --> 00:09:27,900 So instead of asking directly what mdn or nwk stands for, I gave the subdomains I discovered on Apple. 111 00:09:28,200 --> 00:09:34,600 So imagine I gave like two separate subdomain lists. 112 00:09:34,600 --> 00:09:41,940 And at the first one, it can observe that, hey, there is a Miami, there's a New York City, and there's an RNO. 113 00:09:41,980 --> 00:09:46,920 So from that point, he can understand that this RNO stands for Reno, Nevada. 114 00:09:47,300 --> 00:09:57,240 And after this, when looking at the second list, now it can make a connection between the Reno and the mdn and Newark. 115 00:09:57,460 --> 00:10:10,500 And with this way, Cecikci now can understand or any other LLMs can understand that this mdn is not mobile diagnostic network, this Newark is not network, it is name of the places. 116 00:10:10,640 --> 00:10:15,100 So this is why we need to give more context to LLMs or Cecikci. 117 00:10:15,100 --> 00:10:23,880 And after providing this information, Cecikci says Reno is Nevada, it's Maiden, and it's Newark, New Jersey. 118 00:10:24,880 --> 00:10:44,400 And the same thing applies to pathfuzzing as well, but it's kind of a bit harder because you also need to deal with HTTP methods, text tags of the target, I mean, which extension should be used, some naming conventions, for example, there's an underscore between two names, 119 00:10:44,400 --> 00:10:47,020 and of course, there might be some parameters. 120 00:10:47,020 --> 00:10:50,400 And of course, we have a bigger problem here called rate limit. 121 00:10:54,170 --> 00:10:56,850 And let's talk about limitations of traditional methods here. 122 00:10:56,850 --> 00:11:00,870 What traditional methods are we using currently as a security researcher? 123 00:11:01,070 --> 00:11:03,930 I mean, there could be some passive reconnaissance, right? 124 00:11:03,930 --> 00:11:09,250 I mean, you cannot see a subdomain if they are using wildcard certifications. 125 00:11:09,250 --> 00:11:18,590 Or let's say you are in an SSRF situation, you want to discover the internal subdomains, you cannot have previous information because it's a private DNS. 126 00:11:19,310 --> 00:11:22,710 Also, brute force is actually limited by the wordlist you use. 127 00:11:22,710 --> 00:11:31,630 I mean, if you're always using the same seclist wordlist, you won't be getting anywhere because you are using the same wordlist for all the targets. 128 00:11:31,870 --> 00:11:35,070 I mean, targets change, but you are not changing your wordlist. 129 00:11:35,630 --> 00:11:41,730 It's also resource and time-consuming, of course, and you need to have a manual context awareness. 130 00:11:41,730 --> 00:11:50,730 I mean, you need to understand, hey, this is a place, name of the place, or this is the name of the technology, so I need to do more smart fuzzing. 131 00:11:50,870 --> 00:11:53,370 So you need to think yourself. 132 00:11:54,630 --> 00:12:09,610 So, I mean, the most sad part is, actually some guy actually spent hours chaining LFI, log poisoning, RCE to Prevasc and got just $3,000, and I'm sure some of them are here. 133 00:12:09,690 --> 00:12:19,810 And on the other hand, a random guy found an unauthenticated admin panel on some random subdomain called cstabadm2 and got $5,000. 134 00:12:20,010 --> 00:12:21,770 I mean, it's the truth. 135 00:12:21,770 --> 00:12:29,470 And after this, I realized that one day I was doing a regular pen test, okay? 136 00:12:29,470 --> 00:12:42,370 It was a web target, I cannot disclose, of course, so I just signed up to them and I got redirected to that endpoint, api slash user underscore crt. 137 00:12:42,530 --> 00:12:45,170 You probably guessed that, right? 138 00:12:45,170 --> 00:12:49,350 It is abbreviation for user create, of course. 139 00:12:49,690 --> 00:12:53,130 It says HTTP method get doesn't work because it was working with post. 140 00:12:54,010 --> 00:13:00,930 Yeah, so after that legitimate API endpoint, I decided to fuzz that more. 141 00:13:01,070 --> 00:13:07,830 But how can I find a word list contains that kind of API endpoints? 142 00:13:07,910 --> 00:13:17,330 I mean, if you look for, for example, the closest ones to user creation is user underscore creates or user underscore created. 143 00:13:17,330 --> 00:13:23,890 I mean, there is no way you can actually fuzz this API without manual thinking. 144 00:13:24,950 --> 00:13:32,370 So then I thought, I mean, come on, actually we are the smartest ones in the planet and if I cannot do this, who can do? 145 00:13:32,610 --> 00:13:46,290 So we can start thinking, I mean, if there's a user underscore CRT, there might be user underscore DLT, user underscore LSD, user underscore permission, and maybe instead of user, there might be ADM for admin, right? 146 00:13:46,290 --> 00:13:49,470 So admin underscore CRT or list. 147 00:13:50,390 --> 00:14:03,250 But the real problem here is, I mean, none of them have worked, by the way, but the real problem is if I opt to a challenge, how many endpoints I can think of in like five minutes? 148 00:14:03,450 --> 00:14:06,650 And it turns out it's not that much. 149 00:14:06,650 --> 00:14:19,570 I mean, even for just the delayed operation, I can think about, hey, okay, user underscore Dell, user underscore delayed, but then I need to get some dictionary. 150 00:14:21,130 --> 00:14:33,490 And, I mean, you can also challenge yourself how many, how much, like, delayed-related endpoints you can come up with in five minutes, but I bet you won't find any more than any LLMs. 151 00:14:33,490 --> 00:14:53,990 So I just wrote a very basic chat chip, the API wrapper, so it's basically generate many possible endpoints specifically tailored to the same syntax structure that are related to the action, which is delayed, and based on the previous, the found URL, which is API slash user underscore CRT. 152 00:14:54,610 --> 00:15:20,890 And it's come up with, and please be careful that also this U letter is capital, and when I run that basic chat chip, the wrapper, it can come up with user underscore RMV, user underscore ELM, user underscore EXCL for probably exclude, and there's other bunch of options. 153 00:15:20,890 --> 00:15:34,190 I mean, to be honest, I can think like an hour, but I never think about user underscore ELM, for example, or I probably cannot even know what EXCL is. 154 00:15:34,530 --> 00:15:55,770 So I realized that actually LLMs can be useful for that manner, and it was the API user RMV endpoint, which is working with posts, of course, and it allowed me to delete any user account on the target web application, and resulted in a four-digit bounty. 155 00:15:57,310 --> 00:16:02,090 So why AI is the perfect fit for this scenario? 156 00:16:13,060 --> 00:16:19,240 So because they are working for, I mean, they are based on next word prediction, right? 157 00:16:19,240 --> 00:16:27,600 So their whole life purpose is predict the next most probable token based on the context and the statistical patterns. 158 00:16:27,600 --> 00:16:37,000 I mean, if you look at their context is given and the probability of next token is calculated, and the most probable ones will be given as the output. 159 00:16:37,980 --> 00:16:48,780 And if you give like target.com slash admin to an LLM, it can generate like dashboard settings, users, reports, and panel, and some of them will be found and some of them will not be found. 160 00:16:52,320 --> 00:17:03,780 And there's also another functionality of LLMs called distributional semantics, which is, it actually turns words or tokens into vectors. 161 00:17:04,420 --> 00:17:14,020 So the distributional hypothesis says that if two tokens sharing the similar neighborhoods, meaning like meanings, contacts, probably they share the same meaning. 162 00:17:14,020 --> 00:17:24,220 So admin and user words has smaller angle than admin and CSS when you turn those into vectors. 163 00:17:24,340 --> 00:17:30,440 And contextual embeddings helps us to produce the vector after looking at the entire sentence. 164 00:17:30,440 --> 00:17:34,400 So we are not just looking for token by token or word by word. 165 00:17:34,400 --> 00:17:38,900 It understands the whole word and then produces the output. 166 00:17:39,180 --> 00:17:41,740 So I have a quick question. 167 00:17:41,740 --> 00:17:45,980 So which two do you think is more similar? 168 00:17:46,280 --> 00:17:54,440 So let's say there's the API user underscore DLT, which stands for, of course, user deletion operation. 169 00:17:54,440 --> 00:17:59,360 And the second is user remove, related to user deletion again. 170 00:17:59,560 --> 00:18:04,220 And the second option is user deletion and API ADM CRT. 171 00:18:04,220 --> 00:18:06,320 Anyone want to take a guess? 172 00:18:06,320 --> 00:18:08,740 Which one do you think is more closest? 173 00:18:09,060 --> 00:18:09,960 Which one? 174 00:18:10,540 --> 00:18:11,520 AC? 175 00:18:12,840 --> 00:18:14,600 Anyone says AB? 176 00:18:15,420 --> 00:18:16,800 You think AB? 177 00:18:18,460 --> 00:18:26,980 So the result is, I mean, I run a quick transformer LLM here, like small, fast, and contextual one. 178 00:18:26,980 --> 00:18:37,820 And the result is A and B is 0.3 and A and C is 0.5, which means A and C is much more closer. 179 00:18:37,920 --> 00:18:46,980 And which actually blows my mind because when you think about this, I mean, let's say A is the real path of the target web application. 180 00:18:46,980 --> 00:18:52,780 So which one do you think is more probable to exist in the target application? 181 00:18:53,200 --> 00:18:59,080 I mean, they probably didn't use somewhere user DLT and somewhere user underscore remove, right? 182 00:18:59,080 --> 00:19:01,120 There's two different abbreviations. 183 00:19:01,120 --> 00:19:06,300 One has capital letter, one doesn't have any capital letters. 184 00:19:06,320 --> 00:19:15,400 But in the other hand, LLMs can understand this, this is a user and this is an admin, and this is a delayed function and this is a create function. 185 00:19:15,400 --> 00:19:23,660 So they have the same abbreviations, they have the same capitalization, so that it thinks that A and C is much more closer. 186 00:19:25,320 --> 00:19:39,760 And transformer architecture and self-attention of the LLMs, modern LLMs rely on transformer architecture, which means they are just like not looking for the adjacent tokens, also looking for longer range dependencies. 187 00:19:39,840 --> 00:19:51,600 For example, for this API endpoint, they will look for, I mean, when generating the next possible token, it just, it will look to the whole URL. 188 00:19:51,600 --> 00:20:00,980 I mean, it will look to version check, it will do some resource slot, like instead of version one, it can do version two, but instead of users, it can do accounts as well. 189 00:20:03,140 --> 00:20:07,020 And the fun part, using AI for smart enumerations. 190 00:20:08,440 --> 00:20:14,440 So, first thing that comes to everyone's mind, I guess, check GPT APIs, right? 191 00:20:14,440 --> 00:20:18,560 I mean, it's one of the best in the world, why we cannot use it? 192 00:20:18,660 --> 00:20:23,380 There's an obvious reason, before that obvious reason, let's dig in a bit. 193 00:20:24,460 --> 00:20:29,420 Yeah, what a great idea you have, asking check GPT to do it, no one has to think about it. 194 00:20:31,520 --> 00:20:33,180 But it's actually good. 195 00:20:33,360 --> 00:20:39,280 I mean, it's not trained specifically for subdomain enumeration or path enumeration, but it's actually good. 196 00:20:39,280 --> 00:20:52,040 Because when I give some of the subdomains and ask for ten more possible subdomains and if you look closely, there's Carrier, Bluff, SmallBlind, and Vegas underscore Envy. 197 00:20:52,040 --> 00:20:54,460 They're kind of poker-related, right? 198 00:20:55,080 --> 00:21:00,780 When I ask for ten more subdomains, it will produce this. 199 00:21:03,080 --> 00:21:12,920 BigBlind, Flop, AllIn, Fault, Monte underscore Carlo, and River, Cashout, like poker-related things. 200 00:21:12,920 --> 00:21:21,320 And also Resume.OzgunKurtekin.com, which is Carrier-focused because I gave Carrier.OzgunKurtekin.com as well. 201 00:21:21,320 --> 00:21:23,940 So it did pretty much good job. 202 00:21:24,280 --> 00:21:27,840 But the real problem here is this, of course. 203 00:21:27,840 --> 00:21:36,280 I mean, you cannot use the check GPT forever when generating subdomains or pets because it will be a hella money. 204 00:21:37,340 --> 00:21:40,760 So the second option is using LSTMs. 205 00:21:40,760 --> 00:21:46,840 LSTM is not LLMs, but it's more like long-short-term memory. 206 00:21:47,020 --> 00:21:50,000 I think it's invented much more before LLMs. 207 00:21:50,440 --> 00:21:58,500 So it's type of RNN, like Recurrent Neural Network, designed to process sequences token by token. 208 00:21:58,500 --> 00:22:06,700 And it has a basic memory mechanism so that it can keep the previous tokens as well. 209 00:22:07,200 --> 00:22:12,920 And what we did here is train the LSTM to predict the next subdomain level. 210 00:22:13,760 --> 00:22:20,560 And there's a beautiful research called Offensive AI, and I think it's very underrated job. 211 00:22:20,560 --> 00:22:28,700 I hope I pronounced them correctly, but Alberto Castagnaro, Mario Conti, and Luca Paola released a paper about this. 212 00:22:28,700 --> 00:22:40,280 They trained their LSTM with university, hospital, company, and government data, and it actually acted quite well in those types of subdomains. 213 00:22:40,760 --> 00:22:45,260 And it's their GitHub page and the link of the paper. 214 00:22:45,920 --> 00:22:49,540 As I said earlier, I think it's a very underrated paper. 215 00:22:49,740 --> 00:22:51,160 You should definitely visit. 216 00:22:51,720 --> 00:22:54,440 So I tried mine. 217 00:22:54,660 --> 00:23:09,480 So I just took the Apple subdomain, which is like a quite high number of subdomain they have, and I prepared a subdomain training list consisting of root domain, current partial subdomain, and the target label. 218 00:23:09,480 --> 00:23:18,240 So what I'm saying there is, if you see parse.apple.com, you can think of 0-career2. 219 00:23:20,100 --> 00:23:27,220 Or for this one, for example, if you see iso.apple.com, you can come up with stage-huxley. 220 00:23:27,220 --> 00:23:28,520 That's what I'm saying. 221 00:23:28,520 --> 00:23:31,640 And I didn't do any like data cleaning, data preparation. 222 00:23:31,640 --> 00:23:33,440 I just gave all the subdomains. 223 00:23:34,120 --> 00:23:47,160 And training was like up to 200 epochs, early stopping based on the validation loss, of course, because it's converged around like 35, and the valid loss was 1.15. 224 00:23:48,080 --> 00:23:51,600 And when I run it, and it has like so limited knowledge, right? 225 00:23:51,600 --> 00:23:53,860 I just gave the Apple subdomains here. 226 00:23:53,860 --> 00:24:00,020 And when I asked for new Apple subdomains, it come up with applebot.apple.com, which is new actually. 227 00:24:00,580 --> 00:24:03,540 seer.apple.com is probably already in the list. 228 00:24:03,900 --> 00:24:13,080 But when I asked for two subdomains at the same time, it's actually trying to come up with much more creative things. 229 00:24:13,580 --> 00:24:30,800 For example, this connectivity for, sorry, this iamstk-r1.corp.apple.com was not exist on the any word list, but it takes parts of multiple subdomains and combine it. 230 00:24:31,080 --> 00:24:34,260 So I think it was pretty good. 231 00:24:34,260 --> 00:24:38,160 But we got some problems, of course. 232 00:24:38,180 --> 00:24:48,340 For example, if you give like edu.apple.com, or stage.apple.com, or any random thing.apple.com, it will come up with the same subdomains. 233 00:24:48,340 --> 00:24:48,980 Why is that? 234 00:24:48,980 --> 00:24:56,080 Because LSTM didn't know there is a token like edu, or there is a token like stage. 235 00:24:56,600 --> 00:25:06,880 Because my configuration was, if there's like less than five occurrence, let's just don't take it as a token, and actually Apple doesn't have any like stage subdomain. 236 00:25:06,880 --> 00:25:12,500 They all look like environment dash stage, or x dash stage. 237 00:25:12,500 --> 00:25:14,160 So there's always like a dash. 238 00:25:14,160 --> 00:25:25,360 So I take dash as tokenizer as well, like hyphens, and then tried that again, and this time it can come up with new subdomains that never seen before. 239 00:25:26,000 --> 00:25:30,800 So it was a pretty good, but like not satisfied me at all, but it was a good one. 240 00:25:30,800 --> 00:25:34,640 And finally, using LLMs for that manner. 241 00:25:36,300 --> 00:25:41,940 LSTMs were good, but as I said earlier, they process input pretty much sequentially. 242 00:25:41,940 --> 00:25:59,280 So they can say that, hey, there might be student2.apple.com by seeing student1.apple.com, but they cannot guess edu.apple.com, because they don't know students and edu keywords are actually same context, because they are not intelligent. 243 00:25:59,920 --> 00:26:02,780 And why we are switching to LLMs? 244 00:26:02,780 --> 00:26:09,660 Because they are creative, they can make smarter guess, they are better at understanding, and they are transformers. 245 00:26:10,300 --> 00:26:14,800 LSTMs copies the sequences, but on the other hand, LLMs will understand it. 246 00:26:14,800 --> 00:26:17,660 LLMs will see the whole context at once. 247 00:26:17,700 --> 00:26:25,960 And also LLMs will understand the company naming patterns and invent realistic ones, if it doesn't see that any earlier. 248 00:26:27,380 --> 00:26:35,960 So I first start with choosing the model nano GPT framework, so you can just train from scratch, there's no pre-trained data in it. 249 00:26:35,960 --> 00:26:47,680 And it's very lightweight, and I also, if I'm not mistaken, I also used Apple subdomains for training, and there was 10.6 million parameter in my case. 250 00:26:48,080 --> 00:26:55,140 And in trial, it was able to generate this kind of subdomains, which is kind of okay to me. 251 00:26:55,140 --> 00:27:02,370 I mean, it's also not seen before, and they look pretty okay, if you think about other subdomains in Apple. 252 00:27:03,680 --> 00:27:08,900 And there's a tool called SubViz, created by Hadrian company. 253 00:27:09,400 --> 00:27:17,740 I think this is the first subdomain generator using LLMs that comes to public, because I've never seen it before. 254 00:27:17,740 --> 00:27:23,930 They are using nano GPT with over 17 million parameters, trained on 26 million tokens. 255 00:27:25,120 --> 00:27:36,320 And what they're saying is, they've seen, for their internal testing, they've seen up to 10% increase in discovered subdomains. 256 00:27:36,720 --> 00:27:40,460 That's from their blog. 257 00:27:40,460 --> 00:27:42,580 You can also check their tools as well. 258 00:27:42,580 --> 00:27:45,680 I also tried their tool too. 259 00:27:45,680 --> 00:27:48,300 For example, you can also use their Python wrapper. 260 00:27:48,300 --> 00:28:02,220 I gave my non-subdomains for Apple, every of them, like education-related, lab, uni, ed school, and its output was like research, some sports, id.apple.com. 261 00:28:02,220 --> 00:28:07,260 I mean, not perfect, but it still gives me pretty much good options. 262 00:28:07,420 --> 00:28:08,960 But not great. 263 00:28:09,400 --> 00:28:23,860 So, after that, I choose model GPT-2, because GPT-2 small has over 100 million parameters, large has over 700 million parameters, and it's already pre-trained on Webtech, so it already knows something, right? 264 00:28:23,860 --> 00:28:31,060 So it can invent realistic and unseen ones, and I can fine-tune it with subdomains I discover. 265 00:28:31,760 --> 00:28:39,560 And when I tried that, after the training part, it gave me something like this. 266 00:28:39,560 --> 00:28:52,020 I mean, I didn't like it too much, but there are also some logical ones, because Apple also has these IP things as well, but I think it should understand that it's IP and acts like that. 267 00:28:52,020 --> 00:28:55,000 So I was a big fan of it. 268 00:28:55,380 --> 00:28:56,800 And our file. 269 00:28:56,900 --> 00:28:59,940 So it was QN3 4 billion one. 270 00:29:00,760 --> 00:29:07,500 We choose that because it's way larger than GPT-2 and way smaller than GPT-3.5. 271 00:29:07,760 --> 00:29:19,160 And it has modern transfer architecture, it has good statistical things among other open source models, it can support long context lengths, and it's balanced. 272 00:29:19,800 --> 00:29:22,760 And how did we train it for subdomain enumeration? 273 00:29:22,760 --> 00:29:37,740 So I trained it with over 5,000 domains, which has over 22 million subdomains, and all the training data was looking like domain name is portsever and related subdomains of portsever is like this. 274 00:29:37,740 --> 00:29:40,400 And I think there's like 22 million of them. 275 00:29:40,560 --> 00:29:43,200 For the path enumeration, the same. 276 00:29:43,200 --> 00:29:51,960 There were over 600,000 domains and subdomains and corresponding 28 million paths. 277 00:29:52,100 --> 00:29:55,020 And paths were looking like the same. 278 00:29:55,020 --> 00:30:02,780 Domain is DE, for example, and the related paths are account myreviews and stuff. 279 00:30:04,480 --> 00:30:13,680 And our models, of course, will be all open source, and we will be sharing after this talk, actually. 280 00:30:13,680 --> 00:30:21,000 For subdomain enumeration and for path enumeration, I will leave the links after the talk as well. 281 00:30:21,880 --> 00:30:26,600 So let's talk about some fun parts, the example scenarios of it. 282 00:30:27,040 --> 00:30:35,240 So as SubVis did, you can just give a list of non-URL paths observed on the target domain and expect LLM to generate more. 283 00:30:36,200 --> 00:30:51,080 So system prompt will be something like, you're a path generation model trained to assist in web reconnaissance, and given a list of non-URL paths for a specific target, your job is to suggest other realistic and likely paths for the same target. 284 00:30:51,080 --> 00:30:52,260 It's basic, right? 285 00:30:52,260 --> 00:31:00,440 And my user prompt was, let's say I discovered these endpoints, these paths, like login card, checkout product. 286 00:31:00,440 --> 00:31:02,740 I mean, it's clearly e-commerce company, right? 287 00:31:02,740 --> 00:31:08,820 So based on this, suggest 10 more realistic paths that might exist on the same website, I asked. 288 00:31:08,820 --> 00:31:20,440 And the default preset of QM3 4 billion was products, clothes, accessories, bags, wish list, contact, account, orders. 289 00:31:20,440 --> 00:31:24,840 I mean, pretty much related to e-commerce, so I think it was good. 290 00:31:24,880 --> 00:31:30,460 And in our test, I also write a Python code for this. 291 00:31:32,120 --> 00:31:48,060 So firstly, it's like generating with temperature 0.6, and after this, I gave Defcon 32 as domain, and it will come up with collections, collection of accessories, collection bags, and stuff. 292 00:31:48,060 --> 00:31:55,760 And also, something like, some of them does not make any sense, because copy of 2028 and 600, and stuff like this. 293 00:31:55,760 --> 00:32:01,440 So it was not perfect, but it also can come up with new ones too. 294 00:32:02,500 --> 00:32:06,180 And same applies for subdomain generation as well. 295 00:32:06,180 --> 00:32:13,280 So we can send some already known subdomains to target and expect it to generate much more. 296 00:32:14,620 --> 00:32:23,840 Again, your subdomain generated model trained to assist in web reconnaissance, given a list of non-subdomains, come up with newer ones. 297 00:32:24,960 --> 00:32:32,660 And my prompt was shop.example2.com, dev.example2.com, and generate 10 more subdomains. 298 00:32:33,660 --> 00:32:41,580 And the default Quentry 4b come up with admin, blog, support, mail, contact, help docs. 299 00:32:41,580 --> 00:32:47,980 I mean, they look good, but I gave dev. 300 00:32:47,980 --> 00:32:53,840 There is clearly something with development, stage environment, and something like that, right? 301 00:32:53,840 --> 00:32:59,050 But we didn't see any development-related things in Quentry's result. 302 00:32:59,980 --> 00:33:17,860 And the one we fine-tuned with Preset and also trained with millions of subdomains, it can come up with accounts-dev, accounts-api, dev-api, staging.api, test-staging, api-dev, and more on. 303 00:33:17,860 --> 00:33:22,440 So it's much more related to what I actually gave as input. 304 00:33:24,700 --> 00:33:31,320 And the most fun part is actually we can use it in an agent structure. 305 00:33:31,700 --> 00:33:36,680 So let's say user just inputs a single real subdomain of the target. 306 00:33:36,680 --> 00:33:40,080 Like, not a list of subdomains, just a single real subdomain. 307 00:33:40,400 --> 00:33:58,860 What LLMs will do is deconstruct that subdomain into parts, identifies that parts and these corresponding patterns and symbolic slots, and as an output, a list of realistic pattern-consistent subdomain candidates will be given to us. 308 00:33:58,860 --> 00:34:00,760 So how will it look like? 309 00:34:01,600 --> 00:34:05,500 So let's start from the top left. 310 00:34:06,300 --> 00:34:13,700 So user will start like, hey, give me possible subdomains of apple.com, use this specific subdomain to enumerate. 311 00:34:13,700 --> 00:34:25,100 And our given subdomain is activate-iphone-use1-cx02.apple.com and it's a real subdomain of Apple, actually. 312 00:34:25,400 --> 00:34:42,520 So when user gives that, what our first LLM, the first part of the agent, will do is turn this activate-iphone into activate-product-use-region-id and cx-cluster-id. 313 00:34:42,860 --> 00:34:49,140 And then it will identify these variable slots and give some symbolic representations. 314 00:34:49,140 --> 00:34:56,000 For example, it will know that after the activate keyword, I need to put some Apple product. 315 00:34:56,080 --> 00:34:58,420 After that use, I need to use some digit. 316 00:34:58,420 --> 00:35:03,360 And after the cx, I need to put some digit but with leading zero. 317 00:35:04,680 --> 00:35:13,280 And after this, in this agentic structure, we are coming to the second part, second LLM, which trained with our data. 318 00:35:13,580 --> 00:35:19,320 It will use its internal knowledge and create an intelligent list of Apple product first. 319 00:35:19,320 --> 00:35:28,240 So it can use Mac, iPod, iPad, iPhone, or watch, and it will iterate over possible combinations. 320 00:35:28,240 --> 00:35:35,180 I mean, it's just not iterating over product, it's also generating region IDs and digits with leading zero. 321 00:35:35,180 --> 00:35:41,780 And then after that, it will iterate over combinations to generate realistic subdomain variants like this one. 322 00:35:41,780 --> 00:35:48,440 Instead of activate-iPhone, it will say activate-Mac-use-to-cx-01. 323 00:35:49,860 --> 00:36:00,800 And if you wish, of course, after all of this agentic structure, you can just validate this subdomain as well using DNSx, HTTPS, whatever you like. 324 00:36:01,600 --> 00:36:04,020 And let's see that in action actually. 325 00:36:04,020 --> 00:36:18,380 So when I run my program with the single subdomain inputs, so it will firstly identify the pattern, like the agent one, pattern inference one, action, product, region, cluster ID, environment, number. 326 00:36:18,380 --> 00:36:26,740 Then it will come up with some variable slots, like activate, action, enable action, register action, setup action. 327 00:36:26,740 --> 00:36:31,000 And for the products, iPhone, iPad, Mac, or watch. 328 00:36:31,000 --> 00:36:35,000 For the region, environments, and numbers, it generates something. 329 00:36:35,500 --> 00:36:40,900 And then it generates much more based on each of the identified patterns. 330 00:36:41,040 --> 00:36:46,120 And then in the end, it will come up with a list looking like this. 331 00:36:46,300 --> 00:36:50,820 So there's like enable iPad, ew1, prod01. 332 00:36:50,820 --> 00:36:58,440 I mean, I certainly cannot think about it when I think about this manually, but our agentic structure can do it. 333 00:36:59,340 --> 00:37:01,500 And semantic endpoint discovery. 334 00:37:01,500 --> 00:37:07,300 This is also fun one because user also giving a single observed path here. 335 00:37:07,300 --> 00:37:14,720 And what LLM will do is, again, we will be giving the API V to user underscore CRT. 336 00:37:14,720 --> 00:37:19,000 I'm using the same example here with my case. 337 00:37:19,020 --> 00:37:21,740 So we are asking for to generate much more. 338 00:37:21,820 --> 00:37:38,100 And it will first understand there's a versioning convention, user, like the shorthand for user, and abbreviation here for create, and starts with a capital letter, and also extract the potential variable slot. 339 00:37:39,540 --> 00:37:47,320 And after this, it is generating output for, it will be an input for the other LLM. 340 00:37:47,320 --> 00:37:53,380 We are just giving some hints, other LLM, to generate a new path based on this. 341 00:37:54,340 --> 00:38:09,640 And the other LLM retrieved the YAML file or the JSON file as an output from LLM1, and starts generating each section of the retrieved path. 342 00:38:10,340 --> 00:38:20,060 And after that, it can, of course, try this, as we said, as we seen earlier, there might be an API data agent as well. 343 00:38:20,060 --> 00:38:25,340 So in action, it's doing the same thing, like we have seen already. 344 00:38:25,480 --> 00:38:35,320 So there's like, it understands that there's an entity in action, and as a result, it will generate pretty much good results, like ADM and user and other stuff. 345 00:38:38,760 --> 00:38:47,280 And what are we releasing is new models and features, of course, because I originally trained it with 4 billion parameters. 346 00:38:47,680 --> 00:38:52,320 I will also train it with 1.3 billion so that everyone can run it locally. 347 00:38:52,980 --> 00:39:04,260 And we are going to categorize data like tech, finance, Apple, so that if you look for Samsung's subdomains, it can use Apple's subdomains, because they are both tech-related. 348 00:39:04,620 --> 00:39:08,120 There will be prioritization based on the enumeration result. 349 00:39:08,120 --> 00:39:14,380 For example, if you see login-dev, it will mark as hide, because login page and development. 350 00:39:14,620 --> 00:39:19,700 And our agentic target analyzer will be able to answer questions we ask about the target web. 351 00:39:20,760 --> 00:39:24,080 Releases, of course, it's hopefully not be like that. 352 00:39:24,080 --> 00:39:27,440 For all models, it will be published in Enumerate. 353 00:39:27,440 --> 00:39:30,340 For GitHub, this is the corresponding page. 354 00:39:30,340 --> 00:39:33,220 And you can check everything from enumerate.com. 355 00:39:33,700 --> 00:39:37,880 It currently is like a blank page, but there will be something. 356 00:39:38,020 --> 00:39:42,240 You can just go to the enumerate.com and follow the links from there. 357 00:39:42,240 --> 00:39:43,580 That will be published. 358 00:39:43,860 --> 00:39:46,560 And final verse, I would like to thank Alican Kras. 359 00:39:46,560 --> 00:39:49,760 He is a senior staff engineer at Trendyol. 360 00:39:50,360 --> 00:39:53,300 Some of them maybe know him already, Alican. 361 00:39:53,600 --> 00:40:03,700 He is the inventor of the Seneca LLM and Baron LLM, which are very cybersecurity-related trained big models you can use, and they're all open source. 362 00:40:03,700 --> 00:40:09,320 And he helped me with this all LLM stuff so much, so I couldn't have done without him. 363 00:40:09,320 --> 00:40:10,640 So thanks to him. 364 00:40:11,240 --> 00:40:13,700 And of course, thanks for listening to me. 365 00:40:13,820 --> 00:40:22,520 These are my address, and if you have any questions, I know we don't have pretty much time, but I will be happy to listen and answer after this talk.