Latest / CyberCode Academy / Course 3 - Mastering Nuclei for Bug Bounty | Episode 2: Controlling Scans, Traffic Tuning, and Custom Template Development
Transcript
- 0:00Speaker 1: Welcome to the deep dive. Today, we're really getting into
- 0:03Speaker 1: the weeds with automated scanning tools.
- 0:05Speaker 2: Yeah, specifically the advanced controls, because look, when you're scanning
- 0:09Speaker 2: web targets, maybe for programming, security testing, bug bounties, just
- 0:14Speaker 2: blasting away with thousands of checks isn't smart.
- 0:16Speaker 1: Right, It's like using a fire hose when you need
- 0:18Speaker 1: a water pistol. Yeah, you end up, well, you end
- 0:21Speaker 1: up making a mess exactly.
- 0:23Speaker 2: That's the core issue. These tools are incredibly powerful, sure,
- 0:26Speaker 2: but raw power often leads to noise and just outright failure.
- 0:31Speaker 1: You overwhelm the target maybe could.
- 0:33Speaker 2: Be or you trigger their their web application firewall and
- 0:37Speaker 2: get instantly blocked. Or maybe worst of all, you just
- 0:40Speaker 2: drown yourself in thousands of low priority informational findings.
- 0:45Speaker 1: The mission today is to figure out how to stop
- 0:48Speaker 1: using this blunt instrument and learn the specific flags the
- 0:51Speaker 1: configurations that turn a powerful scanner into something more like
- 0:54Speaker 1: a surgical tool efficient precise.
- 0:57Speaker 2: Saving you time, saving your CPU and crucially keeping you
- 1:01Speaker 2: from getting shut down by the target's defenses.
- 1:03Speaker 1: Yeah, let's unpack that. So efficiency. If a tool has
- 1:07Speaker 1: I don't know, thousands of potential checks, where do we
- 1:12Speaker 1: even start to focus it, how do we tell it
- 1:14Speaker 1: exactly what to run without listing like five hundred file names.
- 1:19Speaker 2: Well that's where template inclusion filters come in. They're basically
- 1:21Speaker 2: criteria you set right at the beginning. And there are
- 1:25Speaker 2: three really powerful ways to do this automatically.
- 1:28Speaker 1: Okay, three ways. What's the first.
- 1:30Speaker 2: The first and maybe the most common is using tags.
- 1:33Speaker 2: Template creators categorize their checks with these tags. So if
- 1:37Speaker 2: you're hunting for cross site scripting or EXSS.
- 1:40Speaker 1: You just tell it run the EXSS tag exactly.
- 1:42Speaker 2: You don't need the SQL injection checks, you don't need
- 1:43Speaker 2: the admin panel finders right now, just specify the EXSS tag.
- 1:47Speaker 1: That seems like a huge time saver right there. I
- 1:49Speaker 1: saw an example where just that one tag pulled in
- 1:52Speaker 1: what over five hundred specific EXSS templates.
- 1:55Speaker 3: It can be.
- 1:55Speaker 2: Yeah, the repositories are massive, so you get really comprehensive
- 1:59Speaker 2: coverage for them specific vulnerability type, often in minutes instead
- 2:02Speaker 2: of hours.
- 2:03Speaker 1: Makes sense.
- 2:04Speaker 2: Or you know, maybe doing recon you can use the
- 2:06Speaker 2: tech tag just to identify technologies, or if you already
- 2:09Speaker 2: know it's an INJINC server, you target the enginx tag specifically.
- 2:14Speaker 1: Okay, tags makes sense, So it's the second method. The
- 2:16Speaker 1: second is filtering by severity. So you know the risk
- 2:19Speaker 1: level critical, high, medium, low info. Ah, right, so you
- 2:23Speaker 1: can prioritize it. If I only want the really big
- 2:26Speaker 1: scary vulnerabilities, you might just run critical and high. But
- 2:30Speaker 1: here's something people often miss. The jump in template numbers
- 2:34Speaker 1: between levels can be huge.
- 2:36Speaker 2: How So, well, we saw a case We're running only
- 2:38Speaker 2: low severity templates loaded maybe two hundred and sixty checks. Okay, fine,
- 2:42Speaker 2: but adding medium severity, just adding medium, it jumped the
- 2:46Speaker 2: total template count to over one thousand.
- 2:48Speaker 1: Wow.
- 2:48Speaker 2: So if you just filter out medium, you might be
- 2:50Speaker 2: ignoring like seventy five percent of the potential checks relevant
- 2:53Speaker 2: to that combined risk level.
- 2:55Speaker 1: That really shows the danger of being too focused sometimes. Okay,
- 2:57Speaker 1: so tags severity. What's the third way to include templates?
- 3:00Speaker 3: The third is by author.
- 3:02Speaker 2: This is super useful, maybe more in team or internal settings.
- 3:05Speaker 2: You can say only run templates written by this specific person.
- 3:09Speaker 1: Ah. So if like hacker Gotham on our team made
- 3:12Speaker 1: some custom.
- 3:13Speaker 2: Checks, yeah, exactly, you run just their templates, maybe for
- 3:16Speaker 2: Django detection or some specific WordPress thing they found. It
- 3:19Speaker 2: helps validate their work or use proprietary checks easily.
- 3:23Speaker 1: Okay, that covers telling it what to run. What about
- 3:26Speaker 1: the opposite? What if I know a specific check is
- 3:29Speaker 1: noisy or just wrong for this target, how do I
- 3:33Speaker 1: tell it what not to run?
- 3:34Speaker 2: Right? Exclusion filters, it's the mirror image. If there's a
- 3:37Speaker 2: template say engine x, version, dot MML, and it keeps
- 3:42Speaker 2: giving you grief false positives or something, yeah, or it's
- 3:44Speaker 2: just too verbose, you can exclude that specific template file
- 3:48Speaker 2: using a flag. Often it's HEAVA or a exclude templates.
- 3:52Speaker 1: And can we exclude the broader categories too, like I'm
- 3:54Speaker 1: tired of seeing all those purely informational findings.
- 3:57Speaker 2: Absolutely, that's often a really good idea. Actually, you use
- 3:59Speaker 2: the exclude severity flag maybe ease you can tell at
- 4:02Speaker 2: ACS info and just filter out everything marked as informational, So.
- 4:05Speaker 1: No more alerts just because it found a specific content
- 4:08Speaker 1: type head or something.
- 4:09Speaker 3: Oh yeah, exactly.
- 4:10Speaker 2: It helps you focus on things that are actually exploitable
- 4:13Speaker 2: or represent a tangible risk. And similarly, you can use
- 4:16Speaker 2: exclude tags so e tags to skip entire categories like
- 4:21Speaker 2: maybe all XSS checks if you already did a dedicated
- 4:24Speaker 2: scan for those.
- 4:24Speaker 1: Okay, this is great, we've got the precision filtering down.
- 4:27Speaker 1: Now let's talk about safety and not getting kicked off.
- 4:31Speaker 1: The network speed kills right, If you send too many.
- 4:34Speaker 2: Requests, you definitely risk getting blocked by a way for
- 4:37Speaker 2: even just overloading a sensitive server.
- 4:39Speaker 3: So yeah, managing network pressure is crucial. There are three
- 4:43Speaker 3: main controls for this, three more flags pretty much.
- 4:46Speaker 2: The first one is weight limit. This is probably the
- 4:48Speaker 2: most direct one. It's that's a hard cap on the
- 4:50Speaker 2: maximum requests sent per second to any single target.
- 4:53Speaker 1: Okay, so if the default is a one hundred and
- 4:55Speaker 1: fifty requests a second, which sounds really fast fast, I
- 5:00Speaker 1: know this target has like an aggressive firewall, I need
- 5:03Speaker 1: to dial that way back.
- 5:04Speaker 3: Pay back.
- 5:04Speaker 2: Sometimes, tuning the rate limit down to maybe fifty or
- 5:08Speaker 2: even ten or five requests per second dramatically lowers your
- 5:11Speaker 2: chances of setting off alarms.
- 5:13Speaker 1: But it makes the scan take longer.
- 5:14Speaker 2: Obviously, of course it's a trade off slower span, but
- 5:18Speaker 2: it actually finishes instead of getting your IT band halfway through.
- 5:21Speaker 1: Makes sense, okay, rate limit is speed per target. What's
- 5:25Speaker 1: the second control?
- 5:26Speaker 2: The second is bulk size. Now, this one confuses people sometimes.
- 5:30Speaker 2: Bulk size controls how many different hosts you scan in parallel.
- 5:34Speaker 1: Okay, So if I give it a list of like
- 5:36Speaker 1: one hundred.
- 5:36Speaker 2: Subdomains, right, and the bulk sized default is maybe twenty five,
- 5:41Speaker 2: it means the tool will work on twenty five of
- 5:43Speaker 2: those subdomains concurrently.
- 5:45Speaker 1: Why is that important?
- 5:46Speaker 2: Well, imagine all one hundred subdomains are hosted in the
- 5:49Speaker 2: same environment, maybe behind the same load balancer or firewall.
- 5:54Speaker 3: If you hit all one.
- 5:55Speaker 2: Hundred simultaneously from your single IP address, even with a
- 5:58Speaker 2: low rate limit per host, the toll traffic volume from
- 6:00Speaker 2: your IP might still be huge and get you blocked.
- 6:03Speaker 2: Bulk size spreads out the load across targets over time.
- 6:05Speaker 1: Okay, so right, limited speed per target. Bulk size is
- 6:08Speaker 1: how many targets it wants, got it. What's the third concurrency?
- 6:11Speaker 3: Yeah? Concurrency? Often it's the h C flag.
- 6:14Speaker 2: This one controls how many templates or checks run in
- 6:17Speaker 2: parallel against a single target.
- 6:19Speaker 1: So back to my one target, the default might be
- 6:21Speaker 1: what twenty five templates hitting it at the same moment
- 6:24Speaker 1: could be?
- 6:24Speaker 3: Yeah, twenty five is a common default.
- 6:26Speaker 1: Now, if my own scanning machine is really beefy loads
- 6:30Speaker 1: a CPU tons of RAM, could I just crank that
- 6:34Speaker 1: nixy value up to like five hundred to make the
- 6:37Speaker 1: scan super fast. You could try, but here's the critical warning.
- 6:40Speaker 1: High concurrency hammers your system resources. It's not just about the.
- 6:45Speaker 2: Target, no, not at all. Increasing concurrency drastically speaks up
- 6:49Speaker 2: the scan. Yes, but it eats your CPU and RAM
- 6:52Speaker 2: like crazy. You have to balance the speed you want
- 6:55Speaker 2: against what your own machine can handle. You might crash
- 6:58Speaker 2: your scanner before you even bother the target.
- 7:00Speaker 1: Okay, that's a really important distinction resource usage on my end.
- 7:03Speaker 1: Good tip. All right, let's shift gears. Verification in tracking
- 7:06Speaker 1: super important, right, especially if you find something you need
- 7:09Speaker 1: to be able to prove it later.
- 7:10Speaker 2: Absolutely crucial, particularly in professional settings like bug bounties. Attribution
- 7:15Speaker 2: is key. How do we trace our activity? We use
- 7:17Speaker 2: traffic tagging with custom HTTP.
- 7:19Speaker 1: Headers, custom headers? How does that work?
- 7:21Speaker 2: Many bug bounty programs, Yahoo's program is often cited as
- 7:25Speaker 2: an example, actually require you to put a unique identifier.
- 7:28Speaker 3: In your request.
- 7:30Speaker 1: Why is that so?
- 7:31Speaker 2: If you report of vulnerabilities, say I found this bug
- 7:34Speaker 2: with this request, but they look through billions of logs
- 7:37Speaker 2: and can't find your specific request. Well, they can't verify it,
- 7:41Speaker 2: they can't triage it. You might lose credit for.
- 7:44Speaker 1: The find Ah. Okay, so the custom header is like
- 7:47Speaker 1: your signature on every request exactly, use a flag maybe
- 7:50Speaker 1: ajasery header and provide something unique. It could be your
- 7:53Speaker 1: username hash whatever the program asks for, like user agent,
- 7:57Speaker 1: dot hackify, hacker is testing makes it instantly searchable for them,
- 8:01Speaker 1: essential for getting paid basically.
- 8:04Speaker 2: Okay, what about verifying for myself? Say the tool reports
- 8:07Speaker 2: I don't know an old and jinx version. How do
- 8:08Speaker 2: I confirm how it knew that? I don't just want
- 8:10Speaker 2: to press the output blindly, right?
- 8:12Speaker 1: You need proof for that. You use the debugging in
- 8:14Speaker 1: brebosity flags usually things like ht bug.
- 8:17Speaker 3: Or HIV And what do those show you?
- 8:19Speaker 1: They show you the whole conversation. The tool stops just
- 8:22Speaker 1: giving you the summary finding and instead prints the exact
- 8:25Speaker 1: attP request it's sent.
- 8:26Speaker 2: The raw request, the raw request, and crucially the exact
- 8:31Speaker 2: full HTTP response it got back from the server.
- 8:35Speaker 1: Ah. So you can see the evidence yourself. Precisely, we
- 8:38Speaker 1: looked at a debug output where you could see the
- 8:40Speaker 1: two hundred OK response status and you literally see the
- 8:44Speaker 1: server engine x one point nineteen zero header in the
- 8:47Speaker 1: response text and the debug law confirmed the tools rejects
- 8:50Speaker 1: matched that header. So it goes from the tool things
- 8:53Speaker 1: that found this to I can see exactly why it
- 8:56Speaker 1: found this.
- 8:56Speaker 2: Yes, it moves it from an assumption to a verifiable fact.
- 9:00Speaker 3: Really important for.
- 9:01Speaker 1: Reporting, definitely. Okay. This is all great for running existing
- 9:04Speaker 1: checks effectively, but what about like total mastery, writing our
- 9:08Speaker 1: own checks and making them part of our standard toolkit.
- 9:10Speaker 3: Yeah, that's the next level.
- 9:11Speaker 2: Writing custom templates, you're basically creating your own set of
- 9:14Speaker 2: instructions for the scanner, usually in yamal format.
- 9:17Speaker 1: Yeah, okay, what does a basic template look like? It
- 9:20Speaker 1: generally has a few key sections. First is the info block.
- 9:22Speaker 1: That's all the metadata. Yeah, the template's name, who wrote it, author,
- 9:26Speaker 1: the severity, a description, and those useful tags we talked
- 9:29Speaker 1: about earlier. Okay, the filing information. What's next?
- 9:32Speaker 2: Then you have the request block. This defines a network action.
- 9:36Speaker 2: Are you sending a get request a post? Where is
- 9:40Speaker 2: it going?
- 9:40Speaker 3: Usually relative to the base target URL?
- 9:43Speaker 1: So info is what it is, request is what it does.
- 9:46Speaker 1: Where's the brain the logic?
- 9:48Speaker 3: That's the matches block.
- 9:49Speaker 2: This is where you define the success commissions what needs
- 9:52Speaker 2: to be true in the response for this check to pass.
- 9:55Speaker 2: You might say, for instance, the status code must be
- 9:57Speaker 2: two hundred and okay, and a specific regular express must
- 10:00Speaker 2: match somewhere in the response.
- 10:01Speaker 1: Body, like looking for a specific error message or a
- 10:04Speaker 1: version string exactly.
- 10:05Speaker 2: Maybe you're looking for the exact string PHP version five
- 10:08Speaker 2: point six point four.
- 10:09Speaker 3: The matches block defines that.
- 10:10Speaker 1: Logic Okay, info request matches is that it one more
- 10:15Speaker 1: key part, often the extractor's block. So your matcher found
- 10:20Speaker 1: PHP version five point six point six twenty. Great, but
- 10:23Speaker 1: maybe you only want to display the actual version number
- 10:25Speaker 1: five point six point four in and the final output AH.
- 10:28Speaker 1: So it pulls out the important bitcisely. Extractors refine the
- 10:31Speaker 1: match data into just the useful intelligence you need. It
- 10:34Speaker 1: cleans up the output and quick pro tip here always
- 10:38Speaker 1: always use a yamo linter to check your template syntax
- 10:41Speaker 1: before you try to run it. Simple typos can waste
- 10:43Speaker 1: a lot of time. Good advice. Okay, So now I've
- 10:46Speaker 1: got these custom templates. I figured out my ideal rate limits,
- 10:48Speaker 1: my preferred severities to exclude. That's a lot of flags
- 10:51Speaker 1: to type every single time I run the tool. How
- 10:53Speaker 1: do I make this easier?
- 10:54Speaker 2: Ah? Persistence, That's where configuration files come in. Most good
- 10:57Speaker 2: tools support a config file, usually a configured YAML somewhere
- 11:00Speaker 2: in your home directory, like in a dot config Nuclei.
- 11:03Speaker 1: Folder, and this file lets me set default exactly.
- 11:06Speaker 2: You can put many of those command line flags right
- 11:08Speaker 2: into the configuration file, so you can permanently tell it
- 11:11Speaker 2: to always exclude info severity, or always use a specific
- 11:14Speaker 2: rate limit.
- 11:14Speaker 1: Or always run my custom templates.
- 11:16Speaker 2: Yes, you can list your custom template files like that
- 11:20Speaker 2: PHP detect dot amml you just wrote right in the config.
- 11:24Speaker 2: Then every time you run the tool against any target,
- 11:27Speaker 2: those custom checks are automatically included without you needing to
- 11:30Speaker 2: specify them.
- 11:31Speaker 1: So it basically makes my personalized advanced setup the new
- 11:36Speaker 1: standard behavior for the tool on my system.
- 11:38Speaker 3: That's the idea. It streamlines your workflow immensely.
- 11:42Speaker 1: This has been incredibly useful. We've gone from just running
- 11:45Speaker 1: a tool to surgically filtering with tags and severity, managing
- 11:48Speaker 1: network load with rate limits and bulk size, proving our
- 11:51Speaker 1: findings with debugging and custom headers, and finally achieving total
- 11:55Speaker 1: control by writing and saving our own checks via templates
- 11:57Speaker 1: and config files.
- 11:58Speaker 2: It really gives you that fine rain control needed for
- 12:01Speaker 2: professional efficient testing.
- 12:03Speaker 1: Absolutely. So before we wrap up, maybe a quick review
- 12:06Speaker 1: exercise for you listening. Imagine this, You start scanning in
- 12:11Speaker 1: your target five minutes in request, start failing. It looks
- 12:14Speaker 1: like you're being blocked, probably due to sending too much
- 12:17Speaker 1: traffic too quickly. Which two primary flags related to speed
- 12:22Speaker 1: and volume should you immediately think about adjusting downwards to
- 12:24Speaker 1: your next attempt? The classic getting blocked scenario. Okay, so
- 12:29Speaker 1: if you're hitting a wall because of traffic volume, you
- 12:32Speaker 1: definitely need to reduce the rate limit right slow down
- 12:34Speaker 1: their qus per second to that specific target. One and
- 12:37Speaker 1: the other depends slightly, But you look at either the
- 12:39Speaker 1: bulk size if you're scanning many hosts at once, or
- 12:42Speaker 1: the concurrency DAS flag, which controls templates per host. Reducing
- 12:46Speaker 1: either of those should lower the overall strain. It's about
- 12:48Speaker 1: understanding that difference between per target speed and overall parallel activity.
- 12:53Speaker 2: That's exactly right. Kneeling down those controls is key to successful.
- 12:57Speaker 3: Scanning in the real world, definitely.
- 13:00Speaker 2: So our advice is experiment with these controls, start building
- 13:04Speaker 2: your own custom templates, and we'll stop using that fire
- 13:07Speaker 2: hose when you really need a scalpel.
- 13:09Speaker 3: Couldn't have set it better myself, all.
- 13:10Speaker 1: Right, that's all the time we have for this deep dive.
- 13:13Speaker 1: Thanks for tuning in, and we'll catch you next time.