Giter Club home page Giter Club logo

projectdiscovery / nuclei Goto Github PK

View Code? Open in Web Editor NEW
17.3K 215.0 2.2K 27.33 MB

Fast and customizable vulnerability scanner based on simple YAML based DSL.

Home Page: https://docs.projectdiscovery.io/tools/nuclei

License: MIT License

Go 96.22% Dockerfile 0.01% Shell 0.23% Makefile 0.10% Smarty 0.11% Python 0.01% JavaScript 0.29% TypeScript 3.02%
cve-scanner subdomain-takeover nuclei-engine vulnerability-detection vulnerability-assessment vulnerability-scanner security attack-surface security-scanner hacktoberfest

nuclei's Introduction


Nuclei

Fast and customisable vulnerability scanner based on simple YAML based DSL.

HowInstallDocumentationCreditsFAQsJoin Discord

English中文KoreanIndonesia


Nuclei is used to send requests across targets based on a template, leading to zero false positives and providing fast scanning on a large number of hosts. Nuclei offers scanning for a variety of protocols, including TCP, DNS, HTTP, SSL, File, Whois, Websocket, Headless, Code etc. With powerful and flexible templating, Nuclei can be used to model all kinds of security checks.

We have a dedicated repository that houses various type of vulnerability templates contributed by more than 300 security researchers and engineers.

How it works

nuclei-flow

Disclaimer
This project is in active development. Expect breaking changes with releases. Review the release changelog before updating.
This project was primarily built to be used as a standalone CLI tool. Running nuclei as a service may pose security risks. It's recommended to use with caution and additional security measures.

Install Nuclei

Nuclei requires go1.21 to install successfully. Run the following command to install the latest version -

go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
Brew
brew install nuclei
Docker
docker pull projectdiscovery/nuclei:latest

More installation methods can be found here.

Nuclei Templates

Nuclei has built-in support for automatic template download/update as default since version v2.5.2. Nuclei-Templates project provides a community-contributed list of ready-to-use templates that is constantly updated.

You may still use the update-templates flag to update the nuclei templates at any time; You can write your own checks for your individual workflow and needs following Nuclei's templating guide.

The YAML DSL reference syntax is available here.

Usage

nuclei -h

This will display help for the tool. Here are all the switches it supports.

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[]          target URLs/hosts to scan
   -l, -list string              path to file containing a list of target URLs/hosts to scan (one per line)
   -eh, -exclude-hosts string[]  hosts to exclude to scan from the input list (ip, cidr, hostname)
   -resume string                resume scan using resume.cfg (clustering will be disabled)
   -sa, -scan-all-ips            scan all the IP's associated with dns record
   -iv, -ip-version string[]     IP version to scan of hostname (4,6) - (default 4)

TARGET-FORMAT:
   -im, -input-mode string        mode of input file (list, burp, jsonl, yaml, openapi, swagger) (default "list")
   -ro, -required-only            use only required fields in input format when generating requests
   -sfv, -skip-format-validation  skip format validation (like missing vars) when parsing input file

TEMPLATES:
   -nt, -new-templates                    run only new templates added in latest nuclei-templates release
   -ntv, -new-templates-version string[]  run new templates added in specific version
   -as, -automatic-scan                   automatic web scan using wappalyzer technology detection to tags mapping
   -t, -templates string[]                list of template or template directory to run (comma-separated, file)
   -turl, -template-url string[]          template url or list containing template urls to run (comma-separated, file)
   -w, -workflows string[]                list of workflow or workflow directory to run (comma-separated, file)
   -wurl, -workflow-url string[]          workflow url or list containing workflow urls to run (comma-separated, file)
   -validate                              validate the passed templates to nuclei
   -nss, -no-strict-syntax                disable strict syntax check on templates
   -td, -template-display                 displays the templates content
   -tl                                    list all available templates
   -sign                                  signs the templates with the private key defined in NUCLEI_SIGNATURE_PRIVATE_KEY env variable
   -code                                  enable loading code protocol-based templates
   -dut, -disable-unsigned-templates      disable running unsigned templates or templates with mismatched signature

FILTERING:
   -a, -author string[]               templates to run based on authors (comma-separated, file)
   -tags string[]                     templates to run based on tags (comma-separated, file)
   -etags, -exclude-tags string[]     templates to exclude based on tags (comma-separated, file)
   -itags, -include-tags string[]     tags to be executed even if they are excluded either by default or configuration
   -id, -template-id string[]         templates to run based on template ids (comma-separated, file, allow-wildcard)
   -eid, -exclude-id string[]         templates to exclude based on template ids (comma-separated, file)
   -it, -include-templates string[]   path to template file or directory to be executed even if they are excluded either by default or configuration
   -et, -exclude-templates string[]   path to template file or directory to exclude (comma-separated, file)
   -em, -exclude-matchers string[]    template matchers to exclude in result
   -s, -severity value[]              templates to run based on severity. Possible values: info, low, medium, high, critical, unknown
   -es, -exclude-severity value[]     templates to exclude based on severity. Possible values: info, low, medium, high, critical, unknown
   -pt, -type value[]                 templates to run based on protocol type. Possible values: dns, file, http, headless, tcp, workflow, ssl, websocket, whois, code, javascript
   -ept, -exclude-type value[]        templates to exclude based on protocol type. Possible values: dns, file, http, headless, tcp, workflow, ssl, websocket, whois, code, javascript
   -tc, -template-condition string[]  templates to run based on expression condition

OUTPUT:
   -o, -output string            output file to write found issues/vulnerabilities
   -sresp, -store-resp           store all request/response passed through nuclei to output directory
   -srd, -store-resp-dir string  store all request/response passed through nuclei to custom directory (default "output")
   -silent                       display findings only
   -nc, -no-color                disable output content coloring (ANSI escape codes)
   -j, -jsonl                    write output in JSONL(ines) format
   -irr, -include-rr -omit-raw   include request/response pairs in the JSON, JSONL, and Markdown outputs (for findings only) [DEPRECATED use -omit-raw] (default true)
   -or, -omit-raw                omit request/response pairs in the JSON, JSONL, and Markdown outputs (for findings only)
   -ot, -omit-template           omit encoded template in the JSON, JSONL output
   -nm, -no-meta                 disable printing result metadata in cli output
   -ts, -timestamp               enables printing timestamp in cli output
   -rdb, -report-db string       nuclei reporting database (always use this to persist report data)
   -ms, -matcher-status          display match failure status
   -me, -markdown-export string  directory to export results in markdown format
   -se, -sarif-export string     file to export results in SARIF format
   -je, -json-export string      file to export results in JSON format
   -jle, -jsonl-export string    file to export results in JSONL(ine) format

CONFIGURATIONS:
   -config string                        path to the nuclei configuration file
   -fr, -follow-redirects                enable following redirects for http templates
   -fhr, -follow-host-redirects          follow redirects on the same host
   -mr, -max-redirects int               max number of redirects to follow for http templates (default 10)
   -dr, -disable-redirects               disable redirects for http templates
   -rc, -report-config string            nuclei reporting module configuration file
   -H, -header string[]                  custom header/cookie to include in all http request in header:value format (cli, file)
   -V, -var value                        custom vars in key=value format
   -r, -resolvers string                 file containing resolver list for nuclei
   -sr, -system-resolvers                use system DNS resolving as error fallback
   -dc, -disable-clustering              disable clustering of requests
   -passive                              enable passive HTTP response processing mode
   -fh2, -force-http2                    force http2 connection on requests
   -ev, -env-vars                        enable environment variables to be used in template
   -cc, -client-cert string              client certificate file (PEM-encoded) used for authenticating against scanned hosts
   -ck, -client-key string               client key file (PEM-encoded) used for authenticating against scanned hosts
   -ca, -client-ca string                client certificate authority file (PEM-encoded) used for authenticating against scanned hosts
   -sml, -show-match-line                show match lines for file templates, works with extractors only
   -ztls                                 use ztls library with autofallback to standard one for tls13 [Deprecated] autofallback to ztls is enabled by default
   -sni string                           tls sni hostname to use (default: input domain name)
   -dt, -dialer-timeout value            timeout for network requests.
   -dka, -dialer-keep-alive value        keep-alive duration for network requests.
   -lfa, -allow-local-file-access        allows file (payload) access anywhere on the system
   -lna, -restrict-local-network-access  blocks connections to the local / private network
   -i, -interface string                 network interface to use for network scan
   -at, -attack-type string              type of payload combinations to perform (batteringram,pitchfork,clusterbomb)
   -sip, -source-ip string               source ip address to use for network scan
   -rsr, -response-size-read int         max response size to read in bytes (default 10485760)
   -rss, -response-size-save int         max response size to read in bytes (default 1048576)
   -reset                                reset removes all nuclei configuration and data files (including nuclei-templates)
   -tlsi, -tls-impersonate               enable experimental client hello (ja3) tls randomization

INTERACTSH:
   -iserver, -interactsh-server string  interactsh server url for self-hosted instance (default: oast.pro,oast.live,oast.site,oast.online,oast.fun,oast.me)
   -itoken, -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)
   -ni, -no-interactsh                  disable interactsh server for OAST testing, exclude OAST based templates

FUZZING:
   -ft, -fuzzing-type string  overrides fuzzing type set in template (replace, prefix, postfix, infix)
   -fm, -fuzzing-mode string  overrides fuzzing mode set in template (multiple, single)
   -fuzz                      enable loading fuzzing templates (Deprecated: use -dast instead)
   -dast                      only run DAST templates

UNCOVER:
   -uc, -uncover                  enable uncover engine
   -uq, -uncover-query string[]   uncover search query
   -ue, -uncover-engine string[]  uncover search engine (shodan,censys,fofa,shodan-idb,quake,hunter,zoomeye,netlas,criminalip,publicwww,hunterhow) (default shodan)
   -uf, -uncover-field string     uncover fields to return (ip,port,host) (default "ip:port")
   -ul, -uncover-limit int        uncover results to return (default 100)
   -ur, -uncover-ratelimit int    override ratelimit of engines with unknown ratelimit (default 60 req/min) (default 60)

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 25)
   -hbs, -headless-bulk-size int      maximum number of headless hosts to be analyzed in parallel per template (default 10)
   -headc, -headless-concurrency int  maximum number of headless templates to be executed in parallel (default 10)
   -jsc, -js-concurrency int          maximum number of javascript runtimes to be executed in parallel (default 120)
   -pc, -payload-concurrency int      max payload concurrency for each template (default 25)

OPTIMIZATIONS:
   -timeout int                     time to wait in seconds before timeout (default 10)
   -retries int                     number of times to retry a failed request (default 1)
   -ldp, -leave-default-ports       leave default HTTP/HTTPS ports (eg. host:80,host:443)
   -mhe, -max-host-error int        max errors for a host before skipping from scan (default 30)
   -te, -track-error string[]       adds given error to max-host-error watchlist (standard, file)
   -nmhe, -no-mhe                   disable skipping host from scan based on errors
   -project                         use a project folder to avoid sending same request multiple times
   -project-path string             set a specific project path (default "/tmp")
   -spm, -stop-at-first-match       stop processing HTTP requests after the first match (may break template/workflow logic)
   -stream                          stream mode - start elaborating without sorting the input
   -ss, -scan-strategy value        strategy to use while scanning(auto/host-spray/template-spray) (default auto)
   -irt, -input-read-timeout value  timeout on input read (default 3m0s)
   -nh, -no-httpx                   disable httpx probing for non-url input
   -no-stdin                        disable stdin processing

HEADLESS:
   -headless                        enable templates that require headless browser support (root user on Linux will disable sandbox)
   -page-timeout int                seconds to wait for each page in headless mode (default 20)
   -sb, -show-browser               show the browser on the screen when running templates with headless mode
   -ho, -headless-options string[]  start headless chrome with additional options
   -sc, -system-chrome              use local installed Chrome browser instead of nuclei installed
   -lha, -list-headless-action      list available headless actions

DEBUG:
   -debug                    show all requests and responses
   -dreq, -debug-req         show all sent requests
   -dresp, -debug-resp       show all received responses
   -p, -proxy string[]       list of http/socks5 proxy to use (comma separated or file input)
   -pi, -proxy-internal      proxy all internal requests
   -ldf, -list-dsl-function  list all supported DSL function signatures
   -tlog, -trace-log string  file to write sent requests trace log
   -elog, -error-log string  file to write sent requests error log
   -version                  show nuclei version
   -hm, -hang-monitor        enable nuclei hang monitoring
   -v, -verbose              show verbose output
   -profile-mem string       optional nuclei memory profile dump file
   -vv                       display templates loaded for scan
   -svd, -show-var-dump      show variables dump for debugging
   -ep, -enable-pprof        enable pprof debugging server
   -tv, -templates-version   shows the version of the installed nuclei-templates
   -hc, -health-check        run diagnostic check up

UPDATE:
   -up, -update                      update nuclei engine to the latest released version
   -ut, -update-templates            update nuclei-templates to latest released version
   -ud, -update-template-dir string  custom directory to install / update nuclei-templates
   -duc, -disable-update-check       disable automatic nuclei/templates update check

STATISTICS:
   -stats                    display statistics about the running scan
   -sj, -stats-json          display statistics in JSONL(ines) format
   -si, -stats-interval int  number of seconds to wait between showing a statistics update (default 5)
   -mp, -metrics-port int    port to expose nuclei metrics on (default 9092)

CLOUD:
   -auth                  configure projectdiscovery cloud (pdcp) api key
   -cup, -cloud-upload    upload scan results to pdcp dashboard
   -sid, -scan-id string  upload scan results to given scan id

AUTHENTICATION:
   -sf, -secret-file string[]  path to config file containing secrets for nuclei authenticated scan
   -ps, -prefetch-secrets      prefetch secrets from the secrets file


EXAMPLES:
Run nuclei on single host:
   $ nuclei -target example.com

Run nuclei with specific template directories:
   $ nuclei -target example.com -t http/cves/ -t ssl

Run nuclei against a list of hosts:
   $ nuclei -list hosts.txt

Run nuclei with a JSON output:
   $ nuclei -target example.com -json-export output.json

Run nuclei with sorted Markdown outputs (with environment variables):
   $ MARKDOWN_EXPORT_SORT_MODE=template nuclei -target example.com -markdown-export nuclei_report/

Additional documentation is available at: https://docs.nuclei.sh/getting-started/running

Running Nuclei

See https://docs.projectdiscovery.io/tools/nuclei/running for details on running Nuclei

Using Nuclei From Go Code

Complete guide of using Nuclei as Library/SDK is available at godoc

Resources

You can access the main documentation for Nuclei at https://docs.projectdiscovery.io/tools/nuclei/, and learn more about Nuclei in the cloud with ProjectDiscovery Cloud Platform

See https://docs.projectdiscovery.io/tools/nuclei/resources for more resources and videos about Nuclei!

Credits

Thanks to all the amazing community contributors for sending PRs and keeping this project updated. ❤️

If you have an idea or some kind of improvement, you are welcome to contribute and participate in the Project, feel free to send your PR.

Do also check out the below similar open-source projects that may fit in your workflow:

FFuF, Qsfuzz, Inception, Snallygaster, Gofingerprint, Sn1per, Google tsunami, Jaeles, ChopChop

License

Nuclei is distributed under MIT License

Join Discord Check Nuclei Documentation

nuclei's People

Contributors

5amu avatar actions-user avatar ankh2054 avatar caspergn avatar dependabot[bot] avatar dogancanbakir avatar dwisiswant0 avatar ehrishirajsharma avatar ehsandeep avatar forgedhallpass avatar geeknik avatar ice3man543 avatar jdk2588 avatar kaulse avatar kchason avatar luitelsamikshya avatar manuelbua avatar mzack9999 avatar nishan8583 avatar parrasajad avatar pmareke avatar ramanareddy0m avatar shubhamrasal avatar sullo avatar tarunkoyalwar avatar terminalfi avatar vzamanillo avatar wdahlenburg avatar xm1k3 avatar zerodivisi0n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nuclei's Issues

BUG - Nuclei doesn't follow redirect like HTTP 301/302

Hello,

Is there any way to force nuclei to follow redirect? I came across the following cases recently where a nuclei template didn't trigger because nuclei stopped at the redirect.

  • 301 Moved Permanently
  • 302 Found

You will find below a simple example of these kind of redirect:

GET / HTTP/1.1
> Host: www.useless.domain
> User-Agent: curl/7.68.0
> Accept: */*

< HTTP/1.1 301 Moved Permanently
< Date: Mon, 13 Apr 2020 12:58:41 GMT
< Content-Type: text/html
< Location: https://interesting.host.domain/some/where
< Set-Cookie: some=cookie; path=/; HttpOnly; Secure
[...]
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html

The only mention of a redirect I found in the source code is the following

CheckRedirect: func(_ *http.Request, _ []*http.Request) error {

return http.ErrUseLastResponse

ErrUseLastResponse can be returned by Client.CheckRedirect hooks to control how redirects are processed. If returned, the next request is not sent and the most recent response is returned with its body unclosed. - https://golang.org/pkg/net/http/

Based on the docs, the redirected request is not sent.

This "feature" could be a great addition. Furthermore this request can be linked to #10 (Added conditional redirects following or not following based on template config)

Thank you

Allow dynamic variables on headers {{BaseURL}} and {{Hostname}}

Allow using dynamic variables into headers is very usefull.

For example, if i need to set a different "Referer" header to ech request, will be very nice have the option to setup into the template something like:

id: issue-headers

info:
  name: Example for issue
  author: Zeokat
  severity: low

requests:
  - method: GET
    path:
      - "{{BaseURL}}/test.php"
    headers:
       Referer: "{{BaseURL}}"
    matchers:
      - type: word
        words:
            - "application/json"
        part: header

Hope you can improve this.

Thanks.

Multiple requests per template

Multiple requests per template

Following up on first attempt of dirty fix: #35

This is a regression introduced by 2c58a33. It used to work even though it had not been really heavily used looking at the variety of open source templates at the moment.

A good use case for this is CORS check: projectdiscovery/nuclei-templates#49.

@Ice3man543 could you elaborate a bit on what you mean by "supporting chained requests is something that will break how things are done the way it's implemented" ?

Errors while running it on VPS

Works perfectly fine locally but trying it on a VPS with any template give an Error stating: context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Unsupported protocol scheme

Summary

Thank you for the tool <3

Issue

I have created my own config to detect url upload

id: Url Upload

info:
   name: Url Upload Detection
   author: sicksec
   severity: info


requests:
   - method: GET
     path:
        - "{{Baseurl}}"
     matchers:
        - type: regex
          part: body
          regex:
            - "\u003cinput[^\u003e]+type=[\"']?file[\"']?"
     extractors:
        - type: regex
          part: body
          regex:
            - "\u003cinput[^\u003e]+type=[\"']?file[\"']?"

Expected Behaviour

Send a get request and check if regex exists

Behaviour

issue123123

What I did ?

Tried with list of urls that are resolved and start with https:// and http://
Also tried it against url without scheme https nor http
Same thing

Config

WSL2
Linux DESKTOP-75EI56B 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
go version go1.14 linux/amd64
GO111MODULE=on

Directory style support for the templates

This is already supported for now in the following manner.

nuclei -t "path/*.yaml"

this issue for an update that allows passing directory name and nuclei will look for all the *.yaml files in the same directory without breaking the current format, which will be as follows:-

nuclei -t nuclei-templates/cves/ -l targets.txt

Hackvertor - tag-based conversion markers

I think it would be cool to have the chance to add tag converters within the request just like in burp Hackvertor, so that the payload could be manipulated at runtime. Eg:

id: test

info:
  name: test
  author: test
  severity: bla
  
requests:
  - method: POST
    path:
      - "{{BaseURL}}/just/another/path"
    headers:
      Content-Type: application/json
    body: '{"username":"user1","password":"<sha256>test</sha256>", "base64field":"<base64>This is a field that needs to be encoded</base64>"}'
    matchers:
      - type: word
        words:
          - 'ok'
      - type: status
        status:
          - 200

I suggest to use:

  • <tag> value </tag>: eg. <base64>test</base64>
  • tag(value): base64(test)

Accep-Encoding decompression fails

By default Nuclei adds automatically the header Accept-Encoding: gzip and it works good. But... If the user adds the Accept-Encoding: gzip header manually to the template, it stops to work.

To reproduce the bug, you only have to add that header to a template and you will see that matchers seems that stop working.

requests:
  - method: GET
    path:
      - "{{BaseURL}}"
    headers:
       User-Agent: "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0"
       Referer: "{{Hostname}}"
       Accept-Language: "en-US"
       Accept-Encoding: gzip
    matchers:
      - type: word
        words:
            - "Lunar"
        part: body

I can confirm that adding Accept-Encoding: deflate works good, i can add this header and body response is decompressed correctly.

And to finish, i already expected that Nuclei doesn't support Brotli compression, thats why the header Accept-Encoding: br doesn't wok in websites that have brotli compression enabled. Maybe it can be added, don't know if exists a Go library to handle Brotli compression.

Display the "match" for a regex

Thank you for the great tool, I was tinkering with the templates and I found out there is no way to extract a pattern matched via regex.

This would be a great feature as you can create a template to match for hardcoded API Keys such as AWS.

Here is a simple example.

id: aws-apikey

info:
  name: Hardcoded AWS Access Key 
  author: Swissky
  severity: medium

requests:
  - method: GET
    path:
      - "{{BaseURL}}/"
    matchers:
      - type: regex
        part: body
        regex:
          - "(A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}"

However this would generate a massive rewrite of the match.go since it is not build with that feature in mind and all the functions return boolean.

Support for DNS queries

It would be nice and super useful to support DNS queries the way we do for HTTP requests.

Usecase:-

  • Fingerprinting DNS based subdomain takeovers.
  • Fingerprinting services based on CNAMES

Add header suppression in templates

Hi,

Thanks for this great tool, have enjoyed using it so far.

I wanted to suggest a feature where you could suppress some headers in a template, in the same way you could suppress for example the 'Host:' header in curl by specifying an empty header. This is handy in some research scenarios.

In addition, it would be great if there was a way to also specify more parts of the request in general via the templates, such as the HTTP version.

Cheers

Negative matching in matchers

For example, I'm looking for the page with The specified bucket does not exist in the body and not X-GUploader-UploadID in the response header to make sure it's not from Google storage bucket.

here is an example of how this can be used:-

      - type: word
        words:
          - "The specified bucket does not exist"

      - type: word
        words:
          - "X-GUploader-UploadID"
        part: header
        negative: true

Auto-configure option for templates

If I'd like to look for paths that exist, but I'm not sure what's going to be there, it's almost impossible to write a template for that case. For example, if I want to write a test interesting path locations such as /admin, /api, /upload, I don't know what to look for in the response. It could vary from site to site.

What I'm proposing is an option in the template file to auto-configure the response matching per host. How this could work is by requesting non-existent paths on each host to know what the response would look like, then use that to determine if your paths are interesting or not. This is much like the -ac option for ffuf.

I'm happy to help with this, but haven't written very much Go. I might take a shot at it this weekend.

Windows prebuilt binary doesn't work and no compilation instruction

I tested the prebuilt binary into my Windows 7 x64 machine and the binary doesn't work.

It return an error saying that thiue version of the program isn't compatible with my Windows version.

So, Nuclei doesn't support Windows?

I also want to add, that have compilation instructions will be nice.

Don't save empty result

Can you add options if there are no results with the matchers condition, then the output will not be saved (even if there is a -o flag)?

Thanks.

stdin does not work for multiple templates at once

This issue has been reported to us on social media.

Issue:- in the below example, nuclei only runs for the 1st template in the directory instead of all.

root@b0x:~/nuclei-templates# cat test.txt | nuclei -t "technologies/*.yaml" 

                       __     _ 
     ____  __  _______/ /__  (_)
    / __ \/ / / / ___/ / _ \/ / 
   / / / / /_/ / /__/ /  __/ /  
  /_/ /_/\__,_/\___/_/\___/_/   v1									  

		projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[INF] [citrix-vpn-detect] Loaded template Citrix VPN Detection (@bauthard) [low]
[INF] [Github-Enterprise-Detect] Loaded template Detect Github Enterprise (@ehsahil) [low]
[INF] [Gitlab-Detect] Loaded template Detect Gitlab (@ehsahil) [low]
[INF] [graphql] Loaded template GraphQL API (@NkxxkN) [low]
[INF] [jenkins-headers-detect] Loaded template Jenkins Headers Based Detection (@ice3man) [low]
[INF] [jira-detect] Loaded template Detect Jira Issue Management Software (@bauthard) [low]
[INF] [ntlm-directories] Loaded template Discovering directories w/ NTLM (@puzzlepeaches) [low]
[INF] [s3-detect] Loaded template Detect Amazon-S3 Bucket (@melbadry9) [low]
[INF] [sql-server-reporting] Loaded template Detect Microsoft SQL Server Reporting (@puzzlepeaches) [low]
[INF] [WebLogic-Detect] Loaded template Detect Weblogic (@bing0o) [low]

A few template errors

Upon re-pulling this am. While there were less errors then yesterday a few still remain.

[INF] [cve-2019-19781] Loaded template Citrix ADC Directory Traversal (@organiccrap) [high]
[ERR] Could not parse template file '/home/nick/nuclei-templates/CVE-2019-19908.yaml': yaml: line 11: did not find expected comment or line break

[INF] [CVE-2020-8115] Loaded template Revive Adserver XSS (@madrobot) [medium]
[ERR] Could not parse template file '/home/nick/nuclei-templates/amazon-mws-auth-token-value.yaml': yaml: line 16: found unknown escape character

[ERR] Could not parse template file '/home/nick/nuclei-templates/CVE-2018-14728.yaml': yaml: unmarshal errors:
line 13: cannot unmarshal !!seq into string

[INF] [cve-2019-19781] Loaded template Citrix ADC Directory Traversal (@organiccrap) [high]
[ERR] Could not parse template file '/home/nick/nuclei-templates/CVE-2019-19908.yaml': yaml: line 11: did not find expected comment or line break

I thought just lumping together in one issue would be best as they are each just small formatting issues.

Issue with Scanning.

ec2-user@kali:~$ cat hackerone.txt
https://mta-sts.forwarding.hackerone.com
https://mta-sts.managed.hackerone.com
https://docs.hackerone.com
https://mta-sts.hackerone.com
https://hackerone.com
https://www.hackerone.com
https://api.hackerone.com
https://support.hackerone.com
https://hackerone.com
https://hackerone.com
https://api.hackerone.com
https://www.hackerone.com
https://www.hackerone.com
https://www.hackerone.com
https://api.hackerone.com
https://hackerone.com
https://hackerone.com
ec2-user@kali:~$ cat hackerone.txt | nuclei -t ~/nuclei-templates/cves/*.yaml -v

                       __     _
     ____  __  _______/ /__  (_)
    / __ \/ / / / ___/ / _ \/ /
   / / / / /_/ / /__/ /  __/ /
  /_/ /_/\__,_/\___/_/\___/_/   v1

                projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[INF] [jira-cve-2017-9506] Loaded template Jira IconURIServlet SSRF (@Ice3man) [high]
ec2-user@kali:~$

when used the -l option

ec2-user@kali:~$ nuclei -t ~/nuclei-templates/cves/*.yaml -l ~/hackerone.txt

                       __     _
     ____  __  _______/ /__  (_)
    / __ \/ / / / ___/ / _ \/ /
   / / / / /_/ / /__/ /  __/ /
  /_/ /_/\__,_/\___/_/\___/_/   v1

                projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[FTL] Program exiting: no target input provided

Am i doing Something Wrong here?

Ouput results shows only found results

There is a bug showing output results, and Nuclei only shows found results, even when we don't use -silent.

I know that the switch -silent is designed to show only found results, but seems that this switch is always active because the output never shows full results.

It was reported at #65 (comment) and seems that the bug is present for all.

Hope you can fix this.

Matcher with binary rule capability

Note that this issue is following the PR #31.

Context

I thought that a matcher with binary rule capability could be interesting like Yara rules.
It's useful to match binary files such as archives.
In fact, the need to develop a dedicated matcher comes from the native utf-8 encoding from Golang.
I wanted to bypass the issue that I can't match characters such a: \x8a because Golang automatically handles it as \xc2\x8a.

So finally, after contribution #31, you can now invoke a binary matcher to handle hexadecimal rules.

usage

matchers:
      - type: binary
        binary:
        - "504B0304" # zip
        - "425A68" # bz2
        condition: or
        part: body

Error while running windows executable file

OS: windows 10 64-bit
Error: This version of C:\Users\malav\nuclei\nuclei-windows-amd64.exe is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.
nuclei_error

Add Support for Query String/Parameter Templating

It would be awesome to have query string support in your fuzzing templates, similar to https://github.com/ameenmaali/qsfuzz. For example, the template would look like:

requests:
  - method: GET
    path:
      - "{{BaseURL}}"
    parameters:
      - key1=value1
      - key2=value2
    matchers:
      - type: word
        words:
          - "Vulnerable"

Nuclei would then look for key in BaseURL and replace its value with value1. If key doesn't exist, it'll append it to the URL. There also needs to be some logic to check if the URL already has other query strings, in which case key will be appended as &key1=value1 instead of ?key1=value1.

Finally, there will need to be additional support for the POST equivalent as well as possibly other types of encodings multipart/form-data, application/x-www-form-urlencoded, application/json.

I understand this is a big ask and would be happy to contribute!

Error while using DNS request

  • Template used
id: cname-service-detector

info:
  name: 3rd party service checker
  author: bauthard
  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"

      - type: word
        name: elastic
        words:
          - "elasticbeanstalk.com"
  • Error
                       __     _ 
     ____  __  _______/ /__  (_)
    / __ \/ / / / ___/ / _ \/ / 
   / / / / /_/ / /__/ /  __/ /  
  /_/ /_/\__,_/\___/_/\___/_/   v1
                projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[INF] [cname-service-detector] Loaded template 3rd party service checker (@bauthard) [info]
[cname-service-detector:github] [dns] test.melbadry9.com
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x72fd10]

goroutine 50 [running]:
sync.(*Mutex).Lock(...)
        /root/sdk/go1.13.4/src/sync/mutex.go:74
github.com/projectdiscovery/nuclei/pkg/executor.(*DNSExecutor).writeOutputDNS(0xc0001d17d0, 0xc0001b9620, 0x1b, 0xc00020a0f0, 0x0, 0x0, 0x0)
        /root/go/src/github.com/projectdiscovery/nuclei/pkg/executor/output_dns.go:41 +0x5f0
github.com/projectdiscovery/nuclei/pkg/executor.(*DNSExecutor).ExecuteDNS(0xc0001d17d0, 0xc0001b9620, 0x1b, 0x0, 0x0)
        /root/go/src/github.com/projectdiscovery/nuclei/pkg/executor/executor_dns.go:87 +0x1c7
github.com/projectdiscovery/nuclei/internal/runner.(*Runner).processTemplateWithList.func1(0xc0000102d0, 0xc0001b9620, 0x1b, 0xc0000102d8, 0xc000070960, 0xc0001cf140, 0xc0001b9620, 0x1b)
        /root/go/src/github.com/projectdiscovery/nuclei/internal/runner/runner.go:188 +0x103
created by github.com/projectdiscovery/nuclei/internal/runner.(*Runner).processTemplateWithList
        /root/go/src/github.com/projectdiscovery/nuclei/internal/runner/runner.go:181 +0x469

Question about encodings supported?

By default Nuclei adds the header Accept-Encoding: gzip and I can overwrite this with other alternatives:
Accept-Encoding: deflate
Accept-Encoding: br
Accept-Encoding: gzip, deflate, br

My question is: ¿Is the body's HTTP response correctly decompresed when i use deflate or br (brotli)?

Thanks.

Error with multiple templates

Hello!
I tried to run nuclei with multiple templates but got an error every time:

# ./nuclei -l urls.txt -t nuclei-templates/files/

                       __     _ 
     ____  __  _______/ /__  (_)
    / __ \/ / / / ___/ / _ \/ / 
   / / / / /_/ / /__/ /  __/ /  
  /_/ /_/\__,_/\___/_/\___/_/   v1									  

		projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[FTL] Could not run recognize template extension: nuclei-templates/files/

However, it works fine with a single template:

# ./nuclei -l urls.txt -t nuclei-templates/files/phpinfo.yaml 

                       __     _ 
     ____  __  _______/ /__  (_)
    / __ \/ / / / ___/ / _ \/ / 
   / / / / /_/ / /__/ /  __/ /  
  /_/ /_/\__,_/\___/_/\___/_/   v1									  

		projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[INF] [phpinfo-files] Loaded template phpinfo Disclosure (@bauthard) [low]

My OS:

# uname -a
Linux WinXP 5.4.0-29-generic #33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Implement Rule Engine

Proposal of adding a rule engine so that for example the following matchers taken from the docs:

matcher:
  # match the body word
  - type: word
   # some words we want to match
   words: 
     - "[core]"
     - "[config]"
   # both words must be found in the response body
   condition: and
   #  we want to match request body (default)
   part: body
matcher:
  # match the status codes
  - type: status
    # some status codes we want to match
    status:
      - 200
      - 302

could be expressed as:

matcher: ('core', 'config') in response.body or response.status_code in (200, 302)

Add debug logging option

Hi,

I've had a few instances recently where it seems that nuclei is not running as expected or it seems frozen. In those cases it's hard to pin point what's going on, even with the verbose option. This makes it tricky to create a new bug report and provide you with relevant information.

I would suggest to add an option to output debug logs to a file, which could improve the quality of bug reports you receive on github.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.