Nuclei Kurulumu ve Kullanımı (Zafiyet Tarama Aracı)

Cezeri

Yönetici
94a2fe222f1201c06c426338463ddd5db1a127ef.png

Nuclei, ProjectDiscovery ekibinin geliştirdiği, Go dili ile yazılmış olan, şablonlar (template - YAML formatında) ile yönetilebilir, hızlı ve açık kayak kodlu bir güvenlik zafiyeti tarama yazılımıdır. Şablonlar ile yönetilebilir olmasından ötürü, belirli bir güvenlik açığını birden fazla sunucuda aramayı mümkün kılar. Nuclei TCP, DNS, HTTP vb. protokoller üzerinde güvenlik zafiyeti taraması yapabilir. Ayrıca 200’den fazla güvenlik araştırmacısı ve mühendisin katkıda bulunduğu şablon deposu vardır.

Nuclei Kurulumu​

Go ile Nuclei Kurulumu​

Kod:
GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei
Başarıyla kurulabilmesi için en son Go sürümü gerektirir.

Brew ile Nuclei Kurulumu​

Kod:
brew install nuclei
Bu yöntemi MacOS ve Linux destekler.

Docker ile Nuclei Kurulumu​

Kod:
docker pull projectdiscovery/nuclei:latest

Github’tan Nuclei Kurulumu​

Kod:
git clone https://github.com/projectdiscovery/nuclei.git; \
cd nuclei/v2/cmd/nuclei; \
go build; \
mv nuclei /usr/local/bin/; \
nuclei -version;
Başarıyla kurulabilmesi için en son Go sürümü gerektirir.

Binary ile Nuclei Kurulumu​

Kod:
https://github.com/projectdiscovery/nuclei/releases
  1. İşletim sisteminize göre en son dosyayı indirin.
  2. Arşivden çıkarın ve binary dosyasını çalıştırın.

Nuclei Template Kurulumu ve Güncellenmesi​

Kod:
nuclei -ut
nuclei -update

Nuclei Kullanımı​

Artık Nuclei’yi kullanmaya hazırız. Tüm komutları ve açıklamalarını görmek için nuclei -h komutunu kullanabilirsiniz.
59db33540afe20974fd40e245ec75cbdb924924a_2_603x500.png
59db33540afe20974fd40e245ec75cbdb924924a.png

Kod:
Usage:
  nuclei [flags]

Flags:
TARGET:
   -u, -target string[]  target URLs/hosts to scan
   -l, -list string      path to file containing a list of target URLs/hosts to scan (one per line)

TEMPLATES:
   -tl                      list all available templates
   -t, -templates string[]  template or template directory paths to include in the scan
   -w, -workflows string[]  list of workflows to run
   -nt, -new-templates      run newly added templates only
   -validate                validate the passed templates to nuclei

FILTERING:
   -tags string[]                         execute a subset of templates that contain the provided tags
   -include-tags string[]                 tags from the default deny list that permit executing more intrusive templates
   -etags, -exclude-tags string[]         exclude templates with the provided tags
   -include-templates string[]            templates to be executed even if they are excluded either by default or configuration
   -exclude-templates, -exclude string[]  template or template directory paths to exclude
   -severity, -impact value[]             Templates to run based on severity. Possible values: info, low, medium, high, critical
   -author string[]                       execute templates that are (co-)created by the specified authors

OUTPUT:
   -o, -output string            output file to write found issues/vulnerabilities
   -silent                       display findings only
   -v, -verbose                  show verbose output
   -vv                           display extra verbose information
   -nc, -no-color                disable output content coloring (ANSI escape codes)
   -json                         write output in JSONL(ines) format
   -irr, -include-rr             include request/response pairs in the JSONL output (for findings only)
   -nm, -no-meta                 don't display match metadata in CLI output
   -nts, -no-timestamp           don't display timestamp metadata in CLI output
   -rdb, -report-db string       local nuclei reporting database (always use this to persist report data)
   -me, -markdown-export string  directory to export results in markdown format
   -se, -sarif-export string     file to export results in SARIF format

CONFIGURATIONS:
   -config string              path to the nuclei configuration file
   -rc, -report-config string  nuclei reporting module configuration file
   -H, -header string[]        custom headers in header:value format
   -V, -var value              custom vars in var=value format
   -r, -resolvers string       file containing resolver list for nuclei
   -system-resolvers           use system DNS resolving as error fallback
   -passive                    enable passive HTTP response processing mode
   -env-vars                   enable environment variables support

INTERACTSH:
   -no-interactsh                     disable interactsh server for OOB testing
   -interactsh-url string             interactsh server url for self-hosted instance (default "https://interact.sh")
   -interactsh-token string           authentication token for self-hosted interactsh server
   -interactions-cache-size int       number of requests to keep in the interactions cache (default 5000)
   -interactions-eviction int         number of seconds to wait before evicting requests from cache (default 60)
   -interactions-poll-duration int    number of seconds to wait before each interaction poll request (default 5)
   -interactions-cooldown-period int  extra time for interaction polling before exiting (default 5)

RATE-LIMIT:
   -rl, -rate-limit int          maximum number of requests to send per second (default 150)
   -rlm, -rate-limit-minute int  maximum number of requests to send per minute
   -bs, -bulk-size int           maximum number of hosts to be analyzed in parallel per template (default 25)
   -c, -concurrency int          maximum number of templates to be executed in parallel (default 10)

OPTIMIZATIONS:
   -timeout int               time to wait in seconds before timeout (default 5)
   -retries int               number of times to retry a failed request (default 1)
   -max-host-error int        max errors for a host before skipping from scan (default 30)
   -project                   use a project folder to avoid sending same request multiple times
   -project-path string       set a specific project path (default "$TMPDIR/")
   -spm, -stop-at-first-path  stop processing HTTP requests after the first match (may break template/workflow logic)

HEADLESS:
   -headless          enable templates that require headless browser support
   -page-timeout int  seconds to wait for each page in headless mode (default 20)
   -show-browser      show the browser on the screen when running templates with headless mode

DEBUG:
   -debug                     show all requests and responses
   -debug-req                 show all sent requests
   -debug-resp                show all received responses
   -proxy, -proxy-url string  URL of the HTTP proxy server
   -proxy-socks-url string    URL of the SOCKS proxy server
   -trace-log string          file to write sent requests trace log
   -version                   show nuclei version
   -tv, -templates-version    shows the version of the installed nuclei-templates

UPDATE:
   -update                        update nuclei to the latest released version
   -ut, -update-templates         update the community templates to latest released version
   -nut, -no-update-templates     do not check for nuclei-templates updates
   -ud, -update-directory string  overwrite the default nuclei-templates directory (default "$HOME/nuclei-templates")

STATISTICS:
   -stats                    display statistics about the running scan
   -stats-json               write statistics data to an output file in JSONL(ines) format
   -si, -stats-interval int  number of seconds to wait between showing a statistics update (default 5)
   -metrics                  expose nuclei metrics on a port
   -metrics-port int         port to expose nuclei metrics on (default 9092)
Nuclei’nin en temel kullanımı nuclei -u https://vvhack.org şeklindedir. Bu kullanımda spesifik bir template belirtmediğimiz için varsayılan olarak tüm template’leri kullanacaktır. Eğer spesifik template’ler kullanmak istiyorsak -t parametresini kullanabiliriz.
6004185ca41adb308773fd938321fb21d6c85d94_2_690x484.png
6004185ca41adb308773fd938321fb21d6c85d94.png


Örneğin; nuclei -u https://vvhack.org -t cves/2020/ komutunu çalıştırdığımız zaman “cves/2020/” dizini altındaki tüm template’leri kullanacaktır.
a1d03e8bfbe9e2b102afddf5f9f3385e5a143df8.png


Birden fazla template kullanmak yerine tek bir tane de kullanabiliriz. Örneğin; nuclei -u https://vvhack -t cves/2020/CVE-2020-35736.yaml
fe72eaa74969d9ddd4240b53fd4ed0e62f631cf2.png


Ayrıca taramada bazı template’leri hariç tutmak için -exclude-templates parametresini kullanabiliriz.
72603c9a9d7c8cf43276266b83b6fa8de06ba1ca_2_690x276.png

72603c9a9d7c8cf43276266b83b6fa8de06ba1ca.png

Template’leri filtreleyerek sadece istediğimiz türdeki template’lerin çalışmasını sağlayabiliriz. Nuclei 3 tip filtreleme yöntemini destekler.
  1. Etiketler (-tags)
  2. Önem derecesi (-severity)
  3. Yazar (-author)
Bazı etiketleri hariç tutmak için ise -exclude-tags parametresini kullanabiliriz.

Örnek kullanım: nuclei -u https://vvhack.org -tags rce,cve -severity critical,high -author XXXXX -exclude-tags xss
18d1c881bd5528c0e339e5d1b8c0df42462af283_2_690x252.png
18d1c881bd5528c0e339e5d1b8c0df42462af283.png


Eğer birden fazla hedef üzerinde tarama yapmak istiyorsak -list veya -l parametresini kullanabiliriz. Örneğin; nuclei -l url_listesi.txt komutu ile url_listesi.txt dosyasının içinde bulunan tüm adresler üzerinde tarama yapar.
Not: Taramanın yapılacağı adreslerin bulunduğu dosyada her satıra bir adres yazılmalıdır.
79c723b96226e01f9cc122c54f72802cf9d7e564_2_643x499.png
79c723b96226e01f9cc122c54f72802cf9d7e564.png


Nuclei’nin raporlama modülü Jira, Github ve Gitlab’ı destekler. Bunun için raporlamanın yapılacağı platformun config dosyasını oluşturmalı, -rc veya -report-config parametresinden sonra config dosyasının yolunu belirtilmelidir.

Örnek config dosyası: https://github.com/projectdiscovery/nuclei/blob/master/v2/cmd/nuclei/issue-tracker-config.yaml

Örnek kullanım: nuclei -u https://vvhack.org -rc config.yaml

Taramanın çıktısını markdown olarak dışa aktarmak için ise -me veya -markdown-export parametresini kullanabiliriz. Eğer sadece düz metin olarak çıktıyı dışarı aktarmak istiyorsak -o parametresini kullanabiliriz.

Örnek kullanım: nuclei -u https://vvhack.org -rc config.yaml -me markdown.txt -o output.txt
 
Moderatör tarafında düzenlendi:
Üst