@@ -82,9 +82,9 @@ A brief overview of the methods is provided below -
82
82
83
83
For reference protocol requests implementations, one can look at the below packages -
84
84
85
- 1 . [ pkg/protocols/http] ( ./v2/ pkg/protocols/http )
86
- 2 . [ pkg/protocols/dns] ( ./v2/ pkg/protocols/dns )
87
- 3 . [ pkg/protocols/network] ( ./v2/ pkg/protocols/network )
85
+ 1 . [ pkg/protocols/http] ( ./pkg/protocols/http )
86
+ 2 . [ pkg/protocols/dns] ( ./pkg/protocols/dns )
87
+ 3 . [ pkg/protocols/network] ( ./pkg/protocols/network )
88
88
89
89
### Executer
90
90
@@ -189,9 +189,9 @@ Polling for interactions and server registration only starts when a template use
189
189
190
190
Next we arrive in the ` RunEnumeration ` function of the runner.
191
191
192
- ` HostErrorsCache ` is initialised which is used throughout the run of Nuclei enumeration to keep track of errors per host and skip further requests if the errors are greater than the provided threshold. The functionality for the error tracking cache is defined in [ hosterrorscache.go] ( https://github.com/projectdiscovery/nuclei/blob/main/v2/ pkg/protocols/common/hosterrorscache/hosterrorscache.go ) and is pretty simplistic in nature.
192
+ ` HostErrorsCache ` is initialised which is used throughout the run of Nuclei enumeration to keep track of errors per host and skip further requests if the errors are greater than the provided threshold. The functionality for the error tracking cache is defined in [ hosterrorscache.go] ( https://github.com/projectdiscovery/nuclei/blob/main/pkg/protocols/common/hosterrorscache/hosterrorscache.go ) and is pretty simplistic in nature.
193
193
194
- Next the ` WorkflowLoader ` is initialised which used to load workflows. It exists in ` v2/ pkg/parsers/workflow_loader.go`
194
+ Next the ` WorkflowLoader ` is initialised which used to load workflows. It exists in ` pkg/parsers/workflow_loader.go `
195
195
196
196
The loader is initialised moving forward which is responsible for Using Catalog, Passed Tags, Filters, Paths, etc. to return compiled ` Templates ` and ` Workflows ` .
197
197
@@ -387,15 +387,15 @@ Almost all of these protocols have boilerplate functions for which default imple
387
387
388
388
Step by step description of how to add a new protocol to Nuclei -
389
389
390
- 1 . Add the protocol implementation in ` pkg/protocols ` directory. If it's a small protocol with fewer options, considering adding it to the ` pkg/protocols/others ` directory. Add the enum for the new protocol to ` v2/ pkg/templates/types/types.go` .
390
+ 1 . Add the protocol implementation in ` pkg/protocols ` directory. If it's a small protocol with fewer options, considering adding it to the ` pkg/protocols/others ` directory. Add the enum for the new protocol to ` pkg/templates/types/types.go ` .
391
391
392
392
2 . Add the protocol request structure to the ` Template ` structure fields. This is done in ` pkg/templates/templates.go ` with the corresponding import line.
393
393
394
394
``` go
395
395
396
396
import (
397
397
...
398
- " github.com/projectdiscovery/nuclei/v2 /pkg/protocols/others/websocket"
398
+ " github.com/projectdiscovery/nuclei/v3 /pkg/protocols/others/websocket"
399
399
)
400
400
401
401
// Template is a YAML input file which defines all the requests and
@@ -479,52 +479,52 @@ $ go tool pprof -http=:8081 mem.pprof
479
479
480
480
## Project Structure
481
481
482
- - [ v2/ pkg/reporting] ( ./v2 /pkg/reporting ) - Reporting modules for nuclei.
483
- - [ v2/ pkg/reporting/exporters/sarif] ( ./v2 /pkg/reporting/exporters/sarif ) - Sarif Result Exporter
484
- - [ v2/ pkg/reporting/exporters/markdown] ( ./v2 /pkg/reporting/exporters/markdown ) - Markdown Result Exporter
485
- - [ v2/ pkg/reporting/exporters/es] ( ./v2 /pkg/reporting/exporters/es ) - Elasticsearch Result Exporter
486
- - [ v2/ pkg/reporting/dedupe] ( ./v2 /pkg/reporting/dedupe ) - Dedupe module for Results
487
- - [ v2/ pkg/reporting/trackers/gitlab] ( ./v2 /pkg/reporting/trackers/gitlab ) - GitLab Issue Tracker Exporter
488
- - [ v2/ pkg/reporting/trackers/jira] ( ./v2 /pkg/reporting/trackers/jira ) - Jira Issue Tracker Exporter
489
- - [ v2/ pkg/reporting/trackers/github] ( ./v2 /pkg/reporting/trackers/github ) - GitHub Issue Tracker Exporter
490
- - [ v2/ pkg/reporting/format] ( ./v2 /pkg/reporting/format ) - Result Formatting Functions
491
- - [ v2/ pkg/parsers] ( ./v2 /pkg/parsers ) - Implements template as well as workflow loader for initial template discovery, validation and - loading.
492
- - [ v2/ pkg/types] ( ./v2 /pkg/types ) - Contains CLI options as well as misc helper functions.
493
- - [ v2/ pkg/progress] ( ./v2 /pkg/progress ) - Progress tracking
494
- - [ v2/ pkg/operators] ( ./v2 /pkg/operators ) - Operators for Nuclei
495
- - [ v2/ pkg/operators/common/dsl] ( ./v2 /pkg/operators/common/dsl ) - DSL functions for Nuclei YAML Syntax
496
- - [ v2/ pkg/operators/matchers] ( ./v2 /pkg/operators/matchers ) - Matchers implementation
497
- - [ v2/ pkg/operators/extractors] ( ./v2 /pkg/operators/extractors ) - Extractors implementation
498
- - [ v2/ pkg/catalog] ( ./v2 /pkg/catalog ) - Template loading from disk helpers
499
- - [ v2/ pkg/catalog/config] ( ./v2 /pkg/catalog/config ) - Internal configuration management
500
- - [ v2/ pkg/catalog/loader] ( ./v2 /pkg/catalog/loader ) - Implements loading and validation of templates and workflows.
501
- - [ v2/ pkg/catalog/loader/filter] ( ./v2 /pkg/catalog/loader/filter ) - Filter filters templates based on tags and paths
502
- - [ v2/ pkg/output] ( ./v2 /pkg/output ) - Output module for nuclei
503
- - [ v2/ pkg/workflows] ( ./v2 /pkg/workflows ) - Workflow execution logic + declarations
504
- - [ v2/ pkg/utils] ( ./v2 /pkg/utils ) - Utility functions
505
- - [ v2/ pkg/model] ( ./v2 /pkg/model ) - Template Info + misc
506
- - [ v2/ pkg/templates] ( ./v2 /pkg/templates ) - Templates core starting point
507
- - [ v2/ pkg/templates/cache] ( ./v2 /pkg/templates/cache ) - Templates cache
508
- - [ v2/ pkg/protocols] ( ./v2 /pkg/protocols ) - Protocol Specification
509
- - [ v2/ pkg/protocols/file] ( ./v2 /pkg/protocols/file ) - File protocol
510
- - [ v2/ pkg/protocols/network] ( ./v2 /pkg/protocols/network ) - Network protocol
511
- - [ v2/ pkg/protocols/common/expressions] ( ./v2 /pkg/protocols/common/expressions ) - Expression evaluation + Templating Support
512
- - [ v2/ pkg/protocols/common/interactsh] ( ./v2 /pkg/protocols/common/interactsh ) - Interactsh integration
513
- - [ v2/ pkg/protocols/common/generators] ( ./v2 /pkg/protocols/common/generators ) - Payload support for Requests (Sniper, etc.)
514
- - [ v2/ pkg/protocols/common/executer] ( ./v2 /pkg/protocols/common/executer ) - Default Template Executer
515
- - [ v2/ pkg/protocols/common/replacer] ( ./v2 /pkg/protocols/common/replacer ) - Template replacement helpers
516
- - [ v2/ pkg/protocols/common/helpers/eventcreator] ( ./v2 /pkg/protocols/common/helpers/eventcreator ) - Result event creator
517
- - [ v2/ pkg/protocols/common/helpers/responsehighlighter] ( ./v2 /pkg/protocols/common/helpers/responsehighlighter ) - Debug response highlighter
518
- - [ v2/ pkg/protocols/common/helpers/deserialization] ( ./v2 /pkg/protocols/common/helpers/deserialization ) - Deserialization helper functions
519
- - [ v2/ pkg/protocols/common/hosterrorscache] ( ./v2 /pkg/protocols/common/hosterrorscache ) - Host errors cache for tracking erroring hosts
520
- - [ v2/ pkg/protocols/offlinehttp] ( ./v2 /pkg/protocols/offlinehttp ) - Offline http protocol
521
- - [ v2/ pkg/protocols/http] ( ./v2 /pkg/protocols/http ) - HTTP protocol
522
- - [ v2/ pkg/protocols/http/race] ( ./v2 /pkg/protocols/http/race ) - HTTP Race Module
523
- - [ v2/ pkg/protocols/http/raw] ( ./v2 /pkg/protocols/http/raw ) - HTTP Raw Request Support
524
- - [ v2/ pkg/protocols/headless] ( ./v2 /pkg/protocols/headless ) - Headless Module
525
- - [ v2/ pkg/protocols/headless/engine] ( ./v2 /pkg/protocols/headless/engine ) - Internal Headless implementation
526
- - [ v2/ pkg/protocols/dns] ( ./v2 /pkg/protocols/dns ) - DNS protocol
527
- - [ v2/ pkg/projectfile] ( ./v2 /pkg/projectfile ) - Project File Implementation
482
+ - [ pkg/reporting] ( ./pkg/reporting ) - Reporting modules for nuclei.
483
+ - [ pkg/reporting/exporters/sarif] ( ./pkg/reporting/exporters/sarif ) - Sarif Result Exporter
484
+ - [ pkg/reporting/exporters/markdown] ( ./pkg/reporting/exporters/markdown ) - Markdown Result Exporter
485
+ - [ pkg/reporting/exporters/es] ( ./pkg/reporting/exporters/es ) - Elasticsearch Result Exporter
486
+ - [ pkg/reporting/dedupe] ( ./pkg/reporting/dedupe ) - Dedupe module for Results
487
+ - [ pkg/reporting/trackers/gitlab] ( ./pkg/reporting/trackers/gitlab ) - GitLab Issue Tracker Exporter
488
+ - [ pkg/reporting/trackers/jira] ( ./pkg/reporting/trackers/jira ) - Jira Issue Tracker Exporter
489
+ - [ pkg/reporting/trackers/github] ( ./pkg/reporting/trackers/github ) - GitHub Issue Tracker Exporter
490
+ - [ pkg/reporting/format] ( ./pkg/reporting/format ) - Result Formatting Functions
491
+ - [ pkg/parsers] ( ./pkg/parsers ) - Implements template as well as workflow loader for initial template discovery, validation and - loading.
492
+ - [ pkg/types] ( ./pkg/types ) - Contains CLI options as well as misc helper functions.
493
+ - [ pkg/progress] ( ./pkg/progress ) - Progress tracking
494
+ - [ pkg/operators] ( ./pkg/operators ) - Operators for Nuclei
495
+ - [ pkg/operators/common/dsl] ( ./pkg/operators/common/dsl ) - DSL functions for Nuclei YAML Syntax
496
+ - [ pkg/operators/matchers] ( ./pkg/operators/matchers ) - Matchers implementation
497
+ - [ pkg/operators/extractors] ( ./pkg/operators/extractors ) - Extractors implementation
498
+ - [ pkg/catalog] ( ./pkg/catalog ) - Template loading from disk helpers
499
+ - [ pkg/catalog/config] ( ./pkg/catalog/config ) - Internal configuration management
500
+ - [ pkg/catalog/loader] ( ./pkg/catalog/loader ) - Implements loading and validation of templates and workflows.
501
+ - [ pkg/catalog/loader/filter] ( ./pkg/catalog/loader/filter ) - Filter filters templates based on tags and paths
502
+ - [ pkg/output] ( ./pkg/output ) - Output module for nuclei
503
+ - [ pkg/workflows] ( ./pkg/workflows ) - Workflow execution logic + declarations
504
+ - [ pkg/utils] ( ./pkg/utils ) - Utility functions
505
+ - [ pkg/model] ( ./pkg/model ) - Template Info + misc
506
+ - [ pkg/templates] ( ./pkg/templates ) - Templates core starting point
507
+ - [ pkg/templates/cache] ( ./pkg/templates/cache ) - Templates cache
508
+ - [ pkg/protocols] ( ./pkg/protocols ) - Protocol Specification
509
+ - [ pkg/protocols/file] ( ./pkg/protocols/file ) - File protocol
510
+ - [ pkg/protocols/network] ( ./pkg/protocols/network ) - Network protocol
511
+ - [ pkg/protocols/common/expressions] ( ./pkg/protocols/common/expressions ) - Expression evaluation + Templating Support
512
+ - [ pkg/protocols/common/interactsh] ( ./pkg/protocols/common/interactsh ) - Interactsh integration
513
+ - [ pkg/protocols/common/generators] ( ./pkg/protocols/common/generators ) - Payload support for Requests (Sniper, etc.)
514
+ - [ pkg/protocols/common/executer] ( ./pkg/protocols/common/executer ) - Default Template Executer
515
+ - [ pkg/protocols/common/replacer] ( ./pkg/protocols/common/replacer ) - Template replacement helpers
516
+ - [ pkg/protocols/common/helpers/eventcreator] ( ./pkg/protocols/common/helpers/eventcreator ) - Result event creator
517
+ - [ pkg/protocols/common/helpers/responsehighlighter] ( ./pkg/protocols/common/helpers/responsehighlighter ) - Debug response highlighter
518
+ - [ pkg/protocols/common/helpers/deserialization] ( ./pkg/protocols/common/helpers/deserialization ) - Deserialization helper functions
519
+ - [ pkg/protocols/common/hosterrorscache] ( ./pkg/protocols/common/hosterrorscache ) - Host errors cache for tracking erroring hosts
520
+ - [ pkg/protocols/offlinehttp] ( ./pkg/protocols/offlinehttp ) - Offline http protocol
521
+ - [ pkg/protocols/http] ( ./pkg/protocols/http ) - HTTP protocol
522
+ - [ pkg/protocols/http/race] ( ./pkg/protocols/http/race ) - HTTP Race Module
523
+ - [ pkg/protocols/http/raw] ( ./pkg/protocols/http/raw ) - HTTP Raw Request Support
524
+ - [ pkg/protocols/headless] ( ./pkg/protocols/headless ) - Headless Module
525
+ - [ pkg/protocols/headless/engine] ( ./pkg/protocols/headless/engine ) - Internal Headless implementation
526
+ - [ pkg/protocols/dns] ( ./pkg/protocols/dns ) - DNS protocol
527
+ - [ pkg/projectfile] ( ./pkg/projectfile ) - Project File Implementation
528
528
529
529
### Notes
530
530
0 commit comments