ATT&CK: T1595.002 Vulnerability Scanning · Reconnaissance (TA0043)

Nuclei는 YAML 템플릿 기반 매처다. 특정 요청을 보내고 응답에서 정규식/상태코드/길이로 패턴을 매칭해 “취약점일 가능성"을 알린다. 수천 개의 커뮤니티 템플릿이 공개돼 있어서 CVE 발표 ~ 커버리지 추가가 수 시간 수준인 게 가장 큰 장점.

1. 설치와 템플릿 업데이트

# Go 설치되어 있으면
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest

# 템플릿 최신화 — 매 사용 전 추천
nuclei -update-templates

2. 기본 사용

nuclei -u https://target.example.com \
       -o scans/nuclei.txt

이것만 해도 수천 개 템플릿이 돈다. 실전에선 범위 좁히는 게 핵심.

3. 범위 좁히기 — severity와 카테고리

nuclei -u https://target.example.com \
       -t cves/ -t exposures/ -t misconfiguration/ \
       -severity medium,high,critical \
       -c 50 -rate-limit 150 \
       -o scans/nuclei.txt
  • -t: 템플릿 디렉터리/파일. 자주 쓰는 조합은 cves/ + exposures/ + misconfiguration/.
  • -severity: info/low/medium/high/critical. info는 끄는 쪽을 추천 (노이즈 큼).
  • -c: 동시성. -rate-limit: 초당 요청 수.

4. 여러 대상 입력

httpx(또는 직접 작성한 live host 목록)에서 받은 URL 리스트를 그대로 넘긴다:

cat subs-live.txt | nuclei -t cves/ -severity high,critical -o scans/n.txt

JSONL 출력(-jsonl)이 후처리에 가장 편하다.

5. False positive 다루기

실전에서 가장 큰 적. 다루는 패턴:

  1. exposures/configs/ 같은 일반 설정 노출 템플릿은 false positive 많음. 수동 검증 전제로.
  2. -mhe (match host extraction) + 응답을 직접 봐야 할 때 -debug-req로 요청 재확인.
  3. 매우 신뢰도 높은 결과만 보고 싶으면 tags:cve,oast 쪽만 돌림 — Out-of-band 검증까지 하는 템플릿.

6. 자체 템플릿 작성

가장 유용한 활용. 조직 내부 자산에 반복되는 패턴이 있으면 템플릿화해둔다:

id: company-admin-exposed

info:
  name: Internal admin panel exposed
  author: me
  severity: medium
  tags: internal,exposure

http:
  - method: GET
    path:
      - "{{BaseURL}}/admin/login"
    matchers-condition: and
    matchers:
      - type: status
        status:
          - 200
      - type: word
        words:
          - "Company Admin Portal"
        part: body

파일로 저장하고 -t ./custom-templates/ 로 로드.

7. OAST (out-of-band)로 blind 취약점 잡기

Blind SSRF, blind XXE, 특정 RCE 등은 응답으로 확인 불가 — 외부 콜백이 필요하다. Nuclei는 interactsh 통합이 기본:

nuclei -u https://target.example.com -t cves/ -iserver "https://oast.pro"

클라이언트가 interactsh 세션을 띄우고, 템플릿이 콜백 받으면 매칭.

8. Nuclei vs nmap NSE 선택 기준

상황 선택
포트 스캔과 함께 가볍게 nmap NSE
웹/API 레이어 깊게 Nuclei
최신 CVE 체크 Nuclei (템플릿 증식 빠름)
조직 특화 패턴 Nuclei 자체 템플릿

참고