Introduction
Welcome to the Automated Vulnerability Scanning with Nuclei lab.
Nuclei is a fast, template-based vulnerability scanner widely used by security researchers, penetration testers, and bug bounty hunters. Instead of relying on a hardcoded set of checks, Nuclei uses YAML-based templates to define how to detect specific vulnerabilities, misconfigurations, and exposed sensitive files. This makes it incredibly flexible and easy to extend.
The template model is important because it separates scanner engine from detection content. The engine sends requests and evaluates matches, while the templates describe what counts as interesting. That design makes Nuclei adaptable, but it also means template quality strongly affects result quality.
In this lab, you will learn the core workflow of using Nuclei. You will start by updating its vulnerability templates, run a general scan against a local test server, learn how to filter scans using specific tags to reduce noise, and finally save and analyze the scan results.
Update Nuclei Templates
In this step, you will learn how to initialize and update Nuclei's vulnerability templates.
Nuclei's true power lies in its community-driven templates. These templates are YAML files that contain the exact HTTP requests, DNS queries, or network packets needed to identify a specific vulnerability (like a CVE) or a misconfiguration. Because new vulnerabilities are discovered daily, it is crucial to keep your templates up to date before starting any scan.
This is the same maintenance principle you saw with other scanners: current detection content matters as much as the binary itself.
To update the templates, you will use the -update-templates flag. This command connects to the official ProjectDiscovery GitHub repository, downloads the latest templates, and stores them in your home directory.
Run the following command in your terminal to update the templates:
nuclei -update-templates
You should see an output similar to this, indicating that the templates have been successfully downloaded or updated:
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.1.10
projectdiscovery.io
[INF] Nuclei Templates are up to date: v9.8.4
The templates are now stored in the nuclei-templates directory within your home folder. You are now ready to start scanning.
Run a General Template Scan
In this step, you will execute your first vulnerability scan against a local target.
For this lab, a local web server has been started in the background on port 8080. This server contains some simulated misconfigurations, such as exposed configuration files, which are common targets in real-world bug bounty hunting.
Exposure findings are a good example of how simple misconfiguration can create high impact. No complex exploit is required if sensitive files are directly reachable.
To run a basic scan against a single target URL, you use the -u (URL) flag followed by the target address. By default, if you don't specify any specific templates, Nuclei will run a large set of default templates against the target.
Execute the following command to scan the local test server:
nuclei -u http://localhost:8080
As Nuclei runs, it will print out any findings in real-time. The output format typically includes the template ID, the severity of the finding, the protocol used, and the URL where the issue was found.
[git-config] [http] [medium] http://localhost:8080/.git/config
[generic-env] [http] [high] http://localhost:8080/.env [paths="/.env"]
In the output above, Nuclei successfully discovered an exposed .git/config file and an .env file. These are critical findings in a real-world scenario, as they often contain sensitive source code or database credentials.
Target Specific Vulnerability Tags
In this step, you will learn how to optimize your scans by targeting specific categories of vulnerabilities.
Running all default templates against a target can be time-consuming and noisy. To make scanning more efficient, Nuclei allows you to filter templates using tags. Every template has metadata, including tags like cve, exposure, tech, panel, and lfi.
Tags are a way to align the scanner with your hypothesis. If you suspect one class of weakness, targeted scanning produces cleaner evidence than running everything.
If you are only interested in finding exposed sensitive files (like the .env file we saw earlier), you can instruct Nuclei to only run templates that have the exposure tag. This drastically reduces the scan time and focuses the results.
Use the -tags flag to run a targeted scan for exposures:
nuclei -u http://localhost:8080 -tags exposure
You will notice that the scan finishes much faster this time. The output will only display findings related to the exposure tag:
[git-config] [http] [medium] http://localhost:8080/.git/config
[generic-env] [http] [high] http://localhost:8080/.env [paths="/.env"]
By combining different tags (e.g., -tags cve,exposure), you can create highly customized and efficient scanning profiles tailored to your specific security testing goals.
Analyze Nuclei Output
In this final step, you will learn how to save the scan results to a file for later analysis or reporting.
When running automated scans, especially across multiple targets, you rarely want to rely solely on the terminal output. Saving the results allows you to integrate Nuclei with other tools, track vulnerabilities over time, or generate reports for clients.
Nuclei provides the -o (output) flag to save the findings to a plain text file.
Run the targeted scan again, but this time, save the output to a file named nuclei_results.txt in your current project directory:
nuclei -u http://localhost:8080 -tags exposure -o nuclei_results.txt
The scan will execute, and you will still see the results in your terminal. However, a new file has also been created. You can view the contents of this file using the cat command:
cat nuclei_results.txt
The output will look exactly like the terminal findings:
[git-config] [http] [medium] http://localhost:8080/.git/config
[generic-env] [http] [high] http://localhost:8080/.env [paths="/.env"]
For more advanced use cases, Nuclei also supports JSON output (-json-export) and Markdown export (-me), which are highly useful when building automated security pipelines.
Summary
Congratulations! You have successfully completed the Automated Vulnerability Scanning with Nuclei lab.
In this lab, you learned how to:
- Keep your vulnerability detection engine up to date by updating Nuclei templates.
- Execute a general vulnerability scan against a target web server.
- Optimize your scanning process by filtering templates using specific tags like
exposure. - Save and analyze the scan results for reporting and further investigation.
These foundational skills are essential for modern security testing and bug bounty hunting. As you continue your journey, you can explore writing your own custom Nuclei templates to detect unique vulnerabilities specific to your applications.



