06:00 UTC Charta Aetatis Cyberpunk

Console For you Newsletter Pro Sign in Register
Aa · Display
Themes
Type size
Density
Bug Bounty · NahamSec · · 14:44 runtime

My $250 AI Hackbot Ran 24/7 on a VPS and Missed This

In the wiki HackbotsCaidoClaude
Transcript 3714 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

My hackbot looked at this SSRF and told me that it wasn't exploitable when it was. And by the end of this video, you will see exactly why it missed it and how I fixed this issue so it never misses stuff like this ever again. So, for the last few weeks, I've been building my own hackbot and honestly, it has been [music] incredible. Not because of how much I've been able to scale my hacking, but how much it's shown me I don't know about my own targets, hosts I've never seen, inputs I would have never touched, stuff I would have just never gotten to manually. And if you've missed the last few videos, go check them out, but I connected Cloud to Kaido and then ran my entire recon pipeline through a handful of skills that I've built. A lot of you asked about those skills, so we'll get to those soon. But here is where it's at right now.

According to Cloud, it has found hundreds of bugs, but only 11 of them actually mattered. Five of them were critical, one was a high, and of course five was duplicates. And we're talking about auth bypasses, IDORs with PIIs, and SSRF. So, if you want to see a breakdown of some of those, let me know in the comments by saying demo and I would love to do a deep dive of a couple of them. Building this taught me something. How you prompt AI is the difference between finding a bug, exploiting it, or completely missing it. Same bug, same target, different prompts completely give you different outcome, and that is the most important thing that you can look at. So, today I'm going to share one of these skills with you, my SSRF one, because it is my favorite bug class, and it's exactly the skill I had to rewrite after the bot missed this vulnerability. And here is the challenge. I'm building this whole thing for $250, running it 24/7 on a VPS, and the goal is simple, make it pay for itself. First, let me show you a bit of background on how I've set it up, and we're going to jump into our examples momentarily. So, the first thing you want to do is go to hostinger.com/thenewbostonvps.

They are a partner of this channel and they've been the sponsors for this entire series and a big part of how I've been able to put this together. And you can get a server from them. With Black Friday happening, you can get up to 70% off, and all you can do is go scroll down here, look at the different options they have. I'm personally doing the KVM 8 because I am using a lot of resources and I want to actually just scale this as much as I can and I want a lot of RAM, but if you're balling on a budget and you want to just get started and do something small, maybe one target instead of doing a bunch, you can start with their most popular KVM 2, which comes with two CPU cores, 8 gigs of RAM and 100 gigs of disk space and 8 terabytes of bandwidth. We're going to click choose plan and it's going to bring you here to checkout. If you want to get the most value, the best option is to do the 2 years, but if you want to extend that to just 1 year, you will still get a massive discount and it makes it under $10 a month. And if you do use my coupon right here, type in nahamsec, it would help me pay for my servers and also get you another additional discount, which brings the whole server cost for the whole year to almost $100, which keeps us in our $250 budget by using this coupon as well. And And then all you want to do is pick up where you want to host the server. So, if you want to do it in the United States, you can. If you're in Europe, you want to be closer, you can do that. Asia, all these good options, but the best part of this is the operating system. You can obviously use your Debian or Ubuntu or if you're a try hard, you can also do Arch Linux. But, here's my favorite thing. If you want to just install Kali, you can also type in Kali Linux and click on Kali and have it set up that operating system [clears throat] for you. So, this way you don't have to install any of the tools, it all comes with it. And you can just click on continue, which is then going to ask you to enter your information for your credit card, your address and your account. Then you can use your SSH to log in to your box and set things up. And then as soon as we're logged in, we're going to do a couple of things. You have to install Cloud. For my instance, I've already done this. You can just type in Cloud. That's going to just connect us to our Cloud. If you want to use it, it's already set up. And the other thing that you want to do is you want to go ahead and install Kaido and connect it to Kaido as well if you want to be able to kind of tell Cloud to use your Kaido information. I did a whole video on this. I'll link it down below. Go watch it. But, this is pretty much our setup and the reason why I use a VPS is just because I want it to run 24/7. And in the last episode, I showed you how I built this entire pipeline, where I put this whole pipeline together, where Cloud is looking at all my recon data and doing a couple of things with different skills and then judging whether or not I should take a manual look at it. I did a whole thing on this, go watch it. You can also go to resources.nahamsec.com and find that all of the different resources I put together that you can pretty much give Claude and have it do their work. So, for the second video, I'm going to skip the part where I talk about the reconnaissance, how it found the asset, and how it just found the endpoint. I think I did a little bit of information on this in the last episode and also some of this are just things that I've done on my own and I don't want to fully open source just yet. But, if you watch any of my videos, I've talked about a bunch of these techniques in the past so you can build them on your own. But, I'm going to skip to the part where it alerted me and said, "Hey, I found this bug right here and I think there is something here based on the endpoint and the data it takes, but I cannot exploit it." So, I'm going to show you what it looked like at first. I can't replicate, you know, Claude not being able to solve it because we solved it and it has in the memory now. But, then I'm going to skip to the part where I use Neo to exploit it and then I was like, "Why not make a skill that just covers all the things that I wanted to so in the future I can just bring down the possibility of it missing out on bugs like this and just alerts me and says, "Hey, with confidence 85% there's a vulnerability here. You should exploit the rest." or just say, "Hey, I can't exploit it." and I can just go back to the drawing board because I still do enjoy the manual hacking. So, let's jump into the example really quickly. Without doing too much, this is kind of what you would see when you went to that website. I'm going to set this URL for a lab. You can also go and play with this on hacking up for free. It's absolutely free. You don't have to pay anything at all. But, what I'm going to do here is I'm going to do a curl and you can see I'm hitting the webhook. I'm doing a content type for JSON and if I send this request in, it's going to make a request and says proxy error. We're not getting any responses and that's kind of what Claude was seeing. It kept saying there's a proxy error. It's seeing there is a vulnerability here because it is a webhook. It's taking a URL. There's a method and things like that. But, it couldn't figure out why it's coming a proxy error and it was convinced that it needed some authorization, authentication, or maybe the host that we were using wasn't valid. And let me show you really quickly. If you look at our Interacted SH right here, you can see that we're seeing a DNS request. For some reason, Cloud wasn't checking for DNS requests, and it was only looking for HTTP requests. And if it wasn't for me doing this, it would have missed the entire thing. And honestly, this was on a Saturday night. I was hanging out with my friends. I got the alert. I looked at my phone. I was like, "Wow, my Hackbot found a vulnerability." I played with it, and nothing worked. Then I was like, "Let me just run it on my system." And I don't use Interacted SH because a lot of times these hosts are banned from bug bounty programs. But I mean, the firewalls don't reach out to these hosts. I have my own personal kind of Interacted SH that I've put up, and I have a front end for that. It's a bunch of different things. But doing this exact thing, I realized, "Wow, this domain is making a DNS request for some reason, but there's no HTTP coming in, and there is definitely something here."

So, I took it to Neo, and when I just put screenshots on the page, you can see I asked Neo right here, "Hey, can you exploit this?" And I gave him some information on the application itself. And then eventually, he came back and was like, "Yep, I can exploit this and get access to it." And if it wasn't for that, I wouldn't be able to get this $5,000 bounty, and that's incredible to see that Cloud missed it. So, let me show you what that vulnerability looked like, and just what the example lab is right here. We're going to go back into here. There's a bunch of URLs I can hit here. And the funny thing is, this URL was one of the ones that it was leaking the JavaScript from. You know, obviously, I have renamed it here, and I've given it a different name. But if you hit it, it still comes back and says proxy error. It was mentioned in the JavaScript file that this has access to this internal host. It was a local host like this, but it kept giving us proxy errors, and this is why Neo did a really good job compared to Cloud. It's because Neo looked at the automation and was like, "Okay, let me try a bunch of different URLs." Because the host name itself was looking like an N8N platform,

it actually started looking at a bunch of different N8N platform URLs, and then eventually started getting errors out of it. It was saying, "Hey, this is giving me a JSON error." So, anytime there's an HTML error, for example, if I go to [clears throat] the HTML page for this, you know, if it's HTML, it wouldn't print out anything. If it was valid JSON like this one right here and it was printing out something in JSON, it would actually give us a response, which I realized, holy crap, we do have a full read SSRF with access to data. So, now we're actually seeing there's a get, content type is application JSON, but it's coming back as 404. And if we do the whole entire request properly with the right endpoints and the override, this is another one, the override true and actually giving it a valid test, which looks for the test values in there, we can see that it's coming back and giving us a bunch of usernames and emails and service accounts and things like this, which not only proves we have access to an internal system, but we also have access to all of their staffs username, VPN profiles, their full name, email addresses and a bunch of other PIIs that they probably don't want you to have access to and we were able to fully do this. But, there's one more thing that gets interesting here and that's when I give this to Neo, which I didn't give it the full JavaScript file. I took a snippet of the JavaScript file that Cloud had given me. I said, "Hey, can you look at this and see if you can get access to it based on the name?" And he gave me this. But, then later I went in there and I gave it the entire JavaScript file and it found additional hosts that we could access a Kubernetes and another internal host that had a full access to a actuator with the environmental variables and the heap dump and everything in there that was accessible that made it even more impactful. So, this by itself would have been a massive hit from Cloud if I hadn't just manually looked at it and caught the DNS hit on my own server and then had not fed it to Neo. And this is exactly why I've created skill that I want to share with you really quickly.

There's one more thing quickly I got to disclose. I built all this with my growl me skill that comes with Cloud, but also it is very custom to my hack bots, so a lot of it won't make sense, but I kind of want to show you the gist of it. So, if you build it, you can think of these different things. So, number one thing is this our description right here that says confirm and exploit SSRF unauthorized bug bounties. It's going to use my URL. So, this is my stage is the server that I use that catches everything underneath that subdomain. So, if it's like test.nohack.com, everything before test gets caught, whether it's DNS, whether it's HTTP, and things like that. A DNS hit alone confirms the vuln. I want to know if it's a DNS only, I want to test for other stuff. So, that's why I have this in here, and it's going to capture these servers. This is your agent, and and it's going to leak any request headers on that HTTP hit. So, these are all the things that I want. There's going to be a tier one and tier two. So, the tier one is going to look for internal reach, and then tier two is going to do some gofer things like that. And then we're going to go scroll down all the way to down here. You can see a lot of this is on my VPS because I've created a bunch of different random stuff for my canary, and things like that. But, this is how I might test my SSRF. There is a very specific thing that I'm asking it here is I'm saying, "Hey, if there is a filter, I want you to map out for it before you brute force a bypass." So, if there is a JavaScript file, for example, use JS on JS map, so you can look for the source map, for example, and work out what is allowed. So, is there a regex in the JavaScript file that we can look at? So, what is the allow list?

What is the schema? What is the block IP ranges aimed at bypass at the model itself. And if you find an allow list like allow.com, stop and report it so I can go and manually look for a bypass, or I can just use another workflow or something like that, or go through my data to find it. And then we don't hunt for open redirects on the allow list domains automatically because I don't want to go rogue and just look for something out of that just point it at the specific thing and look for it for me as well. And then, of course, there's a couple of things that I want to do here. I'm saying, "Hey, if there is a DNS log, you know, keep pulling that website every 60 seconds, you know, for a 24 hours, so if there is a late hit, we can still know it." There's also a "Hey, give me a verdict." So, is it DNS only? Is it HTTP? Is it internal read?

Is no hit? I want to know so I can just go ahead and go through all this, so I'm not losing out on any vulnerabilities at all. And then there's some anti-patterns like do not, you know, you know, go for a URL fetch parameters sort of on shape alone. It needs a outbound callback, so I need to make sure there is going connection out. Don't treat any client like redirect or next in the browser as an SSRF. That's an open redirect. So, I'm just putting some stuff in there and then I'm also looking for Gopher and other ways of exploiting this. And there's one more really cool thing that I want to show you. And up here you can see that what I'm doing for the contract first, I'm telling it, "Hey, I want you to tag the entry. I want you to put a tag, is this coming from the random header, for example? Is it coming from a parameter? Where is it coming from?" And then I want you to add the asset. So, if it's test.yahoo.com, the asset should be test.yahoo.com with a nonce before my domain. So, this way I know exactly where the request came from, what subdomain it came from, what sync it came from, and how did I end up getting there? So, I'm not going through all my records and then hitting my head against a wall going, "Oh my god, I have an SSRF, where did it come from?" At least I have the asset and I know exactly what request made that happen because I have logs of it. This is really, really important because otherwise, you'd be looking for a needle in a haystack. So, at a glance, this is everything you want to take a look at.

So, if you want to build a skill for SSRF, here's everything that I would personally look for that I just talked about. These are things like, "How do I track where it's coming from? What do I do with the allowed list? What do I do with the blacklist? What do I do to make sure there's an SSRF there? Do we look at DNS? Do we not look at DNS?" This is the most important thing that distinguished the finding from not being able to be exploited from Cloud's end versus Neo being able to exploit it because it kept chasing and chasing and not letting that error scare away. But also, at the end of it, when I went back to Cloud and I said two things to it, I said, "Hey, I want you to go through all of my data with the skill set and see if you can export any SSRFs." It was able to identify more things for me to take a look at, which we found more hosts on that exact target that has similar endpoints with the similar vulnerability. And then also, it came back and realized that it's missing stuff in its testing process. That kind of helped me realize, "Hey, this is actually working now because it reidentified that original finding as a fresher exploitable thing and reported it to my Slack channel that I have for tracking all all vulnerabilities. This has been one of my absolute favorite with hacking with AI. One is learning how to prompt and then realizing, "Hey, the more and more details I gave it, the better it did." But also, it is scaling so much of my reconnaissance work where I just sit there and look at all the leads every morning and every night. So, what my AI hack bot is actually doing is just going through the work that I didn't like, looking at JavaScript files, looking at these endpoints, looking at APIs, brute-forcing. It's doing all that for me and then just sending me a daily digest of all these different targets I want to hack on and take a look at.

a week or two isn't bad. I know five duplicates out of 11 with 55% rate of, you know, duplicate is pretty high up there, but for a week or two of work, this isn't too bad, honestly. And on top of it all, some of these findings that I found were on public programs and the fact that I can catch up and find these in a couple of weeks, it is absolutely amazing. And getting an SSRF and getting it paid is even better cuz now we can say this AI hack bot has paid for itself and that is absolutely a banger. All right, I'm going to stop right here.

Thank you so much for watching this far. If you've enjoyed content like this and you want to see more of it, drop me a comment, drop and please, please, if you haven't done already, hit that subscribe button, become a no homie, and I will see you all in next week's video. Peace.

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers

Sign in to join the discussion.

Make the first comment.

That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

The freshest blend of security news delivered to you. Text and HTML, one-click unsubscribe. Free.

How often
Your desks