Latest / CyberCode Academy / Course 3 - Mastering Nuclei for Bug Bounty | Episode 1: Nuclei: Installation, Template Setup, and First Scan
Transcript
- 0:00Speaker 1: So if you're working in security today, you definitely understand
- 0:04Speaker 1: the challenge. It's just overwhelming, right, keeping up with all
- 0:07Speaker 1: the vulnerabilities popping up every week. You need more than
- 0:10Speaker 1: just a scanner. You almost need like a specialized search
- 0:12Speaker 1: engine for weaknesses, pulling in knowledge from everywhere.
- 0:16Speaker 2: Fast and well. That really brings us to our deep
- 0:19Speaker 2: dive today. Nuclei. It's this template based automation tool that's
- 0:25Speaker 2: really changing the game for rapid security checks.
- 0:28Speaker 1: Yeah, it's quite interesting how it's designed. Fundamentally, Yes, it's
- 0:30Speaker 1: a template based vulnerability scanner, but the big thing, the
- 0:34Speaker 1: hook is its claim of getting well virtually zero false positives. Okay,
- 0:39Speaker 1: hang on, it's really built for accuracy zero false positive.
- 0:42Speaker 2: I mean insecurity that often sounds a bit like, you know,
- 0:44Speaker 2: marketing speak. Is there a catch like does that precision
- 0:48Speaker 2: cost you speed? Or is there something fundamentally different happening here.
- 0:50Speaker 1: That's a fair question, and it really comes down to
- 0:53Speaker 1: the structure. See, Nuclei isn't a fuzzer. It's not just
- 0:56Speaker 1: throwing random stuff at a target hoping for the best.
- 0:59Speaker 2: It works. It's entirely based on these very specific checks
- 1:02Speaker 2: defined in the templates. So if a template says, look
- 1:06Speaker 2: for this exact file, check for this specific version string.
- 1:09Speaker 2: That is literally all it does. That specificity means when
- 1:13Speaker 2: Nuclei flags something, it's usually a confirmed hit, not just
- 1:16Speaker 2: a guess.
- 1:17Speaker 1: Got it.
- 1:17Speaker 2: The speed, which we can talk more about, that comes
- 1:19Speaker 2: from Go. But the precision that's all in the template design. Right.
- 1:22Speaker 1: So we're using these like verified blueprints for every single check.
- 1:26Speaker 1: Hmm makes sense. Okay. So our mission today then is
- 1:30Speaker 1: to unpack that how Nuclei is built, how those templates work,
- 1:34Speaker 1: and walk through getting it set up for a first run.
- 1:38Speaker 1: Let's start with the basics, the anatomy. If the templates
- 1:41Speaker 1: are the brains, what gives Nuclei that speed and efficiency
- 1:44Speaker 1: for like mass hunting across loads of targets.
- 1:48Speaker 2: Well, the speed really stems from its core. It's written
- 1:50Speaker 2: in Go. Okay, and Go is fantastic for concurrency. It
- 1:53Speaker 2: means Nuclei can handle you know, thousands of checks running
- 1:56Speaker 2: at the same time without bogging down. That lets security
- 1:59Speaker 2: teams skaal and large sets of targets really quickly.
- 2:02Speaker 1: And it's not just about hitting websites, is it? The
- 2:05Speaker 1: scope seems broader?
- 2:06Speaker 2: Oh? Absolutely. Web scanning is key of course, but Nuclei
- 2:10Speaker 2: is built for the whole modern stack. It handles HTTP naturally,
- 2:14Speaker 2: but also DNS, raw, TCP connections, even file based checks.
- 2:19Speaker 1: File based like checking canfig files.
- 2:21Speaker 2: Exactly local canfig files? Maybe cloud provider settings, things like that.
- 2:25Speaker 1: Interesting. So to get it to do anything, you need
- 2:29Speaker 1: two pieces, right, the what and the.
- 2:31Speaker 2: Where Precisely, you need the template that's the what to
- 2:34Speaker 2: look for, and the target the where to look. Okay,
- 2:37Speaker 2: the absolute most basic command you might see is just Nuclei,
- 2:40Speaker 2: then the quiet flag issue and then the.
- 2:42Speaker 1: Target ur simple enough, But before we even type that,
- 2:45Speaker 1: let's talk set up what's the absolute must have?
- 2:48Speaker 2: The one core prerequisite is Go. You need Go version
- 2:51Speaker 2: one point eight or new er installed, right, since Nuclei
- 2:54Speaker 2: is built with Go, having that environment ready is step zero.
- 2:57Speaker 1: Okay, go installed. Then getting Nucleari it self seen pretty
- 3:00Speaker 1: flexible depending on your system.
- 3:02Speaker 2: Yeah, they've made it pretty easy for a lot of
- 3:03Speaker 2: people just using the GO command Go install is the
- 3:06Speaker 2: simplest way. If you're on a Mac, home Brew is
- 3:08Speaker 2: an option, Brew install.
- 3:11Speaker 1: Nuclei and docer for keeping things contained.
- 3:14Speaker 2: Yep, Doctor's a solid choice too, Or you can just
- 3:17Speaker 2: go old school head to the GitHub releases page for Nuclei.
- 3:21Speaker 1: AH the release is tab and.
- 3:23Speaker 2: Just download the pre compiled binary the asset for your
- 3:27Speaker 2: specific OS, Linux, Mac, Windows.
- 3:31Speaker 1: So multiple ways to get it on your machine. And
- 3:33Speaker 1: the final check, how do you know it worked?
- 3:35Speaker 2: Easyps Just run Nuclei help flag exactly. If you see
- 3:40Speaker 2: the help menu pop up listing all the options and
- 3:42Speaker 2: showing the version number, you're good to go. Installation successful.
- 3:45Speaker 1: All right, installed and verified. Now let's circle back to
- 3:48Speaker 1: what you said gives it its precision. The templates. This
- 3:50Speaker 1: seems like the real heart of the system.
- 3:52Speaker 2: They absolutely are. If Go is the engine providing speed,
- 3:55Speaker 2: the templates are the navigation system and the destination list.
- 3:58Speaker 2: They contain all the security intelligence. Without templates, Nuclei is
- 4:02Speaker 2: well just a fast runner with nowhere to go. And
- 4:03Speaker 2: they're written in Yamel YAML. Why yamal is that format
- 4:07Speaker 2: particularly special here? It's strategically important. Yeah. Yamil is superhuman readable.
- 4:13Speaker 2: It's relatively easy to look at a template and understand
- 4:16Speaker 2: what it's trying to do.
- 4:18Speaker 1: Right, less complex than some other formats.
- 4:20Speaker 2: Exactly, And that simplicity is key to why the community
- 4:23Speaker 2: contribution model works so well for Nuclei. Because they're easy
- 4:27Speaker 2: to write and read. Security researchers, bug bounty hunters all
- 4:30Speaker 2: over the world can contribute new checks quickly.
- 4:33Speaker 1: Ah, So it lowers the barrier to entry for adding.
- 4:35Speaker 2: Intelligence precisely, and that means the pool of available checks
- 4:39Speaker 2: the intelligence grows much faster than say a traditional commercial
- 4:43Speaker 2: scanner that relies only on internal teams.
- 4:46Speaker 1: That makes sense. It's like crowdsourcing vulnerability checks. And I
- 4:49Speaker 1: imagine with all those contributions, it needs to be organized somehow.
- 4:53Speaker 2: Oh, definitely. The templates are organized with categories and tags.
- 4:57Speaker 2: You've got tags for things like specific cvese, common misconfigurations,
- 5:01Speaker 2: subdomain takeovers, even templates for fuzzing or just helper utilities.
- 5:06Speaker 1: Any idea of this scale, Like, how many are we
- 5:08Speaker 1: talking about?
- 5:09Speaker 2: Well, just to give you a rough idea, the tag
- 5:11Speaker 2: for cvees alone, last I checked, it had something like
- 5:15Speaker 2: over fifteen hundred templates.
- 5:17Speaker 1: Wow, fifteen hundred specific cve checks ready to go.
- 5:20Speaker 2: Yeah, each one basically a little peer review penetration test
- 5:24Speaker 2: you can run instantly.
- 5:25Speaker 1: And this template system isn't just for external scanning like
- 5:28Speaker 1: bug bounties. Right, you mentioned integration earlier.
- 5:31Speaker 2: Absolutely, that's a huge benefit. For organizations. You can take
- 5:34Speaker 2: these templates, even write your own custom ones for your
- 5:37Speaker 2: specific applications, and integrate them directly into your CICD pipelines.
- 5:42Speaker 1: Continuous integration, continuous deployment, right.
- 5:44Speaker 2: So you can automatically check for new vulnerabilities or misconfigurations
- 5:48Speaker 2: before code ever makes it to production, catching things early.
- 5:52Speaker 1: Very powerful. Okay, so to use all this, we need
- 5:55Speaker 1: the templates on our local machine. How do we get them?
- 5:58Speaker 2: A couple of standard ways. You can use get clone
- 6:00Speaker 2: with the URL of the official Nuclei templates repository on GitHub.
- 6:04Speaker 1: Okay, just clone the whole repo.
- 6:05Speaker 2: Yep, or you can just download the whole repository as
- 6:08Speaker 2: a zip file from GitHub.
- 6:10Speaker 1: Is one better than the other.
- 6:11Speaker 2: Get clone makes it easier to update later, just run
- 6:13Speaker 2: get pull. But downloading the zip works fine too. It's
- 6:16Speaker 2: worth noting sometimes Nuclei tries to automatically download or update
- 6:20Speaker 2: templates when you run it, but having your own local,
- 6:23Speaker 2: up to date copy manually is often a good idea,
- 6:25Speaker 2: especially for offline use or CICD.
- 6:28Speaker 1: Got it clone or download the templates. So now we
- 6:30Speaker 1: have nuclean stall, we have the templates. We're ready to
- 6:33Speaker 1: actually run a scan. Looking back at that help menu,
- 6:36Speaker 1: what are the absolute essential flags we need to understand
- 6:39Speaker 1: before we launch anything.
- 6:41Speaker 2: Two flags are pretty much mandatory for almost any scam.
- 6:44Speaker 2: That target flag, which is SU and the template flag.
- 6:47Speaker 1: It's okay, dick you for the target URL. Anything tricky there.
- 6:50Speaker 2: The main thing is you must include the protocol so
- 6:52Speaker 2: HTTP or HDPS. Nuclei needs that to know how to connect.
- 6:56Speaker 2: You can't just put example.
- 6:57Speaker 1: Dot com right needs the full URL schema and the
- 7:00Speaker 1: HT flag for templates. You said this one is critical.
- 7:02Speaker 2: Oh, absolutely credible. And here's why. If you don't use
- 7:05Speaker 2: the st flag to specify which template or templates you
- 7:08Speaker 2: want to run, uh oh, Nuclei of faults to running
- 7:11Speaker 2: well all of them.
- 7:12Speaker 1: All fifteen hundred plus CVCHX plus everything else against one
- 7:17Speaker 1: target exactly.
- 7:18Speaker 2: Imagine launching thousands of security checks simultaneously at a single
- 7:21Speaker 2: server without warning.
- 7:23Speaker 1: Yikes. That sounds less like a scan.
- 7:24Speaker 2: And more like the denial of service attempt basically, or
- 7:27Speaker 2: at least it could easily look like one. Okay, So
- 7:30Speaker 2: using mayor T to specify a single template file, a
- 7:34Speaker 2: specific directory of templates, or maybe just a category tag,
- 7:38Speaker 2: that's not just best practice for focusing your scan. It's
- 7:41Speaker 2: really an ethical requirement for responsible use. Don't just blast everything.
- 7:45Speaker 1: Point take it be targeted. Let's make this practical. Then,
- 7:48Speaker 1: can we walk through a simple safe example, maybe using
- 7:50Speaker 1: that test site mentioned in the materials testphp dot vulnweb
- 7:54Speaker 1: dot com.
- 7:54Speaker 2: Sure that's a good target for safe testing. So to
- 7:57Speaker 2: run an ethical focus scan, you'd type nuclei, then dash
- 8:00Speaker 2: UHTTT dot tes, php dot vomweb dot com. Remember the
- 8:05Speaker 2: HTP got it, and then crucially nash ut. Now instead
- 8:08Speaker 2: of running everything, let's say you have the templates cloned
- 8:10Speaker 2: locally in a folder called Nuclei templates. You could specify
- 8:13Speaker 2: just the technologies category like this Dashi Nuclei templates technologies.
- 8:17Speaker 1: Ah so just run the tech detection templates, not looking
- 8:20Speaker 1: for bones yet, just identifying software exactly.
- 8:23Speaker 2: It's an informational scan first.
- 8:24Speaker 1: Okay, so we run that command. What kind of output
- 8:28Speaker 1: should we expect if it works?
- 8:29Speaker 2: If successful, Nuclei will run just those technology detection templates
- 8:34Speaker 2: against the target, and for that specific site, it typically
- 8:37Speaker 2: finds a couple of things it should report back based
- 8:40Speaker 2: on matching templates that it detected. PHP version five point
- 8:44Speaker 2: six point four specific version, and it also usually detects
- 8:48Speaker 2: the web server Engine X version one point one two
- 8:51Speaker 2: point zero.
- 8:52Speaker 1: Wow. Okay, so not just it's running PHP and Engine X,
- 8:55Speaker 1: but the exact versions that's actionable.
- 8:57Speaker 2: In precisely, and that goes back to the template design
- 9:01Speaker 2: and the zero false positive idea. The template that found
- 9:04Speaker 2: PHP five point six point four zero didn't just guess.
- 9:08Speaker 2: It likely found a specific file or header or response
- 9:11Speaker 2: that only exists in that exact version.
- 9:13Speaker 1: Right. The template itself contained that fingerprint that validates the
- 9:16Speaker 1: whole concept. It's highly specific exactly.
- 9:18Speaker 2: So just to quickly recap what we've covered.
- 9:20Speaker 1: Yeah, let's pull it together.
- 9:21Speaker 2: We define NUCLEI high speed GO based template driven scanner
- 9:26Speaker 2: focused on accuracy, zero false positives through specific checks. We
- 9:30Speaker 2: talk installation dot, need go one point eight plus dot,
- 9:33Speaker 2: then use Go install, brew Docker or download nineries verify
- 9:36Speaker 2: with h We stress the templates, the ammal files, the
- 9:39Speaker 2: community contributions, the category like CBS, they're the core intelligence.
- 9:42Speaker 2: Get them with get clone or download got it. And
- 9:45Speaker 2: finally the first run use MESU with the full URL
- 9:48Speaker 2: including httphts and always use sd to specify templates responsibly.
- 9:53Speaker 2: Our example found specific PHP and Engine x versions on
- 9:56Speaker 2: the test site.
- 9:57Speaker 1: So the big takeaway here for you, the listeners, seems
- 10:00Speaker 1: to be this. Having a tool like Nuclei set up
- 10:02Speaker 1: lets you tap into this massive, constantly updated library of
- 10:05Speaker 1: community security knowledge almost instantly. It helps shift the focus
- 10:09Speaker 1: from wading through noisy alerts to confirming specific, high confidence
- 10:13Speaker 1: findings much more efficient. Okay, here's a little rezive question
- 10:17Speaker 1: for you, based on what we just discussed. We saw
- 10:19Speaker 1: Nuclei detect PHP five point six point four oh B
- 10:22Speaker 1: and engine X one point one ten point zero on
- 10:24Speaker 1: that test site. If you wanted to only check that
- 10:26Speaker 1: specific target for known vulnerabilities related to just those two technologies,
- 10:31Speaker 1: what's the single most important command flag you'd use next?
- 10:33Speaker 1: And why think about that for a second. It's got
- 10:36Speaker 1: to be the SD flag again, right, to specify only
- 10:38Speaker 1: the templates relevant to PHP five point six point four
- 10:41Speaker 1: WIO and engine X one point point point zero, avoiding
- 10:43Speaker 1: that massive noisy scan of.
- 10:44Speaker 2: Eric else exactly. Pescity is key for focus and responsibility.
- 10:48Speaker 2: And here's a final thought to leave you with. We
- 10:51Speaker 2: saw how existing templates detected known software versions. Now imagine
- 10:56Speaker 2: you discover a brand new vulnerability, a zero day maybe
- 10:59Speaker 2: in a custom application your company uses. Think about the
- 11:02Speaker 2: power of being able to quickly write your own Nuclei
- 11:05Speaker 2: template to detect that specific flaw, and then instantly scan
- 11:09Speaker 2: all your systems for it, potentially before anyone else even
- 11:12Speaker 2: knows about it, certainly before a patch exists. That ability
- 11:15Speaker 2: to customize and deploy targeted checks rapidly, that's where the
- 11:18Speaker 2: real strategic advantage of a tool like Nuclei comes into play.
- 11:21Speaker 2: It's not just about using community templates, it's about creating
- 11:24Speaker 2: your own intelligence too.