DEF CON SG1 - CSIT Village - Loke Yan Hao -Hack Smarter: Unleashing AI in Bug Bounty Pen Testing
Transcript
Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.
So, let's dive in to start us off and building on the idea of finding what others might miss, we begin with hack smarter, not harder, unleashing AI in bug bounty pen testing. Senior specialist Look Yan Hao shares what happens when AI enters the bug bounty workflow, of course, the wins, the limits, and the lessons learned. So, if efficiency matters to you, this is the one to catch. Let's put your hands together and welcome Yan Hao on stage, please. >> Thanks for coming. Well, welcome to my talk uh titled hack smarter, not harder, unleashing AI in bug bounty penetration testing. Okay, a quick road map of I'll covering.
First, I'll highlight the problem, the increasing use of AI to find vulnerabilities and breach system. Next, the experiment where we ran two workshops to evaluate um a genetic AI versus experienced human tester on live bug bounty targets. Then, the finding, what each side caught and where each side fell short. And finally, the playbook, how you can actually leverage AI in your own bug bounty workflow. So, a quick uh the introduction of myself, I'm I'm Yan Hao. I've been in cybersecurity for 11 years. I'm currently a senior tech specialist in CSIT doing uh network and system security. My main focus is on uh um end-to-end uh red team operations and APT simulations.
Okay, um let's start by talking about the news to frame the problem that we are facing. Uh Okay, Cloud Mitos has been heavily featured for its ability to find thousands of zero-day flaw on major system by scanning through codes and binary. Some of these flaw were undetected for years. The headline on the right shows just how fast this is moving. Um Mitos found 271 vulnerability in Firefox, while Cloud 4.6, the previous model, found 22. That's more than a 10-time jump, and it shows just how quickly AI capabilities are progressing. The main point here is that if defender can use AI to detect vulnerability at machine speed, then hacker can likely use the same AI to compromise system at scales.
So, this next slide prove this point. Um there's a reported case of Deep Six and Cloud being used to breach 640 gate firewall in just 5 weeks. Um this was reported in February of this year, which is like 2 months back. Then we can see on the right, the same threat actor was exploring for new AI tools uh called Cyberstrike AI. While at the bottom right, it shows that Gemini AI is being being abused for all stages from recon uh to post-compromise action. So, AI is no longer just used to scan code and find vulnerability. It can also be used to run command, to inject exploit, and to maintain command and control communication with compromised system.
Okay, so here is the experiment that we did. CSIT actively participate in bug bounty program. Both help both to help detect flaws in system hosted in Singapore and to sharpen our pen test skill. During two of these program, we ran experiment to evaluate AI versus experienced testers.
Um this experiment are important because uh most agentic AI tools are benchmark on clean environment like Hack The Box and CTF. We wanted to see if these tools hold up on live system and to also evaluate various harness models and configuration. One thing that came up to highlight uh here is that this experiment were conducted pre-MITRE. The finding presented here may change drastically once a MITRE uh equivalent model is released to to the public. So, three questions that we set out to answer from our experiment. First, can agentic AI perform better pen testing at a level comparable to human tester? Second, what factors affect how well it performs on live system and networks? Uh third, can autonomous AI be trusted to run unsupervised on live target? Stay with me through this talk and we share our takes on all three questions.
So now three way the AI can be used in bug bounty. The first is AI assisted testing. For example, we provide AI with a code snippet to identify vulnerable thing or we ask AI to create test test payload like one for planting a web shell on a web application. The aim here is to tap on AI expertise in the specific skill set that require a lot of time to figure out. The second is AI augmented hunting. For example, you find one bug, then let AI to find more endpoint with the same bug patterns. The aim here is to expand or skew our finding with AI.
The third is the autonomous AI pen testing. Here we define the goal while AI handle the planning and the execution to facilitate end-to-end pen testing.
So we have we have two run in which we evaluated AI on web pen testing with slight differences in the set selections of model and harness for evaluation. For first run which was on Q3 last year, we cast a wide wider net to explore various LLM through open router and the harness we evaluated was CAI. For our second run which was on Q1 this year, we narrowed down to just Claude since it produced the best outcome in in the first run. The harness we evaluated was Claude code. So here's what we found.
For the first run, human tester found 229 vulnerabilities while AI found six with one matching findings. The top three AI findings are shown here. One high severity IDOR, one medium severity improper access control, and one medium severity IDOR. For this run, we only track submission for autonomous AI pen testing since that was our primary focus. For the second run, human tester found 34 vulnerabilities while while AI found a total of 17. Um so the breakdown is as such. Seven autonomous AI finding. Um eight AI um the assisted and two AI
augmented. For the seven um the autonomous AI finding, there there was one matching finding. What interesting here is is uh regarding my second run is that the top three AI finding each came from a different mode. So we have two SQL uh the injection and one IDOR. The few matches um between autonomous AI finding and human finding is worth a closer look and we'll get there shortly.
Um to put the top three AI finding in context, let's see how they rank versus the human tester finding.
For the first run, the top three spots were taken by human tester, two critical and one high. Um the first AI finding um came in at rank four. The other two AI finding landed further down at rank 17 and and 18.
Um for the second run, the top two are still human tester, both critical, but the third and fourth spot both came from AI augmented hunting. We fed the AI with our rank two vulnerability and asked it to find same bug bug patterns on different patterns. That gave us two additional critical vulnerability to submit. The point here is clear that the agentic AI does help to find valves on real systems.
So um coming back to the low number of matches between AI and uh and human finding, to be frank, we can't be certain why, but here's what we observed. First, different strategy. Experienced testers tend to follow uh their guts, drilling to a specific endpoint um based on a hunch and find bugs through instinct. While AI generally follow a systematic path to complete a task. So, what it does here um is that it may run the same set of tasks on every endpoint following a predefined checklist. Um second is differing priority. Human testers know where to look. They skip the noise and go straight for high-value targets such as file upload, form submission, and privilege escalation.
The AI behave in a slightly different way. It follows a prompt that typically start with a shallow sweep to build the context and may require more prompting to go deep. And finally, the third, the token size limit. Human testers are more persistent. They keep digging up until they find something, but AI can stop midway once it exhaust its context window budget. So, for the next few slides, I'll be sharing the playbook. When we first started using Agentic AI for autonomous pen testing, we begin with a simple prompt shown here on the slide. So, what works is that the AI start after reconnaissance by using professional pen testing tools like Nikto and GoBuster for endpoint discovery.
It then begin testing them for common vulnerability. So, what failed? There were four main issue. First, the AI triggered the the web application firewall or WAF, which caused the enumeration result to be inaccurate. Second, it went down a brute-force path, which rarely works. Third, the testing took a very long time and the output didn't justify the time spent, which is which is why we stopped brute-forcing. Um and finally, it sometimes triggered AI own safety guardrail, which blocked our action from being carried out. So, to resolve this problem, it's time to upgrade the simple prompt. Now, we add four things. We state that we have requested formal permissions and the testing is indeed done on UAT server.
We use Burp Suite MCP server to allow AI to tap on our Burp Suite history for list of endpoints that we have browsed through and for authenticated token. We stated a list of forbidden actions to prevent AI from wasting time and finally we we state the list of bug type to to avoid to paradise. With this upgraded prompt what works is more likely to bypass safety guardrail, scanning become much less noisy, um the authenticated testing produce more meaningful result and testing stay on high value bugs. But nothing is perfect, so what fail? Um there were three issue. First, there's no guiding on how deep the test or how to properly test each file type.
Second, the AI means endpoint are not captured in the history. Third, it means our file type that are not defined in the prompt. For the last two point, we accepted them as trade-off for speed. Speed is important in bug bounty because duplicate don't pay. If someone else reported the same bug first, your submission will not be counted. So, how do we do with the lack of guidance? That's where skill came into play. Normally when most of us prompt AI, we do it in an impromptu way to just fire and forget. The problem here is that there's no methodology, the output varies for every run, and prompts are not structured for reuse.
So, skills help to mitigate this issue. So, what are skills? Skills are prompt that are carefully written, version, and well maintained designed to produce consistent and repeatable outcome. So, now the same prompt is appended with a testing XSS skill which guide the AI to test cross-site scripting vulnerability in a more systematic way. So, back to our simple prompt, now we add skills and the additional prior knowledge. So, we we're not just giving AI direction, we're also giving it the testing methodology. We added skills like one for testing IDOR, one for ACL, and one for bypassing file upload restriction. These skills tell how to test, tell AI how to test, not just what to test. And finally, where permitted, we recommend to attach the tech documentation because this help AI to build the context of the target systems.
So, for those that are making use of Cloud Code as the harness, here's one more useful tips. Move all your recurring prompts such as the defined roles, standing constraint and tools into the Cloud MD files. This help to reduce the need to repeat the same pattern on each new session since Cloud Code automatically append your white system uh system-wide prompt to every new chat. So, this is the current recommended playbook to get started with Agentic AI for web pen testing. Now, I show you quick quick demo. Um the purpose of this video is to demonstrate Cloud Code performing autonomous AI pen testing. Note that this is not Cloud Code, so uh the GUI are different. Um I recorded it by making use of Cloud Replay.
So, we use the similar prompt from the playbook. First, it check the status of the MCSP MCP server that's being used, so which is Kali and Burp Suite.
Then it discovered an endpoint and session cookie from Burp Suite history and started planning. Somehow, it tries to use Nikto, so um we
which we stopped it halfway.
Okay, then we can see it start started running numerous curl curl tests.
Okay, and finally, it it produced the finding and we asked it to send the proof of concept to Burp Repeater.
Okay, then you can inspect what was tested by scrolling upwards and clicking
>> [snorts] >> Okay, and clicking it into specific uh curl test to see what was sent.
The JSON that was being sent out for further testing. And, uh, what the JSON server response was.
Okay, the next video shows, um, AI augmented hunting in actions. Um, we pass the the bug pattern to the AI and tell it to find more vulnerable sink.
Okay, once it has tested and confirmed the sink, we ask AI to write POC script.
And finally, the result show us all the sink what were tested and three RCM point were confirmed. Note that this video is heavily redacted due to responsible disclosure.
Okay, so far we have covered both the LLM and the prompts. The other important factor is the harness. We tested two harnesses, CAI and Clockwork. I personally prefer Clockwork in terms of user experience for four reasons. First, I can steer the testing during mid-run. Second, I can inspect what's happening in real time. Third, I can validate finding by going, uh, scrolling through, uh, the sub-sessions. And finally, I can turn off the user prompt in safe environment for autonomous pen testing.
The other less known factor is context management. Both the harness and the agent have to actively retain critical prior finding, purge low-value output, and dive deeper into promising leads. This happened behind the scene, but when handled poorly, it directly impact the outcome.
Okay, now let's talk about the quality of AI finding. So, what are the common failures? First, Captain Obvious. Sometimes the AI states something true but useless. Like if the refresh token is stolen, the SS token is compromised. This is sort of like if your house key is stolen, your house is compromised. It's true, but it's not helpful for bug bounty. Second is false positive. We observe quite a few of this. For example, the AI saw HTTP OK response and concluded that the admin portal was accessible, but in reality the port page returned HTTP 200 but rendered an error. Third, sometimes the AI can can conclude things too quickly. One such case that we observed was that it flagged out XXE
because the server returned HTTP 500 internal server error response, but this response by itself is not sufficient and we need more testing to confirm it.
So, to mitigate this issue, you can consider the following. For Captain Obvious, you can add new constraint in into the system-wide prompt to instruct the AI not to highlight finding that are true but useless. For false positive, you can prompt the AI to send proof of concept to Burp Repeater via MCP. Then we man- Then we have to manually trigger the payload to confirm the vulnerabilities. For too quick to conclude, we can either use an ad hoc prompt to tell the AI to perform more testing or to add a standing constraint in the system-wide prompt to enforce reproducibility for every finding. So, the tip of the day is simple. If you can't reproduce it, don't report it. And looking ahead, future LLM will be likely become more context-aware and should reduce this problem going forward.
Okay, so we have reached the conclusion. These are our take on the three questions that we set out to answer. First, can authentic AI perform web pen testing at a level comparable to human tester? We believe AI can supplement and multiply human tester findings, but experienced human tester can still find more bugs at this current stage. The key disclaimer here once again is that this was conducted pre-mitos. This may change drastically as AI progresses.
Um second, what factors determine how well it perform on live system and network? We highlight six factors which are the selections of LLM, the user prompts, refining, the skills, the UX, the context management of the harness and and the MCP tools. Third, can autonomous AI be trusted to run unsupervised on the live target? The honest answer is it depends on your risk tolerance. Um the user prompt can can provide high-level guardrail, but the model may still violate that. So, our recommendation is to enforce guardrail at the tools and network level, not just at the prompt level. And finally, bonus questions. How do we use the strength of both AI and human?
Two ways. One is to use human for the initial terrain mapping, feed the history and session context to AI.
The second way is to run AI and human in parallel. Since they find different bug, to catch them most to catch them most, you need both.
Okay, so final key takeaway for bug bounty hunters is which is to invest in your prompt by including skills and parallel learning, verify AI findings since false positives and premature conclusion can be common. And do consider to re-evaluate your your agentic AIs frequently. The AI field move very fast and we may see new breakthrough in just weeks or months from now. So, to wrap all up, the agentic AI is a powerful collaborator. Use it well and use it with human. Thank you.





