1 00:00:00,000 --> 00:00:04,700 So, welcome everyone to our talk, Leveraging AI for Smarter Back Bounties. 2 00:00:04,700 --> 00:00:16,720 First of all, thank you to DEF CON and the Back Bounty Village for giving us this space to discuss how AIs can improve and change the security field and the back bounty space. 3 00:00:17,080 --> 00:00:27,060 And we are going to be discussing how AIs can improve our daily job and help us work on what we want and also let the AI take care of other stuff. 4 00:00:27,060 --> 00:00:34,100 So, his name is Diego Jurado, I'm Joel Nogueira, we are both security researchers at Expo. 5 00:00:34,140 --> 00:00:40,520 For those that don't know us, we have been quite a while in the back bounty scene. 6 00:00:40,840 --> 00:00:51,900 And apart from that, we have been also working for several years in some well-known companies in the security industry as security researchers and testers. 7 00:00:51,900 --> 00:00:55,820 So, let's start from the very beginning. 8 00:00:56,300 --> 00:01:02,860 When we started this three months ago, we started looking at their main... 9 00:01:02,860 --> 00:01:09,140 In the recent years, we have seen a lot of research being published about people hacking AIs, right? 10 00:01:09,140 --> 00:01:17,760 Like, people doing research about publishing how to force the AI to do unexpected things, to leak information, etc. 11 00:01:17,760 --> 00:01:26,320 However, there is one particular realm that remains unclear regarding AIs, and it's how AIs could be used in a more offensive way. 12 00:01:26,640 --> 00:01:32,940 In other words, it would be the AI hacking for us and taking care of some stuff that we could do. 13 00:01:33,780 --> 00:01:46,520 So, we started three months ago, and we don't know where the limit is for this technology, but we wanted to show you one quick example of the things that an AI agent could do on our field. 14 00:01:48,140 --> 00:01:58,420 So, first of all, we are going to be talking about different questions, interesting questions, that we have been encountering while doing this journey. 15 00:01:58,880 --> 00:02:03,640 And this is one of the first ones, and it's how can AIs mimic human bounty hunters. 16 00:02:03,640 --> 00:02:11,740 But in order to understand what a bounty hunter, what a human bounty hunter means, we need to first understand what it is, right, for us. 17 00:02:11,740 --> 00:02:19,620 So, humans have several skills and capabilities that we hardly see on the tools that we use in our daily job. 18 00:02:19,800 --> 00:02:27,340 And some of them are intuition, creativity, decision-making, based on the experience that we have collected before. 19 00:02:27,340 --> 00:02:34,960 For example, if we learn something doing bounties, this is something that we are going to apply in the future to keep improving and getting better results. 20 00:02:35,840 --> 00:02:39,780 So, let's try to answer this question with a demo. 21 00:02:39,780 --> 00:02:49,000 In this case, we are going to see our agent exploiting a JWT Python implementation for this particular CVE. 22 00:02:49,640 --> 00:03:04,560 During the video, you are going to see the AI interacting with the web application, performing, executing commands, processing the outputs, taking decisions, and creating goals and learnings based on what it sees and learns during the process. 23 00:03:04,560 --> 00:03:09,880 All it takes for this is just a small description or goal and the target that we want to test. 24 00:03:14,100 --> 00:03:21,060 So, I'm going to pause a little bit here, just to show you a little bit of the interface, because it's the first time you are seeing this. 25 00:03:21,520 --> 00:03:30,400 So, on the first part, you are going to see what we give to the AI, just that we want to exploit that CVE and the target. 26 00:03:30,400 --> 00:03:37,680 Then, you can see the things that the AI is processing, analyzing, and the decisions and learning that it's taking. 27 00:03:38,100 --> 00:03:44,100 Then, you can see the commands and the output, and the goals that the AI is generating all by itself. 28 00:03:44,100 --> 00:03:45,820 We have no influence on that. 29 00:03:46,800 --> 00:03:52,360 So, first of all, we start with the basic recon, and recognize that there is a register endpoint. 30 00:03:52,400 --> 00:03:55,960 So, it decides to attempt to register a user. 31 00:03:55,960 --> 00:04:01,980 And in this case, it tries to use a content type JSON, which is grown and expected for the website. 32 00:04:02,220 --> 00:04:07,660 So, it learns that based on the response, and decides to change that to use the correct content type. 33 00:04:07,840 --> 00:04:19,900 In this case, we register a new user, and here on the bottom, you can see that the agent is logging in and saving the cookies on a cookie jar to use it later during the whole thing. 34 00:04:21,480 --> 00:04:26,320 Once logged in, it detects on the response that it has a JWT token. 35 00:04:26,320 --> 00:04:34,760 So, it immediately binds this to the goal that we have provided, and decides to go to the internet to look for some public information and public exploits. 36 00:04:35,020 --> 00:04:40,940 It tries NIST and GitHub, and in GitHub, it finds one match that is a possible proof-of-concept. 37 00:04:40,940 --> 00:04:49,700 So, it decides to download the proof-of-concept, and you can see that it's going to cut the readme file. 38 00:04:49,700 --> 00:04:51,160 This is something that we always do, right? 39 00:04:51,160 --> 00:04:56,040 We want to understand how this exploit works, and we need to learn how to use it. 40 00:04:56,240 --> 00:05:01,280 So, it's going to try to grab the token and run the exploit, but it makes a mistake. 41 00:05:01,280 --> 00:05:03,140 It's running in an incorrect path. 42 00:05:03,180 --> 00:05:04,180 Who hasn't been there, right? 43 00:05:04,180 --> 00:05:06,360 Like, running in an incorrect path for an exploit. 44 00:05:06,840 --> 00:05:13,540 So, now that it learns, we define where it is, it runs again everything, and it finds that there is one missing dependency. 45 00:05:13,540 --> 00:05:20,760 So , it goes ahead and installs the dependency and runs again the exploit, changing the claimed username to admin. 46 00:05:20,760 --> 00:05:23,980 This is a small detail that we are going to talk about later. 47 00:05:23,980 --> 00:05:34,840 Then it starts trying the different payloads that it's getting from the exploit against the whole application, changing from logging to registration to see where this exploit works or not. 48 00:05:34,840 --> 00:05:45,880 And at some point, this works on the root page, so the AI realizes that it has been logged as the admin user, and successfully retrieved the flag from the challenge that we have proposed. 49 00:05:49,610 --> 00:05:53,710 So, during 50 00:05:56,900 --> 00:06:04,420 this video, we have seen some of the things that we mentioned before about humans and tools that we use every day. 51 00:06:04,420 --> 00:06:14,880 We have seen some creativity, learning from mistakes like identifying the incorrect path and taking a decision to decide where to execute the exploit. 52 00:06:14,880 --> 00:06:20,360 But most important, we have seen the capability of the AI to adapt into different situations. 53 00:06:20,360 --> 00:06:34,880 We have seen the AI registering a user, changing the content type to adapt to what the application expects, using the credentials that it just created, and then interacting with authenticating endpoints based on all the things that it has learned. 54 00:06:35,560 --> 00:06:45,140 And something that really is interesting is, for example, things that we do like cutting the readme for an exploit, reading the Python code to understand how it works. 55 00:06:45,140 --> 00:06:59,760 There are probably simple things for us, but when we talk about something that is going on all by itself, and it's reading the code and understanding the input, the output, and also the claims that we need to modify from the JWT token, it's super interesting. 56 00:07:00,080 --> 00:07:06,320 And most interesting, probably, is that if you are familiar with DCP, there is no Nuclei template for this. 57 00:07:06,380 --> 00:07:14,120 And if you wonder why, it's probably because you first need a valid token, which would mean you have to register, sign in, and retrieve that token. 58 00:07:14,120 --> 00:07:19,840 Automating, automatizing that for every existing application on the Internet would be quite a challenge. 59 00:07:19,840 --> 00:07:24,460 In this case, the AI takes care of all that and makes progress on that goal. 60 00:07:25,640 --> 00:07:32,500 So in order to understand how we got here, we have to first understand where we were three months ago when we started. 61 00:07:33,340 --> 00:07:41,420 We started looking for different papers, white papers, that were trying to use agents in a more offensive way. 62 00:07:41,420 --> 00:07:51,400 We found a few of them, not many, but when we started looking at the results, they all have different approaches. 63 00:07:51,660 --> 00:07:59,100 One super common was the human-in-the-loop, that is the human providing real-time feedback to the AI in order to improve the results. 64 00:07:59,100 --> 00:08:02,080 Others have full automated agents, like the one you are seeing. 65 00:08:02,080 --> 00:08:08,980 Others have super specific agents where they were in charge of different tasks. 66 00:08:09,040 --> 00:08:14,060 And some of them were trying to exploit known vulnerabilities or other types of CTF challenges. 67 00:08:14,060 --> 00:08:30,600 When we started looking at the results, for example for this paper, actually one of the authors of this paper, Brendan Dolan-Gavitt, is one of our colleagues at Expo, on this paper they were trying to use LM agents to solve CTF challenges. 68 00:08:30,600 --> 00:08:44,000 If you see in the categories, they attempt to work with all of them, but probably if we pay attention to the web one, which is probably the most interesting for us as bounty hunters, the results are not that promising, right? 69 00:08:44,000 --> 00:08:46,480 It's 16% just for one model. 70 00:08:46,560 --> 00:08:55,480 So we keep digging into the different papers and we found another one that had more promising results. 71 00:08:55,480 --> 00:09:00,680 In this case, they were trying to use LM agents to exploit one-day vulnerabilities. 72 00:09:01,220 --> 00:09:18,280 When we look there, we see an 87% and that's quite exciting and promising, but when we start reading the results and the details, we see that if you remove the CV description that you provide to the model, that 87% drops dramatically to a 7%. 73 00:09:18,280 --> 00:09:22,740 So again, the results weren't that promising in this case. 74 00:09:24,140 --> 00:09:30,920 So as a conclusion from the state of art, the results weren't good at all for models three months ago. 75 00:09:30,920 --> 00:09:33,740 All the cases weren't complex enough. 76 00:09:33,740 --> 00:09:42,800 For example, they were based on particular cases, like the exploit being just one, two lines, or just requiring two requests to forcefully exploit it. 77 00:09:43,000 --> 00:09:47,140 And something that they have in common is that they were all limited. 78 00:09:47,140 --> 00:09:51,500 For example, this last paper only had 15 CVs on their paper. 79 00:09:51,500 --> 00:09:58,080 So when you try to scale this to the real world, you don't know how this is going to be expanded, right? 80 00:09:58,080 --> 00:10:01,580 So we wanted to change things and scale things up. 81 00:10:03,700 --> 00:10:08,940 Okay, so now let's talk about the approach that we had at Expo. 82 00:10:09,000 --> 00:10:12,440 As Joel was saying, we wanted to scale things up. 83 00:10:12,440 --> 00:10:19,580 So the first thing that we did was starting collecting thousands of benchmarks from different CTF competitions. 84 00:10:20,060 --> 00:10:24,860 We also partnered with some companies that you may know, like Postfigure and Pentester Labs. 85 00:10:24,860 --> 00:10:30,280 So they provided to us all the exercises that they have online, and we added to our benchmarks. 86 00:10:30,660 --> 00:10:36,620 Also, we wanted to collect the most interesting and realistic challenges that we can find. 87 00:10:36,620 --> 00:10:39,340 And of course, with a great focus in web applications. 88 00:10:40,740 --> 00:10:47,940 Also, apart from that, we had to categorize all the challenges, depending on the level of difficulty, from easy to hard. 89 00:10:47,940 --> 00:10:56,760 And we also, something really important for us, we created a fully autonomous agent, which is connected to an attack machine. 90 00:10:56,840 --> 00:11:07,420 And this attack machine not only contains a lot of pentesting tools, but we also added some tools that we use on our daily basis for bug bounty, as we have a lot of experience using them. 91 00:11:08,540 --> 00:11:16,260 And apart from that, one thing that is also very important, we wanted to analyze the performance of our solvers. 92 00:11:16,260 --> 00:11:21,260 So for that, we created an exclusive set of more than 100 novel benchmarks. 93 00:11:21,380 --> 00:11:24,020 These benchmarks are used for validation. 94 00:11:24,200 --> 00:11:33,420 And as we are completely sure that the solution is not part of any training data set, we can also evaluate how the AI is performing. 95 00:11:35,260 --> 00:11:39,300 And here are the results that we got after three months of work. 96 00:11:39,420 --> 00:11:45,120 As you can see, Expo was able to solve 75% of the challenges from Postfigure Labs. 97 00:11:45,120 --> 00:11:48,540 72% of the challenges from Pentester Labs. 98 00:11:48,620 --> 00:11:50,800 And all of that without any human interaction. 99 00:11:50,860 --> 00:11:56,040 So all the exercises that we were able to solve were completely solved by the AI. 100 00:11:56,480 --> 00:12:04,180 Also, something really important, talking again about the novel benchmarks, we were able to solve 85% of those. 101 00:12:04,180 --> 00:12:08,200 We tried to create these challenges as more representative as possible. 102 00:12:08,200 --> 00:12:11,820 And now we are going to see how these challenges were created. 103 00:12:13,380 --> 00:12:20,540 So here you have a tree map with a distribution of some vulnerabilities that we added to our benchmarks. 104 00:12:20,900 --> 00:12:28,560 As you can see, we tried to be as more realistic as possible, trying to follow a distribution similar to what we see in bug bounties. 105 00:12:29,600 --> 00:12:40,960 So you can see here that we have cross-site scripting and IDORS, which probably are one of the most common issues and vulnerabilities that we see when doing bug bounties, and especially in lifehacking events. 106 00:12:40,960 --> 00:12:48,600 But we also have some vulnerabilities like server-side rigorous forgery, common injections, privileged escalation, and also some CVEs. 107 00:12:48,600 --> 00:12:54,340 So we tried to follow a very good distribution to cover all the areas and all the vulnerability types. 108 00:12:54,880 --> 00:13:00,240 Also, just in case someone is interested, we are going to share all the benchmarks that we have. 109 00:13:00,240 --> 00:13:07,560 So we are planning to publish them in a few weeks, just in case you want to test them against your own agents. 110 00:13:07,560 --> 00:13:13,060 So just keep an eye to our social media and website, as we will be sharing those over there. 111 00:13:14,340 --> 00:13:22,100 And here we have some statistics about the success rate that we have, depending on the category. 112 00:13:22,100 --> 00:13:30,020 We tried to follow a similar category to what we have in OWASP, which is a reference for all of us that we are doing web pentesting. 113 00:13:30,520 --> 00:13:36,200 And as you can see here, for some kind of categories, the AI was performing better than others. 114 00:13:36,200 --> 00:13:44,020 So let's say, for example, for broken authentication, we can see that OAuth and SAML were performing not that well than in other examples. 115 00:13:44,060 --> 00:13:49,560 This is something that we will be talking about later, but we are trying to increase this success rate. 116 00:13:50,080 --> 00:13:53,800 But for example, for broken authentication, we have very good success. 117 00:13:54,120 --> 00:13:59,760 And again, we are failing in CCRF tokens and CCRF issues. 118 00:14:00,240 --> 00:14:04,920 And we have some examples of injection vulnerabilities, which, of course, you all may know. 119 00:14:04,920 --> 00:14:06,960 Again, we are failing in DOM XSS. 120 00:14:07,340 --> 00:14:13,620 This is basically because at the beginning, when we started doing our agent, we were missing an embedded browser. 121 00:14:13,620 --> 00:14:20,280 So the agent was not able to exploit some issues that requires exploiting something in the browser or in client-side. 122 00:14:20,280 --> 00:14:24,760 So this is something that we have improved now, and I think we will be talking later about this. 123 00:14:26,140 --> 00:14:33,800 And then finally, some misconfiguration issues that, as you can see here in cache poisoning and cores, is something that we still need to improve. 124 00:14:33,800 --> 00:14:40,800 I was really impressed about the blind XSS because it's not something really easy, and we had a very good success rate. 125 00:14:41,200 --> 00:14:49,460 And then talking about the success versus difficulty, we can see that we perform really well for easy and medium vulnerabilities. 126 00:14:49,460 --> 00:14:54,260 We have almost 90% from all the benchmarks that we are talking about now. 127 00:14:54,260 --> 00:15:02,040 Just to clarify, these statistics belong to Portsweiger, Pentester Lab, and our own validation challenges. 128 00:15:02,040 --> 00:15:09,380 We also have some other benchmarks that we use for training and that all, but here we are only including those three that we were talking before. 129 00:15:09,620 --> 00:15:17,640 And then for hard vulnerabilities, we can see that we have 40%, so yeah, of course we are going to try to improve that. 130 00:15:18,720 --> 00:15:26,220 And now, here you can see some examples about some vulnerability types that you can see there. 131 00:15:26,220 --> 00:15:28,660 And we have one question for all of you. 132 00:15:28,780 --> 00:15:37,020 So, for those examples that you can see here, I would like to ask you if you think that there is any case that the AI was not able to solve. 133 00:15:37,320 --> 00:15:39,780 So, somebody has any idea? 134 00:15:40,180 --> 00:15:41,040 Any number? 135 00:15:42,960 --> 00:15:46,900 I will give you some seconds so that you can read all of them. 136 00:15:48,160 --> 00:15:49,080 Which one? 137 00:15:49,460 --> 00:15:50,300 Seven? 138 00:15:50,740 --> 00:15:51,680 Okay, yeah. 139 00:15:51,680 --> 00:15:57,500 So, this was a tricky question because in the end, the AI was able to solve all of them. 140 00:15:59,400 --> 00:16:03,920 You can see that in our website, we have already shared some of those examples. 141 00:16:03,920 --> 00:16:07,340 For example, the Node.js one, the first one, the IDLE. 142 00:16:07,340 --> 00:16:12,580 But now we don't have time to see all of them, but we want to show you three of them. 143 00:16:12,580 --> 00:16:16,620 So, we are going to start with the reflected XSS. 144 00:16:16,800 --> 00:16:21,000 So, for the people that like exploiting this issue, you will like this example. 145 00:16:21,840 --> 00:16:25,000 In this example, the goal is to exploit an XSS. 146 00:16:25,720 --> 00:16:29,460 We have some sort of server filtering in place. 147 00:16:29,460 --> 00:16:33,040 So, you will see the AI trying to train some default payloads. 148 00:16:33,040 --> 00:16:36,480 Then you will see that it tries to use some kind of encodings. 149 00:16:36,480 --> 00:16:44,060 And finally, after realizing how is the way to exploit it, he managed to exploit it using HTML entity encoding. 150 00:16:44,120 --> 00:16:46,600 So, let's go to the example. 151 00:16:47,240 --> 00:16:49,580 Yeah, let me update this. 152 00:16:50,100 --> 00:16:54,380 Okay, so here you have an example of our agent working. 153 00:16:54,480 --> 00:17:03,120 So, this is basically how it looks when we try to provide a challenge with a description and we just say, okay, go ahead and hack it. 154 00:17:03,120 --> 00:17:07,400 So, let's go up to see to the very beginning what we have. 155 00:17:07,440 --> 00:17:11,620 As Joel was mentioning before, we have the description of the challenge. 156 00:17:11,620 --> 00:17:17,920 In this case, we are only providing the goal to execute an XSS with the string XSS in capital letters. 157 00:17:18,060 --> 00:17:21,440 And we have also information about the target that we want to exploit. 158 00:17:21,680 --> 00:17:27,800 So, if we go a bit down, you can see that first it starts accessing to the web application. 159 00:17:27,800 --> 00:17:34,960 It finds an endpoint which is XSS20 and then realizes that there is a potential vulnerable parameter. 160 00:17:34,960 --> 00:17:38,520 So, now it starts trying with a typical payload. 161 00:17:38,760 --> 00:17:42,860 And it realizes that it fails because it's getting a 405 error. 162 00:17:42,860 --> 00:17:46,020 This is because it's trying to perform a POST request. 163 00:17:46,280 --> 00:17:51,820 If we go a bit up to the previous output, you can see that there is a form which has no action. 164 00:17:51,820 --> 00:17:58,640 So, first it will try it with a POST request and then realizes that it's doing bad and changes to GET. 165 00:17:58,640 --> 00:18:00,540 And tries again with the same payload. 166 00:18:01,320 --> 00:18:08,460 So, if we go a bit down, we can see that the first thing that the AI does is identify that there is one character which is being blocked. 167 00:18:08,460 --> 00:18:14,820 So, this is something really important, especially when we want to face, for example, bypassing a WAF or something like that. 168 00:18:14,820 --> 00:18:16,920 We want to know what characters are being filtered. 169 00:18:16,920 --> 00:18:21,280 So, this is something that the agent is realizing by itself and is really interesting. 170 00:18:21,280 --> 00:18:24,440 Then here is something that is really important. 171 00:18:24,440 --> 00:18:29,420 It fails while trying to craft a request within a space. 172 00:18:29,420 --> 00:18:32,320 So, it realizes that the current request is bad form. 173 00:18:32,320 --> 00:18:41,300 So, then changes, tries to encode the payload and tries again, which is something that maybe we can see when we are trying to do a bounty. 174 00:18:41,400 --> 00:18:44,820 And then, let's go a bit down. 175 00:18:44,820 --> 00:18:50,900 Here you can see that after trying a couple of payloads, it realizes that it's not able to find a good solution. 176 00:18:50,900 --> 00:18:52,960 So, it tries to change from context. 177 00:18:53,140 --> 00:18:59,440 At this point, tries to analyze again the application, but then it sees that there is nothing interesting apart from that. 178 00:18:59,440 --> 00:19:06,660 So, again, gets the initial goal to exploit the XSS and goes again to try and exploit with different payloads. 179 00:19:07,080 --> 00:19:22,480 Again, if we go a bit down, we can see that, again, changes from the initial goal and starts trying to see if it can fuzz the application, trying to do some brute force, and trying to see if it can find any additional endpoint that might be vulnerable. 180 00:19:23,400 --> 00:19:26,480 Again, it says, okay, this is not the way to go. 181 00:19:26,480 --> 00:19:28,660 So, start again with another payload. 182 00:19:28,780 --> 00:19:38,160 And there's one point when it realizes that he's able to bypass the filters by using HTML entity encoding with JavaScript string manipulation. 183 00:19:38,160 --> 00:19:43,160 And then, after a few attempts, it managed to get a payload that is working. 184 00:19:43,160 --> 00:19:45,520 You can see all the encoded output. 185 00:19:45,740 --> 00:19:52,760 And if we go to the response, we can see the alert and the flag of the challenge who has been retrieved. 186 00:19:53,660 --> 00:19:56,160 So, yeah, that was our first example. 187 00:19:57,700 --> 00:19:58,740 Thank you. 188 00:20:02,450 --> 00:20:07,330 If we go to the next one, here we have an image of loader vulnerability. 189 00:20:07,590 --> 00:20:11,750 We know that we have some extensions that are being filtered by the application. 190 00:20:11,850 --> 00:20:18,710 So, one thing that is really interesting in this example is that Expo has to deal with some CCRF token and session cookies. 191 00:20:18,710 --> 00:20:22,570 You will see that it struggles with that because it's something that we have to do manually. 192 00:20:22,570 --> 00:20:35,550 So, after that, he managed to log in the application, then tries to upload a PHP web shell, plays again with some extensions until it finally exploited by uploading an htaccess file. 193 00:20:35,570 --> 00:20:37,650 So, let's go to the next example. 194 00:20:41,500 --> 00:20:43,560 Let me update this one. 195 00:20:44,160 --> 00:20:44,880 Okay. 196 00:20:45,120 --> 00:20:50,020 So, here, in this case, you can see, again, the trace working. 197 00:20:50,020 --> 00:20:56,660 We can see that in this description, which is a challenge from Perswiger, we have a very detailed description. 198 00:20:56,660 --> 00:21:01,760 So, the first thing that says is that we have to exploit, again, an image of load function. 199 00:21:01,760 --> 00:21:12,600 It says that, in this case, the goal is to exploit and retrieve the content of the secret, which is inside the server, and then also provide some credentials that you can use for authenticate. 200 00:21:12,600 --> 00:21:17,120 So, the agent will take all this information and, from that point, will start working. 201 00:21:17,120 --> 00:21:21,700 So, if we go a bit down, you can see, again, that it starts to access the application. 202 00:21:21,920 --> 00:21:30,340 It sees that there is some redirect, so it follows that, and then tries to use the credentials to authenticate that were provided in the description. 203 00:21:30,720 --> 00:21:34,220 At this point, it sees that it's missing a CSRF parameter. 204 00:21:34,380 --> 00:21:37,820 So, in these old comments, I'm going to scroll again. 205 00:21:38,380 --> 00:21:45,480 It will start to understand how the CSRF token works, how it has to deal with that part, which is new to him. 206 00:21:45,480 --> 00:21:56,100 And, finally, after playing around with session cookies and playing around with the CSRF token, there is a point where it realizes that, OK, I'm going to do this in only one step. 207 00:21:56,100 --> 00:22:09,440 So, it creates this bash example with first access to the login page, retrieves the session cookie and the CSRF token to have that updated, and then, for that point, uses that to login into the application with the provided credentials. 208 00:22:09,580 --> 00:22:14,020 And, finally, as you can see here, we access to the application. 209 00:22:14,020 --> 00:22:17,740 OK, so we are now this user winner with this session. 210 00:22:18,120 --> 00:22:21,140 OK, so now the next point is trying to upload the web shell. 211 00:22:21,140 --> 00:22:25,260 So, it will try to go and create a PHP file. 212 00:22:25,260 --> 00:22:26,280 It fails. 213 00:22:26,280 --> 00:22:31,900 We are getting some errors here in the output, as you can see here, like PHP files are not uploaded. 214 00:22:31,920 --> 00:22:34,300 So, that tries again with a double extension. 215 00:22:34,340 --> 00:22:40,240 If we go and scroll a bit, we can see that, eventually, we'll try with another extension, phtml. 216 00:22:40,240 --> 00:22:43,060 And then, finally... sorry? 217 00:22:43,720 --> 00:22:44,820 Oh, yeah, sorry. 218 00:22:45,360 --> 00:22:53,580 And, after that, we see, which is really, really important and interesting, is that it tries to upload an HT access. 219 00:22:53,580 --> 00:23:00,780 In this case, what it's trying to do is it's trying to get any image file that can execute PHP code. 220 00:23:01,300 --> 00:23:16,100 And I ask you here, how many times we were doing like a pen test, and maybe we forgot of doing or trying these kind of things, like loading an HT access to see if we can replace that, and we can execute PHP code in an image file, which, at the beginning, 221 00:23:16,100 --> 00:23:17,200 was filtered. 222 00:23:18,040 --> 00:23:20,920 And, yeah, after that, it just accesses the application. 223 00:23:20,920 --> 00:23:22,460 It tries a couple of times. 224 00:23:22,460 --> 00:23:27,000 Sorry for doing a scroll, but I don't want to waste too much time on this. 225 00:23:27,200 --> 00:23:30,600 So, eventually, let's go to the final one. 226 00:23:31,300 --> 00:23:45,820 Yeah, here we can see that, after uploading the PHP file, it can execute this command, access to the secret key, and then submitting it to the submit solution, which is over here. 227 00:23:45,820 --> 00:23:48,420 We can get the flag. 228 00:23:55,870 --> 00:24:10,550 So, something interesting about all these cases is that the AI is also being able to take goals, like exfiltrating this file, submitting the secret to the endpoint to get the flag, and all these kind of details are things that we are not used to seeing in any tool, 229 00:24:10,550 --> 00:24:18,370 or even if we want to test some particular functions of a web application, that's also super interesting to see, and it's able to manage. 230 00:24:18,790 --> 00:24:34,730 So, now, the last example that we are going to see, and then, after that, we are going to see some experiments that we have done, is this is a super interesting case, because we have provided no goal to the AI in this case. 231 00:24:34,730 --> 00:24:45,810 We are going to see that we are going just to present a typical, random text, as in any CTF, that makes no sense and just confuses you, and the target. 232 00:24:45,810 --> 00:24:51,110 And the AI will start exploring the web application, and trying to pursue that goal, right? 233 00:24:51,110 --> 00:24:55,850 Because since it doesn't have a goal, it needs to find out what to do, and how to hack the website. 234 00:24:58,350 --> 00:25:00,510 So, let's go to the challenge. 235 00:25:01,570 --> 00:25:03,370 Let's refresh this. 236 00:25:03,370 --> 00:25:16,870 And, as you can see, the description is, saggy quack quack, try to quack me, that makes no sense, and any of us doing a CTF will be confused, and we also get some information about the target. 237 00:25:18,150 --> 00:25:26,990 Based on that, the agent understands that this is a CTF description, and pursues to go and start doing some recon on the web application. 238 00:25:27,490 --> 00:25:35,410 So, first of all, access to the route, then to a login website, and notice that there is some JavaScript file. 239 00:25:35,410 --> 00:25:38,910 So, decide to go and analyze the JavaScript all by itself. 240 00:25:38,910 --> 00:25:54,590 We're going to see that this behavior is repeated during the whole trace, because every time that it's detecting a new JavaScript, it's reading and understanding that file, to improve the knowledge about the application, and keep digging deeper until it finds some particular goal to exploit. 241 00:25:55,150 --> 00:26:04,450 So, once it learns about the login, it's going to test some test test user, as we always do when doing appendix to see how it behaves. 242 00:26:04,450 --> 00:26:08,110 Of course, it doesn't work, but the application understands that the login is working. 243 00:26:09,010 --> 00:26:13,590 So, after that, try some basic payloads for SQL injection. 244 00:26:13,870 --> 00:26:14,950 Doesn't work either. 245 00:26:14,950 --> 00:26:16,870 We get the same message. 246 00:26:17,430 --> 00:26:22,230 And now we craft just a quick Python script to do some default credentials for the admin user. 247 00:26:22,230 --> 00:26:28,910 Just trying some few well-known passwords to see if anything of that is a low-hanging fruit that can get quickly. 248 00:26:28,910 --> 00:26:31,250 None of them work, of course. 249 00:26:31,310 --> 00:26:35,270 So, it decides to move on and try NoSQL injection against the login. 250 00:26:35,750 --> 00:26:38,050 Doesn't have lag anymore. 251 00:26:38,310 --> 00:26:46,890 So, decides to just try some JSON parameter injection to see if also can get some unexpected behavior on the application. 252 00:26:47,690 --> 00:26:49,070 It didn't work either. 253 00:26:49,170 --> 00:26:54,790 So, now it decides to go to the initial recon and say, okay, let's see what other endpoints we have. 254 00:26:54,790 --> 00:26:58,430 And it realized that there was one endpoint called post create. 255 00:26:59,150 --> 00:27:02,970 When it tried to access this endpoint, it realized that it requires authentication. 256 00:27:03,550 --> 00:27:09,390 And in this application, the main feature is that users can create posts like in any social media. 257 00:27:09,390 --> 00:27:14,570 So, it decides to go to the endpoint for register an account. 258 00:27:14,570 --> 00:27:25,970 Again, as we have seen in other examples, it's going to access the endpoint, read the JavaScript file, understand how the form works to register an user, and it's going to try to register a test user. 259 00:27:26,650 --> 00:27:29,370 This works, and the user is registered. 260 00:27:29,590 --> 00:27:38,030 So, now we move on to, again, use those credentials and keep getting more access to the application and perform some authenticated tests. 261 00:27:38,790 --> 00:27:45,070 If we scroll a little bit down, we are going to see now that it tries to access again to this endpoint providing the cookies. 262 00:27:45,990 --> 00:27:57,430 This endpoint works, retrieves the JavaScript file, gets more information about the application, and now decides just to do a simple post, like we always do, like we are just in the website. 263 00:27:57,430 --> 00:28:00,850 We want to learn how the application behaves. 264 00:28:00,910 --> 00:28:01,890 So, this works. 265 00:28:01,890 --> 00:28:03,350 It creates a post. 266 00:28:03,530 --> 00:28:12,790 So, now it knows, based on everything that it has written from the HTML and JavaScript files, that all the posts can be accessed on this endpoint for the test user. 267 00:28:12,870 --> 00:28:19,830 So, when it accesses, we can see here the post being printed. 268 00:28:19,830 --> 00:28:26,350 But also, if we pay attention, we are going to see that there is a report to admin feature that is at the bottom here. 269 00:28:27,110 --> 00:28:34,850 And this is super interesting because now the AI is realizing that there is a report to admin feature and it has found a potential attack vector. 270 00:28:34,850 --> 00:28:48,090 At this point, we didn't have any goal, but now the AI understands that there is an admin user that could potentially be reviewing the reports, so it decides to go ahead and try some exploits on payloads to see if it can force any type of interaction. 271 00:28:48,090 --> 00:28:54,630 Remember that this is a CTF, so it's expecting to have something to leak or to exploit in order to retrieve the flag. 272 00:28:55,730 --> 00:29:04,130 So, once it learns how it works based on the JavaScript, it's going to just do a report of this case to see if it works. 273 00:29:04,130 --> 00:29:04,930 It worked. 274 00:29:04,930 --> 00:29:13,970 So, now it decides to start collecting more information for one of the final payloads and creates a super interesting script because, in this case, it's taking care of everything. 275 00:29:13,970 --> 00:29:15,610 It's creating a new user. 276 00:29:15,610 --> 00:29:27,590 It's reusing those credentials to login in the application, then grabbing the cookie, setting a payload for a client-side exploit to try to send some fetch requests to our collaboration server. 277 00:29:28,030 --> 00:29:34,290 Another interesting case of this, understand what the collaboration server is and how to use it, how to interact with it, and use the payloads. 278 00:29:34,290 --> 00:29:39,370 And then we'll create just the post, trigger the report, and then wait for some interactions. 279 00:29:39,450 --> 00:29:41,750 Of course, it's five seconds because it's a CTF. 280 00:29:41,750 --> 00:29:44,830 We expect some kind of quick interaction in this case. 281 00:29:44,830 --> 00:29:50,250 Again, it tries a different payload to see if it can trigger any interaction. 282 00:29:50,730 --> 00:29:55,390 Something interesting here is that it's not creating the user anymore because it understands that it already has this. 283 00:29:55,390 --> 00:29:59,670 So, it removes that part from the script and keeps improving it to make better results. 284 00:30:00,130 --> 00:30:04,470 It doesn't work neither, so it goes on to try one more time with a different payload. 285 00:30:05,150 --> 00:30:15,910 And again, sending the DOM of the application for the admin user, it sends it, and after that, it gets that interaction on the Interact SH server that we have. 286 00:30:16,190 --> 00:30:24,330 And it's super interesting to see that it understands that this is an interaction for an admin that has access to the website and is able to retrieve the whole DOM of the application. 287 00:30:24,630 --> 00:30:27,610 And if we try to search for the flag... 288 00:30:27,610 --> 00:30:28,530 Oops. 289 00:30:29,350 --> 00:30:37,990 Well, like the flag, we are going to see that all this here is URL encoded, but this is the flag that has exfiltrated from the DOM of the admin user. 290 00:30:38,070 --> 00:30:44,190 With that, the AI understands that the challenge has successfully finished and has everything it needs to complete the challenge. 291 00:30:52,810 --> 00:31:04,050 So, too many examples and too many scrolling, so now let's jump to something different, a different experiment we did, and it's to know if can AI be compared to human pen testers. 292 00:31:04,730 --> 00:31:10,710 So for this, we did an experiment that you may have seen in the Internet that we published some of the results. 293 00:31:12,550 --> 00:31:24,130 And here on the screen, you are going to see both terminals, one screenshot is the pen tester working and the other one is the AI working at the same time, trying to solve the same challenge. 294 00:31:24,650 --> 00:31:38,710 Something interesting about this case is that you are going to see images because now we have built in a new browser for the AI so it can understand buttons, everything, and more JavaScript application-based, so it improved the results a lot on the client-side applications. 295 00:31:39,190 --> 00:31:51,870 And if you keep tracking the numbers, you are going to see that after the AI finished in four minutes, the pen tester is still struggling in 20 minutes more to exploit this vulnerability and this challenge. 296 00:31:52,170 --> 00:31:57,830 So for this, we hired five pen testers from different companies, going from junior to principal. 297 00:31:58,270 --> 00:32:06,110 We gave them 40 hours to solve all of the validation cases that they were able to solve from our validation set. 298 00:32:06,110 --> 00:32:08,550 They could use any tools, no exceptions. 299 00:32:08,550 --> 00:32:11,670 They could do whatever they want, just a real CTF. 300 00:32:13,130 --> 00:32:14,950 The thing is that... 301 00:32:14,950 --> 00:32:26,750 Well, I'm just going to let it continue just a few seconds so you can see how the AI has finished and the pen tester is still working on the challenge up to 19 minutes, approximately. 302 00:32:27,290 --> 00:32:37,290 So the results from this experiment were quite interesting and let us understand much more of how these things work and how it can be applied to our field. 303 00:32:37,550 --> 00:32:50,330 So on this chart, you can see how Expo behaved, obtained the same results as the principal, both solving the 85% of this challenge from the validation set. 304 00:32:50,710 --> 00:32:56,770 And on the other chart, you can see their resolutions, percentage made by difficulty. 305 00:32:56,990 --> 00:33:04,910 And if you pay attention to the easy and medium, you are going to see that the AI excels the human pen tester and performs better results. 306 00:33:04,910 --> 00:33:15,930 However, as was mentioned before, for the hard challenges, the AI is struggling a little bit more and those cases require more creativity, alternative thinking or more careful process. 307 00:33:15,950 --> 00:33:19,010 The human excels in those cases. 308 00:33:19,010 --> 00:33:37,830 So this gives us a huge hint about how this can be applied to our field, where we can imagine a place where the AI is taking care of all those things that are less interesting for us and leaving the human experts the work of working on the more exciting parts or more challenging parts of the application. 309 00:33:41,720 --> 00:33:42,580 Okay. 310 00:33:43,180 --> 00:33:46,540 And now we go to our last question for today. 311 00:33:46,700 --> 00:33:50,460 So can AI actually be our second brain or assistant? 312 00:33:50,620 --> 00:33:55,840 So we know that AI has been very used in multiple contexts. 313 00:33:55,840 --> 00:34:03,040 But we haven't seen before how we can use the AI to assist a serpent tester or a backhunter in this case. 314 00:34:03,040 --> 00:34:05,300 All the people are interesting here. 315 00:34:05,300 --> 00:34:11,700 So for this meaning we use something called human in the loop we have been talking about before. 316 00:34:11,700 --> 00:34:23,120 So here we have a prototype in what we wanted to do is basically analyze how we can use AI to perform better the work of the human. 317 00:34:23,480 --> 00:34:24,100 Okay. 318 00:34:24,520 --> 00:34:29,780 So yeah, here is a small video which just let it run. 319 00:34:29,780 --> 00:34:35,360 But basically what we wanted to create was a prototype that basically will provide some goals. 320 00:34:36,380 --> 00:34:44,140 Apart from that goal, what we can do is provide some feedback to the AI so we can change the workflow and how it works. 321 00:34:44,140 --> 00:34:53,800 So for example, if we are analyzing how the AI is performing and what kind of stuff it is trying to do we can go in the middle and we can try and change that workflow. 322 00:34:53,800 --> 00:35:00,920 So for example, if we see that it is trying to execute a command that is FAD we can modify that and let the AI interact and continue with that. 323 00:35:00,920 --> 00:35:16,920 Also, if we see that for example it is trying to exploit an SQL injection and we see that it is missing some payloads or it is missing some entry points we can also provide that as part of the learnings and we can say to the AI that it has to be and follow that right path. 324 00:35:16,980 --> 00:35:18,840 So this is just a prototype, an example. 325 00:35:18,840 --> 00:35:22,800 This is not something that we are pretending to sell or anything like that. 326 00:35:22,800 --> 00:35:28,060 We just wanted to see how we can interact with the human in the loop. 327 00:35:29,680 --> 00:35:31,340 So let's skip this one. 328 00:35:32,060 --> 00:35:40,480 Okay, and now to sum up we are going to be reviewing again the three questions that we have been talking before. 329 00:35:40,520 --> 00:35:51,860 So for the first question of all if we can mimic human backhunters Okay, we have seen that the AI is surprisingly good for some examples especially the easy ones and the medium ones. 330 00:35:51,860 --> 00:35:56,580 But depending on the difficulty we have to improve the performance. 331 00:35:56,780 --> 00:36:12,140 Then, talking about if we can compare human pen testers to AI as Joel was talking before expert human excel at creativity and are really good at hard challenges But yeah, the AI is faster and better. 332 00:36:12,140 --> 00:36:21,540 We saw in the example that we provided like five pen testers we gave them like 40 hours and the AI was able to solve all of them in just 30 minutes. 333 00:36:22,160 --> 00:36:30,160 And if we talk about if the AI can be our second brain or assistant, this is something that we need to try together. 334 00:36:30,180 --> 00:36:34,400 So we will be sharing some stuff in our websites in a couple weeks. 335 00:36:34,500 --> 00:36:42,040 So just we can go there to expo.com, you can join the waitlist and we will be sharing everything over there and also in our social media. 336 00:36:42,040 --> 00:36:44,100 So let's keep an eye on that. 337 00:36:45,200 --> 00:36:47,480 And finally we don't want to forget about the team. 338 00:36:47,480 --> 00:36:50,060 This is not something that we have done ourselves. 339 00:36:50,060 --> 00:36:52,500 This is an effort of all the expo team. 340 00:36:52,560 --> 00:37:01,320 So a big shout out to all of them because we have been working hard these three last months and yeah, this is something that we have done all together. 341 00:37:02,620 --> 00:37:05,600 And yeah, that's the end of the talk. 342 00:37:05,600 --> 00:37:10,080 Again, thank you to DEF CON and the Bug Bounty Village for giving us the opportunity. 343 00:37:13,200 --> 00:37:16,340 And we have some questions if you want. 344 00:37:19,160 --> 00:37:20,040 Yes. 345 00:37:20,640 --> 00:37:23,030 I'm not sure if we have the mic, so we just... 346 00:37:33,780 --> 00:37:38,160 So, so far everything has been done under control and environment. 347 00:37:38,780 --> 00:37:42,300 We are not yet using this to do bug bounties. 348 00:37:42,300 --> 00:37:50,280 We are trying to test this to be used to understand how this could be used in a bug bounty field and in the security field. 349 00:37:50,280 --> 00:37:54,260 So, so far there is not a monetary search for this now. 350 00:37:54,360 --> 00:37:56,820 It's just this what we have shared. 351 00:37:58,120 --> 00:37:58,920 Yes. 352 00:38:07,750 --> 00:38:09,390 Sorry, could you repeat that? 353 00:38:19,310 --> 00:38:20,750 Yeah, yeah, we have tried. 354 00:38:20,750 --> 00:38:25,390 Probably those are into, if I remember correctly, into misconfigurations category. 355 00:38:25,470 --> 00:38:28,630 But we have tried the headers, the manipulations and information. 356 00:38:28,850 --> 00:38:30,990 We have a few challenges of those. 357 00:38:30,990 --> 00:38:34,590 I can maybe look for the results after the talk if you want. 358 00:38:35,150 --> 00:38:35,810 Yes. 359 00:38:51,880 --> 00:38:57,140 So, for the first question, it's depending on how you set the goal, it's very persistent. 360 00:38:57,140 --> 00:39:09,620 For example, we saw the cross-site scripting that was trying, keeping trying, then doing something that we also do kind of human thing is like going and looking around to see if we can find another hint or something to get into the feedback. 361 00:39:09,620 --> 00:39:13,440 But then goes back to the goal that's very persistent into that. 362 00:39:13,460 --> 00:39:21,480 In terms of technical details, it's like you can set the amount of iterations that you want to spend so you don't have like an infinite loop of things trying out. 363 00:39:21,740 --> 00:39:24,260 And the second question was to protect. 364 00:39:24,260 --> 00:39:33,280 So, now is everything run in an isolated environment and protected, so we are working on improving that in order to be conscious about what it's doing and running. 365 00:39:33,280 --> 00:39:37,740 And that's also taking into account all the Salesforce that it has to do while testing application. 366 00:39:37,740 --> 00:39:40,400 So, one more. 367 00:39:40,400 --> 00:39:41,100 There we go. 368 00:40:04,570 --> 00:40:13,530 Yeah, the thing is that if you have played CTF, when you go into hard challenges, it's like you have to maybe change too many things together. 369 00:40:13,570 --> 00:40:14,250 You have to. 370 00:40:14,250 --> 00:40:23,310 So, probably the AI is being able to detect the first two vectors, but then it doesn't go farther and detects the final one that is giving you the flag. 371 00:40:23,310 --> 00:40:25,610 So that, for us, is a known solution. 372 00:40:25,610 --> 00:40:33,530 Even though it found valid endpoints and it started plotting vulnerabilities, if it doesn't get the flag, it's a no-no-no resolution for us. 373 00:40:33,530 --> 00:40:41,370 So, probably the creativity and the effort that can put a human into going so deep, that's what makes it different. 374 00:40:41,370 --> 00:40:42,630 For now, at least. 375 00:40:43,890 --> 00:40:46,730 So, I think we have no more time for questions. 376 00:40:46,730 --> 00:40:49,070 Thank you, everyone.