From 8db0276ba64fabf26e70c87ac715b5870d0b44f8 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 16 Mar 2023 18:19:31 +0000 Subject: [PATCH] Auto Generate Syntax Docs + JSONSchema [Thu Mar 16 18:19:31 UTC 2023] :robot: --- SYNTAX-REFERENCE.md | 1396 +---------------------------- nuclei-jsonschema.json | 13 +- v2/pkg/templates/templates_doc.go | 1168 +++++++----------------- 3 files changed, 338 insertions(+), 2239 deletions(-) diff --git a/SYNTAX-REFERENCE.md b/SYNTAX-REFERENCE.md index 4d34cd47e..87e38beff 100755 --- a/SYNTAX-REFERENCE.md +++ b/SYNTAX-REFERENCE.md @@ -262,19 +262,6 @@ WHOIS contains the WHOIS request to make in the template.
-workflows []workflows.WorkflowTemplate - -
-
- -Workflows is a list of workflows to execute for a template. - -
- -
- -
- self-contained bool
@@ -464,7 +451,7 @@ description: Subversion ALM for the enterprise before 8.8.2 allows reflected XSS
-reference stringslice.StringSlice +reference stringslice.RawStringSlice
@@ -579,16 +566,10 @@ Appears in: - model.Info.tags -- model.Info.reference - - model.Classification.cve-id - model.Classification.cwe-id -- workflows.WorkflowTemplate.tags - -- workflows.Matcher.name - ```yaml @@ -598,10 +579,6 @@ Appears in: cve,cve2019,grafana,auth-bypass,dos ``` ```yaml -- https://github.com/strapi/strapi -- https://github.com/getgrav/grav -``` -```yaml CVE-2020-14420 ``` ```yaml @@ -612,6 +589,23 @@ CWE-22 +## stringslice.RawStringSlice + +Appears in: + + +- model.Info.reference + + +```yaml +- https://github.com/strapi/strapi +- https://github.com/getgrav/grav +``` + + + + + ## severity.Holder Holder holds a Severity type. Required for un/marshalling purposes @@ -821,58 +815,6 @@ Part Definitions:
-matchers []matchers.Matcher - -
-
- -Matchers contains the detection mechanism for the request to identify -whether the request was successful by doing pattern matching -on request/responses. - -Multiple matchers can be combined with `matcher-condition` flag -which accepts either `and` or `or` as argument. - -
- -
- -
- -extractors []extractors.Extractor - -
-
- -Extractors contains the extraction mechanism for the request to identify -and extract parts of the response. - -
- -
- -
- -matchers-condition string - -
-
- -MatchersCondition is the condition between the matchers. Default is OR. - - -Valid values: - - - - and - - - or -
- -
- -
- path []string
@@ -1436,774 +1378,6 @@ DigestAuthPassword specifies the password for digest authentication -## matchers.Matcher -Matcher is used to match a part in the output from a protocol. - -Appears in: - - -- http.Request.matchers - -- dns.Request.matchers - -- file.Request.matchers - -- network.Request.matchers - -- headless.Request.matchers - -- ssl.Request.matchers - -- websocket.Request.matchers - -- whois.Request.matchers - - - - - -
- -
- -type MatcherTypeHolder - -
-
- -Type is the type of the matcher. - -
- -
- -
- -condition string - -
-
- -Condition is the optional condition between two matcher variables. By default, -the condition is assumed to be OR. - - -Valid values: - - - - and - - - or -
- -
- -
- -part string - -
-
- -Part is the part of the request response to match data from. - -Each protocol exposes a lot of different parts which are well -documented in docs for each request type. - - - -Examples: - - -```yaml -part: body -``` - -```yaml -part: raw -``` - - -
- -
- -
- -negative bool - -
-
- -Negative specifies if the match should be reversed -It will only match if the condition is not true. - -
- -
- -
- -name string - -
-
- -Name of the matcher. Name should be lowercase and must not contain -spaces or underscores (_). - - - -Examples: - - -```yaml -name: cookie-matcher -``` - - -
- -
- -
- -status []int - -
-
- -Status are the acceptable status codes for the response. - - - -Examples: - - -```yaml -status: - - 200 - - 302 -``` - - -
- -
- -
- -size []int - -
-
- -Size is the acceptable size for the response - - - -Examples: - - -```yaml -size: - - 3029 - - 2042 -``` - - -
- -
- -
- -words []string - -
-
- -Words contains word patterns required to be present in the response part. - - - -Examples: - - -```yaml -# Match for Outlook mail protection domain -words: - - mail.protection.outlook.com -``` - -```yaml -# Match for application/json in response headers -words: - - application/json -``` - - -
- -
- -
- -regex []string - -
-
- -Regex contains Regular Expression patterns required to be present in the response part. - - - -Examples: - - -```yaml -# Match for Linkerd Service via Regex -regex: - - (?mi)^Via\\s*?:.*?linkerd.*$ -``` - -```yaml -# Match for Open Redirect via Location header -regex: - - (?m)^(?:Location\\s*?:\\s*?)(?:https?://|//)?(?:[a-zA-Z0-9\\-_\\.@]*)example\\.com.*$ -``` - - -
- -
- -
- -binary []string - -
-
- -Binary are the binary patterns required to be present in the response part. - - - -Examples: - - -```yaml -# Match for Springboot Heapdump Actuator "JAVA PROFILE", "HPROF", "Gunzip magic byte" -binary: - - 4a4156412050524f46494c45 - - 4850524f46 - - 1f8b080000000000 -``` - -```yaml -# Match for 7zip files -binary: - - 377ABCAF271C -``` - - -
- -
- -
- -dsl []string - -
-
- -DSL are the dsl expressions that will be evaluated as part of nuclei matching rules. -A list of these helper functions are available [here](https://nuclei.projectdiscovery.io/templating-guide/helper-functions/). - - - -Examples: - - -```yaml -# DSL Matcher for package.json file -dsl: - - contains(body, 'packages') && contains(tolower(all_headers), 'application/octet-stream') && status_code == 200 -``` - -```yaml -# DSL Matcher for missing strict transport security header -dsl: - - '!contains(tolower(all_headers), ''''strict-transport-security'''')' -``` - - -
- -
- -
- -encoding string - -
-
- -Encoding specifies the encoding for the words field if any. - - -Valid values: - - - - hex -
- -
- -
- -case-insensitive bool - -
-
- -CaseInsensitive enables case-insensitive matches. Default is false. - - -Valid values: - - - - false - - - true -
- -
- -
- -match-all bool - -
-
- -MatchAll enables matching for all matcher values. Default is false. - - -Valid values: - - - - false - - - true -
- -
- - - - - -## MatcherTypeHolder -MatcherTypeHolder is used to hold internal type of the matcher - -Appears in: - - -- matchers.Matcher.type - - - - - -
- -
- - MatcherType - -
-
- - - - -Enum Values: - - - - word - - - regex - - - binary - - - status - - - size - - - dsl -
- -
- - - - - -## extractors.Extractor -Extractor is used to extract part of response using a regex. - -Appears in: - - -- http.Request.extractors - -- dns.Request.extractors - -- file.Request.extractors - -- network.Request.extractors - -- headless.Request.extractors - -- ssl.Request.extractors - -- websocket.Request.extractors - -- whois.Request.extractors - - - - - -
- -
- -name string - -
-
- -Name of the extractor. Name should be lowercase and must not contain -spaces or underscores (_). - - - -Examples: - - -```yaml -name: cookie-extractor -``` - - -
- -
- -
- -type ExtractorTypeHolder - -
-
- -Type is the type of the extractor. - -
- -
- -
- -regex []string - -
-
- -Regex contains the regular expression patterns to extract from a part. - -Go regex engine does not support lookaheads or lookbehinds, so as a result -they are also not supported in nuclei. - - - -Examples: - - -```yaml -# Braintree Access Token Regex -regex: - - access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32} -``` - -```yaml -# Wordpress Author Extraction regex -regex: - - Author:(?:[A-Za-z0-9 -\_="]+)? - -group int - -
-
- -Group specifies a numbered group to extract from the regex. - - - -Examples: - - -```yaml -# Example Regex Group -group: 1 -``` - - -
- -
- -
- -kval []string - -
-
- -description: | - kval contains the key-value pairs present in the HTTP response header. - kval extractor can be used to extract HTTP response header and cookie key-value pairs. - kval extractor inputs are case-insensitive, and does not support dash (-) in input which can replaced with underscores (_) - For example, Content-Type should be replaced with content_type - - A list of supported parts is available in docs for request types. - examples: - - name: Extract Server Header From HTTP Response - value: > - []string{"server"} - - name: Extracting value of PHPSESSID Cookie - value: > - []string{"phpsessid"} - - name: Extracting value of Content-Type Cookie - value: > - []string{"content_type"} - -
- -
- -
- -json []string - -
-
- -JSON allows using jq-style syntax to extract items from json response - - - -Examples: - - -```yaml -json: - - .[] | .id -``` - -```yaml -json: - - .batters | .batter | .[] | .id -``` - - -
- -
- -
- -xpath []string - -
-
- -XPath allows using xpath expressions to extract items from html response - - - -Examples: - - -```yaml -xpath: - - /html/body/div/p[2]/a -``` - - -
- -
- -
- -attribute string - -
-
- -Attribute is an optional attribute to extract from response XPath. - - - -Examples: - - -```yaml -attribute: href -``` - - -
- -
- -
- -dsl []string - -
-
- -Extracts using DSL expressions. - -
- -
- -
- -part string - -
-
- -Part is the part of the request response to extract data from. - -Each protocol exposes a lot of different parts which are well -documented in docs for each request type. - - - -Examples: - - -```yaml -part: body -``` - -```yaml -part: raw -``` - - -
- -
- -
- -internal bool - -
-
- -Internal, when set to true will allow using the value extracted -in the next request for some protocols (like HTTP). - -
- -
- -
- -case-insensitive bool - -
-
- -CaseInsensitive enables case-insensitive extractions. Default is false. - - -Valid values: - - - - false - - - true -
- -
- - - - - -## ExtractorTypeHolder -ExtractorTypeHolder is used to hold internal type of the extractor - -Appears in: - - -- extractors.Extractor.type - - - - - -
- -
- - ExtractorType - -
-
- - - - -Enum Values: - - - - regex - - - kval - - - xpath - - - json - - - dsl -
- -
- - - - - ## generators.AttackTypeHolder AttackTypeHolder is used to hold internal type of the protocol @@ -2555,58 +1729,6 @@ Part Definitions:
-matchers []matchers.Matcher - -
-
- -Matchers contains the detection mechanism for the request to identify -whether the request was successful by doing pattern matching -on request/responses. - -Multiple matchers can be combined with `matcher-condition` flag -which accepts either `and` or `or` as argument. - -
- -
- -
- -extractors []extractors.Extractor - -
-
- -Extractors contains the extraction mechanism for the request to identify -and extract parts of the response. - -
- -
- -
- -matchers-condition string - -
-
- -MatchersCondition is the condition between the matchers. Default is OR. - - -Valid values: - - - - and - - - or -
- -
- -
- id string
@@ -2868,58 +1990,6 @@ Part Definitions:
-matchers []matchers.Matcher - -
-
- -Matchers contains the detection mechanism for the request to identify -whether the request was successful by doing pattern matching -on request/responses. - -Multiple matchers can be combined with `matcher-condition` flag -which accepts either `and` or `or` as argument. - -
- -
- -
- -extractors []extractors.Extractor - -
-
- -Extractors contains the extraction mechanism for the request to identify -and extract parts of the response. - -
- -
- -
- -matchers-condition string - -
-
- -MatchersCondition is the condition between the matchers. Default is OR. - - -Valid values: - - - - and - - - or -
- -
- -
- extensions []string
@@ -3203,58 +2273,6 @@ read-all: false
-
- -matchers []matchers.Matcher - -
-
- -Matchers contains the detection mechanism for the request to identify -whether the request was successful by doing pattern matching -on request/responses. - -Multiple matchers can be combined with `matcher-condition` flag -which accepts either `and` or `or` as argument. - -
- -
- -
- -extractors []extractors.Extractor - -
-
- -Extractors contains the extraction mechanism for the request to identify -and extract parts of the response. - -
- -
- -
- -matchers-condition string - -
-
- -MatchersCondition is the condition between the matchers. Default is OR. - - -Valid values: - - - - and - - - or -
- -
- @@ -3541,58 +2559,6 @@ StopAtFirstMatch stops the execution of the requests and template as soon as a m
-
- -matchers []matchers.Matcher - -
-
- -Matchers contains the detection mechanism for the request to identify -whether the request was successful by doing pattern matching -on request/responses. - -Multiple matchers can be combined with `matcher-condition` flag -which accepts either `and` or `or` as argument. - -
- -
- -
- -extractors []extractors.Extractor - -
-
- -Extractors contains the extraction mechanism for the request to identify -and extract parts of the response. - -
- -
- -
- -matchers-condition string - -
-
- -MatchersCondition is the condition between the matchers. Default is OR. - - -Valid values: - - - - and - - - or -
- -
- @@ -3820,58 +2786,6 @@ Part Definitions:
-matchers []matchers.Matcher - -
-
- -Matchers contains the detection mechanism for the request to identify -whether the request was successful by doing pattern matching -on request/responses. - -Multiple matchers can be combined with `matcher-condition` flag -which accepts either `and` or `or` as argument. - -
- -
- -
- -extractors []extractors.Extractor - -
-
- -Extractors contains the extraction mechanism for the request to identify -and extract parts of the response. - -
- -
- -
- -matchers-condition string - -
-
- -MatchersCondition is the condition between the matchers. Default is OR. - - -Valid values: - - - - and - - - or -
- -
- -
- address string
@@ -3955,17 +2869,14 @@ Client Cipher Suites - auto if not specified.
-Tls Scan Mode - auto if not specified +description: | + Tls Scan Mode - auto if not specified + values: + - "ctls" + - "ztls" + - "auto" + - "openssl" # reverts to "auto" is openssl is not installed - -Valid values: - - - - ctls - - - ztls - - - auto

@@ -3998,58 +2909,6 @@ Part Definitions:
-matchers []matchers.Matcher - -
-
- -Matchers contains the detection mechanism for the request to identify -whether the request was successful by doing pattern matching -on request/responses. - -Multiple matchers can be combined with `matcher-condition` flag -which accepts either `and` or `or` as argument. - -
- -
- -
- -extractors []extractors.Extractor - -
-
- -Extractors contains the extraction mechanism for the request to identify -and extract parts of the response. - -
- -
- -
- -matchers-condition string - -
-
- -MatchersCondition is the condition between the matchers. Default is OR. - - -Valid values: - - - - and - - - or -
- -
- -
- address string
@@ -4205,58 +3064,6 @@ Appears in: -
- -
- -matchers []matchers.Matcher - -
-
- -Matchers contains the detection mechanism for the request to identify -whether the request was successful by doing pattern matching -on request/responses. - -Multiple matchers can be combined with `matcher-condition` flag -which accepts either `and` or `or` as argument. - -
- -
- -
- -extractors []extractors.Extractor - -
-
- -Extractors contains the extraction mechanism for the request to identify -and extract parts of the response. - -
- -
- -
- -matchers-condition string - -
-
- -MatchersCondition is the condition between the matchers. Default is OR. - - -Valid values: - - - - and - - - or -
-
@@ -4293,159 +3100,6 @@ description: | -## workflows.WorkflowTemplate - -Appears in: - - -- Template.workflows - -- workflows.WorkflowTemplate.subtemplates - -- workflows.Matcher.subtemplates - - - - - -
- -
- -template string - -
-
- -Template is a single template or directory to execute as part of workflow. - - - -Examples: - - -```yaml -# A single template -template: dns/worksites-detection.yaml -``` - -```yaml -# A template directory -template: misconfigurations/aem -``` - - -
- -
- - -
- -Tags to run templates based on. - -
- -
- -
- -matchers []workflows.Matcher - -
-
- -Matchers perform name based matching to run subtemplates for a workflow. - -
- -
- -
- -subtemplates []workflows.WorkflowTemplate - -
-
- -Subtemplates are run if the `template` field Template matches. - -
- -
- - - - - -## workflows.Matcher - -Appears in: - - -- workflows.WorkflowTemplate.matchers - - - - - -
- - -
- -Name is the name of the items to match. - -
- -
- -
- -condition string - -
-
- -Condition is the optional condition between names. By default, -the condition is assumed to be OR. - - -Valid values: - - - - and - - - or -
- -
- -
- -subtemplates []workflows.WorkflowTemplate - -
-
- -Subtemplates are run if the name of matcher matches. - -
- -
- - - - - ## http.SignatureTypeHolder SignatureTypeHolder is used to hold internal type of the signature diff --git a/nuclei-jsonschema.json b/nuclei-jsonschema.json index 1ea1b2297..97bcd7b87 100644 --- a/nuclei-jsonschema.json +++ b/nuclei-jsonschema.json @@ -61,7 +61,8 @@ ] }, "reference": { - "$ref": "#/definitions/stringslice.StringSlice", + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/stringslice.RawStringSlice", "title": "references for the template", "description": "Links relevant to the template" }, @@ -110,6 +111,16 @@ "title": "severity of the template", "description": "Seriousness of the implications of the template" }, + "stringslice.RawStringSlice": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array" + } + ] + }, "stringslice.StringSlice": { "oneOf": [ { diff --git a/v2/pkg/templates/templates_doc.go b/v2/pkg/templates/templates_doc.go index 441e5b7b4..f79e9f133 100644 --- a/v2/pkg/templates/templates_doc.go +++ b/v2/pkg/templates/templates_doc.go @@ -12,13 +12,10 @@ var ( TemplateDoc encoder.Doc MODELInfoDoc encoder.Doc STRINGSLICEStringSliceDoc encoder.Doc + STRINGSLICERawStringSliceDoc encoder.Doc SEVERITYHolderDoc encoder.Doc MODELClassificationDoc encoder.Doc HTTPRequestDoc encoder.Doc - MATCHERSMatcherDoc encoder.Doc - MatcherTypeHolderDoc encoder.Doc - EXTRACTORSExtractorDoc encoder.Doc - ExtractorTypeHolderDoc encoder.Doc GENERATORSAttackTypeHolderDoc encoder.Doc HTTPMethodTypeHolderDoc encoder.Doc FUZZRuleDoc encoder.Doc @@ -37,8 +34,6 @@ var ( WEBSOCKETRequestDoc encoder.Doc WEBSOCKETInputDoc encoder.Doc WHOISRequestDoc encoder.Doc - WORKFLOWSWorkflowTemplateDoc encoder.Doc - WORKFLOWSMatcherDoc encoder.Doc HTTPSignatureTypeHolderDoc encoder.Doc VARIABLESVariableDoc encoder.Doc ) @@ -47,7 +42,7 @@ func init() { TemplateDoc.Type = "Template" TemplateDoc.Comments[encoder.LineComment] = " Template is a YAML input file which defines all the requests and" TemplateDoc.Description = "Template is a YAML input file which defines all the requests and\n other metadata for a template." - TemplateDoc.Fields = make([]encoder.Doc, 15) + TemplateDoc.Fields = make([]encoder.Doc, 14) TemplateDoc.Fields[0].Name = "id" TemplateDoc.Fields[0].Type = "string" TemplateDoc.Fields[0].Note = "" @@ -110,34 +105,29 @@ func init() { TemplateDoc.Fields[9].Note = "" TemplateDoc.Fields[9].Description = "WHOIS contains the WHOIS request to make in the template." TemplateDoc.Fields[9].Comments[encoder.LineComment] = "WHOIS contains the WHOIS request to make in the template." - TemplateDoc.Fields[10].Name = "workflows" - TemplateDoc.Fields[10].Type = "[]workflows.WorkflowTemplate" + TemplateDoc.Fields[10].Name = "self-contained" + TemplateDoc.Fields[10].Type = "bool" TemplateDoc.Fields[10].Note = "" - TemplateDoc.Fields[10].Description = "Workflows is a list of workflows to execute for a template." - TemplateDoc.Fields[10].Comments[encoder.LineComment] = "Workflows is a list of workflows to execute for a template." - TemplateDoc.Fields[11].Name = "self-contained" + TemplateDoc.Fields[10].Description = "Self Contained marks Requests for the template as self-contained" + TemplateDoc.Fields[10].Comments[encoder.LineComment] = "Self Contained marks Requests for the template as self-contained" + TemplateDoc.Fields[11].Name = "stop-at-first-match" TemplateDoc.Fields[11].Type = "bool" TemplateDoc.Fields[11].Note = "" - TemplateDoc.Fields[11].Description = "Self Contained marks Requests for the template as self-contained" - TemplateDoc.Fields[11].Comments[encoder.LineComment] = "Self Contained marks Requests for the template as self-contained" - TemplateDoc.Fields[12].Name = "stop-at-first-match" - TemplateDoc.Fields[12].Type = "bool" + TemplateDoc.Fields[11].Description = "Stop execution once first match is found" + TemplateDoc.Fields[11].Comments[encoder.LineComment] = "Stop execution once first match is found" + TemplateDoc.Fields[12].Name = "signature" + TemplateDoc.Fields[12].Type = "http.SignatureTypeHolder" TemplateDoc.Fields[12].Note = "" - TemplateDoc.Fields[12].Description = "Stop execution once first match is found" - TemplateDoc.Fields[12].Comments[encoder.LineComment] = "Stop execution once first match is found" - TemplateDoc.Fields[13].Name = "signature" - TemplateDoc.Fields[13].Type = "http.SignatureTypeHolder" - TemplateDoc.Fields[13].Note = "" - TemplateDoc.Fields[13].Description = "Signature is the request signature method" - TemplateDoc.Fields[13].Comments[encoder.LineComment] = "Signature is the request signature method" - TemplateDoc.Fields[13].Values = []string{ + TemplateDoc.Fields[12].Description = "Signature is the request signature method" + TemplateDoc.Fields[12].Comments[encoder.LineComment] = "Signature is the request signature method" + TemplateDoc.Fields[12].Values = []string{ "AWS", } - TemplateDoc.Fields[14].Name = "variables" - TemplateDoc.Fields[14].Type = "variables.Variable" - TemplateDoc.Fields[14].Note = "" - TemplateDoc.Fields[14].Description = "Variables contains any variables for the current request." - TemplateDoc.Fields[14].Comments[encoder.LineComment] = "Variables contains any variables for the current request." + TemplateDoc.Fields[13].Name = "variables" + TemplateDoc.Fields[13].Type = "variables.Variable" + TemplateDoc.Fields[13].Note = "" + TemplateDoc.Fields[13].Description = "Variables contains any variables for the current request." + TemplateDoc.Fields[13].Comments[encoder.LineComment] = "Variables contains any variables for the current request." MODELInfoDoc.Type = "model.Info" MODELInfoDoc.Comments[encoder.LineComment] = " Info contains metadata information about a template" @@ -184,7 +174,7 @@ func init() { MODELInfoDoc.Fields[3].AddExample("", "Subversion ALM for the enterprise before 8.8.2 allows reflected XSS at multiple locations") MODELInfoDoc.Fields[4].Name = "reference" - MODELInfoDoc.Fields[4].Type = "stringslice.StringSlice" + MODELInfoDoc.Fields[4].Type = "stringslice.RawStringSlice" MODELInfoDoc.Fields[4].Note = "" MODELInfoDoc.Fields[4].Description = "References for the template.\n\nThis should contain links relevant to the template." MODELInfoDoc.Fields[4].Comments[encoder.LineComment] = "References for the template." @@ -223,8 +213,6 @@ func init() { STRINGSLICEStringSliceDoc.AddExample("Example tags", "cve,cve2019,grafana,auth-bypass,dos") - STRINGSLICEStringSliceDoc.AddExample("", []string{"https://github.com/strapi/strapi", "https://github.com/getgrav/grav"}) - STRINGSLICEStringSliceDoc.AddExample("", "CVE-2020-14420") STRINGSLICEStringSliceDoc.AddExample("", "CWE-22") @@ -237,10 +225,6 @@ func init() { TypeName: "model.Info", FieldName: "tags", }, - { - TypeName: "model.Info", - FieldName: "reference", - }, { TypeName: "model.Classification", FieldName: "cve-id", @@ -249,17 +233,22 @@ func init() { TypeName: "model.Classification", FieldName: "cwe-id", }, - { - TypeName: "workflows.WorkflowTemplate", - FieldName: "tags", - }, - { - TypeName: "workflows.Matcher", - FieldName: "name", - }, } STRINGSLICEStringSliceDoc.Fields = make([]encoder.Doc, 0) + STRINGSLICERawStringSliceDoc.Type = "stringslice.RawStringSlice" + STRINGSLICERawStringSliceDoc.Comments[encoder.LineComment] = "" + STRINGSLICERawStringSliceDoc.Description = "" + + STRINGSLICERawStringSliceDoc.AddExample("", []string{"https://github.com/strapi/strapi", "https://github.com/getgrav/grav"}) + STRINGSLICERawStringSliceDoc.AppearsIn = []encoder.Appearance{ + { + TypeName: "model.Info", + FieldName: "reference", + }, + } + STRINGSLICERawStringSliceDoc.Fields = make([]encoder.Doc, 0) + SEVERITYHolderDoc.Type = "severity.Holder" SEVERITYHolderDoc.Comments[encoder.LineComment] = " Holder holds a Severity type. Required for un/marshalling purposes" SEVERITYHolderDoc.Description = "Holder holds a Severity type. Required for un/marshalling purposes" @@ -401,524 +390,185 @@ func init() { Value: "HTTP response headers in name:value format", }, } - HTTPRequestDoc.Fields = make([]encoder.Doc, 33) - HTTPRequestDoc.Fields[0].Name = "matchers" - HTTPRequestDoc.Fields[0].Type = "[]matchers.Matcher" + HTTPRequestDoc.Fields = make([]encoder.Doc, 30) + HTTPRequestDoc.Fields[0].Name = "path" + HTTPRequestDoc.Fields[0].Type = "[]string" HTTPRequestDoc.Fields[0].Note = "" - HTTPRequestDoc.Fields[0].Description = "Matchers contains the detection mechanism for the request to identify\nwhether the request was successful by doing pattern matching\non request/responses.\n\nMultiple matchers can be combined with `matcher-condition` flag\nwhich accepts either `and` or `or` as argument." - HTTPRequestDoc.Fields[0].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify" - HTTPRequestDoc.Fields[1].Name = "extractors" - HTTPRequestDoc.Fields[1].Type = "[]extractors.Extractor" + HTTPRequestDoc.Fields[0].Description = "Path contains the path/s for the HTTP requests. It supports variables\nas placeholders." + HTTPRequestDoc.Fields[0].Comments[encoder.LineComment] = "Path contains the path/s for the HTTP requests. It supports variables" + + HTTPRequestDoc.Fields[0].AddExample("Some example path values", []string{"{{BaseURL}}", "{{BaseURL}}/+CSCOU+/../+CSCOE+/files/file_list.json?path=/sessions"}) + HTTPRequestDoc.Fields[1].Name = "raw" + HTTPRequestDoc.Fields[1].Type = "[]string" HTTPRequestDoc.Fields[1].Note = "" - HTTPRequestDoc.Fields[1].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response." - HTTPRequestDoc.Fields[1].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify" - HTTPRequestDoc.Fields[2].Name = "matchers-condition" + HTTPRequestDoc.Fields[1].Description = "Raw contains HTTP Requests in Raw format." + HTTPRequestDoc.Fields[1].Comments[encoder.LineComment] = "Raw contains HTTP Requests in Raw format." + + HTTPRequestDoc.Fields[1].AddExample("Some example raw requests", []string{"GET /etc/passwd HTTP/1.1\nHost:\nContent-Length: 4", "POST /.%0d./.%0d./.%0d./.%0d./bin/sh HTTP/1.1\nHost: {{Hostname}}\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0\nContent-Length: 1\nConnection: close\n\necho\necho\ncat /etc/passwd 2>&1"}) + HTTPRequestDoc.Fields[2].Name = "id" HTTPRequestDoc.Fields[2].Type = "string" HTTPRequestDoc.Fields[2].Note = "" - HTTPRequestDoc.Fields[2].Description = "MatchersCondition is the condition between the matchers. Default is OR." - HTTPRequestDoc.Fields[2].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR." - HTTPRequestDoc.Fields[2].Values = []string{ - "and", - "or", - } - HTTPRequestDoc.Fields[3].Name = "path" - HTTPRequestDoc.Fields[3].Type = "[]string" + HTTPRequestDoc.Fields[2].Description = "ID is the optional id of the request" + HTTPRequestDoc.Fields[2].Comments[encoder.LineComment] = " ID is the optional id of the request" + HTTPRequestDoc.Fields[3].Name = "name" + HTTPRequestDoc.Fields[3].Type = "string" HTTPRequestDoc.Fields[3].Note = "" - HTTPRequestDoc.Fields[3].Description = "Path contains the path/s for the HTTP requests. It supports variables\nas placeholders." - HTTPRequestDoc.Fields[3].Comments[encoder.LineComment] = "Path contains the path/s for the HTTP requests. It supports variables" - - HTTPRequestDoc.Fields[3].AddExample("Some example path values", []string{"{{BaseURL}}", "{{BaseURL}}/+CSCOU+/../+CSCOE+/files/file_list.json?path=/sessions"}) - HTTPRequestDoc.Fields[4].Name = "raw" - HTTPRequestDoc.Fields[4].Type = "[]string" + HTTPRequestDoc.Fields[3].Description = "Name is the optional name of the request.\n\nIf a name is specified, all the named request in a template can be matched upon\nin a combined manner allowing multi-request based matchers." + HTTPRequestDoc.Fields[3].Comments[encoder.LineComment] = "Name is the optional name of the request." + HTTPRequestDoc.Fields[4].Name = "attack" + HTTPRequestDoc.Fields[4].Type = "generators.AttackTypeHolder" HTTPRequestDoc.Fields[4].Note = "" - HTTPRequestDoc.Fields[4].Description = "Raw contains HTTP Requests in Raw format." - HTTPRequestDoc.Fields[4].Comments[encoder.LineComment] = "Raw contains HTTP Requests in Raw format." - - HTTPRequestDoc.Fields[4].AddExample("Some example raw requests", []string{"GET /etc/passwd HTTP/1.1\nHost:\nContent-Length: 4", "POST /.%0d./.%0d./.%0d./.%0d./bin/sh HTTP/1.1\nHost: {{Hostname}}\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0\nContent-Length: 1\nConnection: close\n\necho\necho\ncat /etc/passwd 2>&1"}) - HTTPRequestDoc.Fields[5].Name = "id" - HTTPRequestDoc.Fields[5].Type = "string" - HTTPRequestDoc.Fields[5].Note = "" - HTTPRequestDoc.Fields[5].Description = "ID is the optional id of the request" - HTTPRequestDoc.Fields[5].Comments[encoder.LineComment] = " ID is the optional id of the request" - HTTPRequestDoc.Fields[6].Name = "name" - HTTPRequestDoc.Fields[6].Type = "string" - HTTPRequestDoc.Fields[6].Note = "" - HTTPRequestDoc.Fields[6].Description = "Name is the optional name of the request.\n\nIf a name is specified, all the named request in a template can be matched upon\nin a combined manner allowing multi-request based matchers." - HTTPRequestDoc.Fields[6].Comments[encoder.LineComment] = "Name is the optional name of the request." - HTTPRequestDoc.Fields[7].Name = "attack" - HTTPRequestDoc.Fields[7].Type = "generators.AttackTypeHolder" - HTTPRequestDoc.Fields[7].Note = "" - HTTPRequestDoc.Fields[7].Description = "Attack is the type of payload combinations to perform.\n\nbatteringram is inserts the same payload into all defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates\npermutations and combinations for all payloads." - HTTPRequestDoc.Fields[7].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform." - HTTPRequestDoc.Fields[7].Values = []string{ + HTTPRequestDoc.Fields[4].Description = "Attack is the type of payload combinations to perform.\n\nbatteringram is inserts the same payload into all defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates\npermutations and combinations for all payloads." + HTTPRequestDoc.Fields[4].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform." + HTTPRequestDoc.Fields[4].Values = []string{ "batteringram", "pitchfork", "clusterbomb", } - HTTPRequestDoc.Fields[8].Name = "method" - HTTPRequestDoc.Fields[8].Type = "HTTPMethodTypeHolder" + HTTPRequestDoc.Fields[5].Name = "method" + HTTPRequestDoc.Fields[5].Type = "HTTPMethodTypeHolder" + HTTPRequestDoc.Fields[5].Note = "" + HTTPRequestDoc.Fields[5].Description = "Method is the HTTP Request Method." + HTTPRequestDoc.Fields[5].Comments[encoder.LineComment] = "Method is the HTTP Request Method." + HTTPRequestDoc.Fields[6].Name = "body" + HTTPRequestDoc.Fields[6].Type = "string" + HTTPRequestDoc.Fields[6].Note = "" + HTTPRequestDoc.Fields[6].Description = "Body is an optional parameter which contains HTTP Request body." + HTTPRequestDoc.Fields[6].Comments[encoder.LineComment] = "Body is an optional parameter which contains HTTP Request body." + + HTTPRequestDoc.Fields[6].AddExample("Same Body for a Login POST request", "username=test&password=test") + HTTPRequestDoc.Fields[7].Name = "payloads" + HTTPRequestDoc.Fields[7].Type = "map[string]interface{}" + HTTPRequestDoc.Fields[7].Note = "" + HTTPRequestDoc.Fields[7].Description = "Payloads contains any payloads for the current request.\n\nPayloads support both key-values combinations where a list\nof payloads is provided, or optionally a single file can also\nbe provided as payload which will be read on run-time." + HTTPRequestDoc.Fields[7].Comments[encoder.LineComment] = "Payloads contains any payloads for the current request." + HTTPRequestDoc.Fields[8].Name = "headers" + HTTPRequestDoc.Fields[8].Type = "map[string]string" HTTPRequestDoc.Fields[8].Note = "" - HTTPRequestDoc.Fields[8].Description = "Method is the HTTP Request Method." - HTTPRequestDoc.Fields[8].Comments[encoder.LineComment] = "Method is the HTTP Request Method." - HTTPRequestDoc.Fields[9].Name = "body" - HTTPRequestDoc.Fields[9].Type = "string" + HTTPRequestDoc.Fields[8].Description = "Headers contains HTTP Headers to send with the request." + HTTPRequestDoc.Fields[8].Comments[encoder.LineComment] = "Headers contains HTTP Headers to send with the request." + + HTTPRequestDoc.Fields[8].AddExample("", map[string]string{"Content-Type": "application/x-www-form-urlencoded", "Content-Length": "1", "Any-Header": "Any-Value"}) + HTTPRequestDoc.Fields[9].Name = "race_count" + HTTPRequestDoc.Fields[9].Type = "int" HTTPRequestDoc.Fields[9].Note = "" - HTTPRequestDoc.Fields[9].Description = "Body is an optional parameter which contains HTTP Request body." - HTTPRequestDoc.Fields[9].Comments[encoder.LineComment] = "Body is an optional parameter which contains HTTP Request body." + HTTPRequestDoc.Fields[9].Description = "RaceCount is the number of times to send a request in Race Condition Attack." + HTTPRequestDoc.Fields[9].Comments[encoder.LineComment] = "RaceCount is the number of times to send a request in Race Condition Attack." - HTTPRequestDoc.Fields[9].AddExample("Same Body for a Login POST request", "username=test&password=test") - HTTPRequestDoc.Fields[10].Name = "payloads" - HTTPRequestDoc.Fields[10].Type = "map[string]interface{}" + HTTPRequestDoc.Fields[9].AddExample("Send a request 5 times", 5) + HTTPRequestDoc.Fields[10].Name = "max-redirects" + HTTPRequestDoc.Fields[10].Type = "int" HTTPRequestDoc.Fields[10].Note = "" - HTTPRequestDoc.Fields[10].Description = "Payloads contains any payloads for the current request.\n\nPayloads support both key-values combinations where a list\nof payloads is provided, or optionally a single file can also\nbe provided as payload which will be read on run-time." - HTTPRequestDoc.Fields[10].Comments[encoder.LineComment] = "Payloads contains any payloads for the current request." - HTTPRequestDoc.Fields[11].Name = "headers" - HTTPRequestDoc.Fields[11].Type = "map[string]string" - HTTPRequestDoc.Fields[11].Note = "" - HTTPRequestDoc.Fields[11].Description = "Headers contains HTTP Headers to send with the request." - HTTPRequestDoc.Fields[11].Comments[encoder.LineComment] = "Headers contains HTTP Headers to send with the request." + HTTPRequestDoc.Fields[10].Description = "MaxRedirects is the maximum number of redirects that should be followed." + HTTPRequestDoc.Fields[10].Comments[encoder.LineComment] = "MaxRedirects is the maximum number of redirects that should be followed." - HTTPRequestDoc.Fields[11].AddExample("", map[string]string{"Content-Type": "application/x-www-form-urlencoded", "Content-Length": "1", "Any-Header": "Any-Value"}) - HTTPRequestDoc.Fields[12].Name = "race_count" + HTTPRequestDoc.Fields[10].AddExample("Follow up to 5 redirects", 5) + HTTPRequestDoc.Fields[11].Name = "pipeline-concurrent-connections" + HTTPRequestDoc.Fields[11].Type = "int" + HTTPRequestDoc.Fields[11].Note = "" + HTTPRequestDoc.Fields[11].Description = "PipelineConcurrentConnections is number of connections to create during pipelining." + HTTPRequestDoc.Fields[11].Comments[encoder.LineComment] = "PipelineConcurrentConnections is number of connections to create during pipelining." + + HTTPRequestDoc.Fields[11].AddExample("Create 40 concurrent connections", 40) + HTTPRequestDoc.Fields[12].Name = "pipeline-requests-per-connection" HTTPRequestDoc.Fields[12].Type = "int" HTTPRequestDoc.Fields[12].Note = "" - HTTPRequestDoc.Fields[12].Description = "RaceCount is the number of times to send a request in Race Condition Attack." - HTTPRequestDoc.Fields[12].Comments[encoder.LineComment] = "RaceCount is the number of times to send a request in Race Condition Attack." + HTTPRequestDoc.Fields[12].Description = "PipelineRequestsPerConnection is number of requests to send per connection when pipelining." + HTTPRequestDoc.Fields[12].Comments[encoder.LineComment] = "PipelineRequestsPerConnection is number of requests to send per connection when pipelining." - HTTPRequestDoc.Fields[12].AddExample("Send a request 5 times", 5) - HTTPRequestDoc.Fields[13].Name = "max-redirects" + HTTPRequestDoc.Fields[12].AddExample("Send 100 requests per pipeline connection", 100) + HTTPRequestDoc.Fields[13].Name = "threads" HTTPRequestDoc.Fields[13].Type = "int" HTTPRequestDoc.Fields[13].Note = "" - HTTPRequestDoc.Fields[13].Description = "MaxRedirects is the maximum number of redirects that should be followed." - HTTPRequestDoc.Fields[13].Comments[encoder.LineComment] = "MaxRedirects is the maximum number of redirects that should be followed." + HTTPRequestDoc.Fields[13].Description = "Threads specifies number of threads to use sending requests. This enables Connection Pooling.\n\nConnection: Close attribute must not be used in request while using threads flag, otherwise\npooling will fail and engine will continue to close connections after requests." + HTTPRequestDoc.Fields[13].Comments[encoder.LineComment] = "Threads specifies number of threads to use sending requests. This enables Connection Pooling." - HTTPRequestDoc.Fields[13].AddExample("Follow up to 5 redirects", 5) - HTTPRequestDoc.Fields[14].Name = "pipeline-concurrent-connections" + HTTPRequestDoc.Fields[13].AddExample("Send requests using 10 concurrent threads", 10) + HTTPRequestDoc.Fields[14].Name = "max-size" HTTPRequestDoc.Fields[14].Type = "int" HTTPRequestDoc.Fields[14].Note = "" - HTTPRequestDoc.Fields[14].Description = "PipelineConcurrentConnections is number of connections to create during pipelining." - HTTPRequestDoc.Fields[14].Comments[encoder.LineComment] = "PipelineConcurrentConnections is number of connections to create during pipelining." + HTTPRequestDoc.Fields[14].Description = "MaxSize is the maximum size of http response body to read in bytes." + HTTPRequestDoc.Fields[14].Comments[encoder.LineComment] = "MaxSize is the maximum size of http response body to read in bytes." - HTTPRequestDoc.Fields[14].AddExample("Create 40 concurrent connections", 40) - HTTPRequestDoc.Fields[15].Name = "pipeline-requests-per-connection" - HTTPRequestDoc.Fields[15].Type = "int" + HTTPRequestDoc.Fields[14].AddExample("Read max 2048 bytes of the response", 2048) + HTTPRequestDoc.Fields[15].Name = "fuzzing" + HTTPRequestDoc.Fields[15].Type = "[]fuzz.Rule" HTTPRequestDoc.Fields[15].Note = "" - HTTPRequestDoc.Fields[15].Description = "PipelineRequestsPerConnection is number of requests to send per connection when pipelining." - HTTPRequestDoc.Fields[15].Comments[encoder.LineComment] = "PipelineRequestsPerConnection is number of requests to send per connection when pipelining." - - HTTPRequestDoc.Fields[15].AddExample("Send 100 requests per pipeline connection", 100) - HTTPRequestDoc.Fields[16].Name = "threads" - HTTPRequestDoc.Fields[16].Type = "int" + HTTPRequestDoc.Fields[15].Description = "Fuzzing describes schema to fuzz http requests" + HTTPRequestDoc.Fields[15].Comments[encoder.LineComment] = " Fuzzing describes schema to fuzz http requests" + HTTPRequestDoc.Fields[16].Name = "signature" + HTTPRequestDoc.Fields[16].Type = "SignatureTypeHolder" HTTPRequestDoc.Fields[16].Note = "" - HTTPRequestDoc.Fields[16].Description = "Threads specifies number of threads to use sending requests. This enables Connection Pooling.\n\nConnection: Close attribute must not be used in request while using threads flag, otherwise\npooling will fail and engine will continue to close connections after requests." - HTTPRequestDoc.Fields[16].Comments[encoder.LineComment] = "Threads specifies number of threads to use sending requests. This enables Connection Pooling." - - HTTPRequestDoc.Fields[16].AddExample("Send requests using 10 concurrent threads", 10) - HTTPRequestDoc.Fields[17].Name = "max-size" - HTTPRequestDoc.Fields[17].Type = "int" - HTTPRequestDoc.Fields[17].Note = "" - HTTPRequestDoc.Fields[17].Description = "MaxSize is the maximum size of http response body to read in bytes." - HTTPRequestDoc.Fields[17].Comments[encoder.LineComment] = "MaxSize is the maximum size of http response body to read in bytes." - - HTTPRequestDoc.Fields[17].AddExample("Read max 2048 bytes of the response", 2048) - HTTPRequestDoc.Fields[18].Name = "fuzzing" - HTTPRequestDoc.Fields[18].Type = "[]fuzz.Rule" - HTTPRequestDoc.Fields[18].Note = "" - HTTPRequestDoc.Fields[18].Description = "Fuzzing describes schema to fuzz http requests" - HTTPRequestDoc.Fields[18].Comments[encoder.LineComment] = " Fuzzing describes schema to fuzz http requests" - HTTPRequestDoc.Fields[19].Name = "signature" - HTTPRequestDoc.Fields[19].Type = "SignatureTypeHolder" - HTTPRequestDoc.Fields[19].Note = "" - HTTPRequestDoc.Fields[19].Description = "Signature is the request signature method" - HTTPRequestDoc.Fields[19].Comments[encoder.LineComment] = "Signature is the request signature method" - HTTPRequestDoc.Fields[19].Values = []string{ + HTTPRequestDoc.Fields[16].Description = "Signature is the request signature method" + HTTPRequestDoc.Fields[16].Comments[encoder.LineComment] = "Signature is the request signature method" + HTTPRequestDoc.Fields[16].Values = []string{ "AWS", } - HTTPRequestDoc.Fields[20].Name = "cookie-reuse" + HTTPRequestDoc.Fields[17].Name = "cookie-reuse" + HTTPRequestDoc.Fields[17].Type = "bool" + HTTPRequestDoc.Fields[17].Note = "" + HTTPRequestDoc.Fields[17].Description = "CookieReuse is an optional setting that enables cookie reuse for\nall requests defined in raw section." + HTTPRequestDoc.Fields[17].Comments[encoder.LineComment] = "CookieReuse is an optional setting that enables cookie reuse for" + HTTPRequestDoc.Fields[18].Name = "read-all" + HTTPRequestDoc.Fields[18].Type = "bool" + HTTPRequestDoc.Fields[18].Note = "" + HTTPRequestDoc.Fields[18].Description = "Enables force reading of the entire raw unsafe request body ignoring\nany specified content length headers." + HTTPRequestDoc.Fields[18].Comments[encoder.LineComment] = "Enables force reading of the entire raw unsafe request body ignoring" + HTTPRequestDoc.Fields[19].Name = "redirects" + HTTPRequestDoc.Fields[19].Type = "bool" + HTTPRequestDoc.Fields[19].Note = "" + HTTPRequestDoc.Fields[19].Description = "Redirects specifies whether redirects should be followed by the HTTP Client.\n\nThis can be used in conjunction with `max-redirects` to control the HTTP request redirects." + HTTPRequestDoc.Fields[19].Comments[encoder.LineComment] = "Redirects specifies whether redirects should be followed by the HTTP Client." + HTTPRequestDoc.Fields[20].Name = "host-redirects" HTTPRequestDoc.Fields[20].Type = "bool" HTTPRequestDoc.Fields[20].Note = "" - HTTPRequestDoc.Fields[20].Description = "CookieReuse is an optional setting that enables cookie reuse for\nall requests defined in raw section." - HTTPRequestDoc.Fields[20].Comments[encoder.LineComment] = "CookieReuse is an optional setting that enables cookie reuse for" - HTTPRequestDoc.Fields[21].Name = "read-all" + HTTPRequestDoc.Fields[20].Description = "Redirects specifies whether only redirects to the same host should be followed by the HTTP Client.\n\nThis can be used in conjunction with `max-redirects` to control the HTTP request redirects." + HTTPRequestDoc.Fields[20].Comments[encoder.LineComment] = "Redirects specifies whether only redirects to the same host should be followed by the HTTP Client." + HTTPRequestDoc.Fields[21].Name = "pipeline" HTTPRequestDoc.Fields[21].Type = "bool" HTTPRequestDoc.Fields[21].Note = "" - HTTPRequestDoc.Fields[21].Description = "Enables force reading of the entire raw unsafe request body ignoring\nany specified content length headers." - HTTPRequestDoc.Fields[21].Comments[encoder.LineComment] = "Enables force reading of the entire raw unsafe request body ignoring" - HTTPRequestDoc.Fields[22].Name = "redirects" + HTTPRequestDoc.Fields[21].Description = "Pipeline defines if the attack should be performed with HTTP 1.1 Pipelining\n\nAll requests must be idempotent (GET/POST). This can be used for race conditions/billions requests." + HTTPRequestDoc.Fields[21].Comments[encoder.LineComment] = "Pipeline defines if the attack should be performed with HTTP 1.1 Pipelining" + HTTPRequestDoc.Fields[22].Name = "unsafe" HTTPRequestDoc.Fields[22].Type = "bool" HTTPRequestDoc.Fields[22].Note = "" - HTTPRequestDoc.Fields[22].Description = "Redirects specifies whether redirects should be followed by the HTTP Client.\n\nThis can be used in conjunction with `max-redirects` to control the HTTP request redirects." - HTTPRequestDoc.Fields[22].Comments[encoder.LineComment] = "Redirects specifies whether redirects should be followed by the HTTP Client." - HTTPRequestDoc.Fields[23].Name = "host-redirects" + HTTPRequestDoc.Fields[22].Description = "Unsafe specifies whether to use rawhttp engine for sending Non RFC-Compliant requests.\n\nThis uses the [rawhttp](https://github.com/projectdiscovery/rawhttp) engine to achieve complete\ncontrol over the request, with no normalization performed by the client." + HTTPRequestDoc.Fields[22].Comments[encoder.LineComment] = "Unsafe specifies whether to use rawhttp engine for sending Non RFC-Compliant requests." + HTTPRequestDoc.Fields[23].Name = "race" HTTPRequestDoc.Fields[23].Type = "bool" HTTPRequestDoc.Fields[23].Note = "" - HTTPRequestDoc.Fields[23].Description = "Redirects specifies whether only redirects to the same host should be followed by the HTTP Client.\n\nThis can be used in conjunction with `max-redirects` to control the HTTP request redirects." - HTTPRequestDoc.Fields[23].Comments[encoder.LineComment] = "Redirects specifies whether only redirects to the same host should be followed by the HTTP Client." - HTTPRequestDoc.Fields[24].Name = "pipeline" + HTTPRequestDoc.Fields[23].Description = "Race determines if all the request have to be attempted at the same time (Race Condition)\n\nThe actual number of requests that will be sent is determined by the `race_count` field." + HTTPRequestDoc.Fields[23].Comments[encoder.LineComment] = "Race determines if all the request have to be attempted at the same time (Race Condition)" + HTTPRequestDoc.Fields[24].Name = "req-condition" HTTPRequestDoc.Fields[24].Type = "bool" HTTPRequestDoc.Fields[24].Note = "" - HTTPRequestDoc.Fields[24].Description = "Pipeline defines if the attack should be performed with HTTP 1.1 Pipelining\n\nAll requests must be idempotent (GET/POST). This can be used for race conditions/billions requests." - HTTPRequestDoc.Fields[24].Comments[encoder.LineComment] = "Pipeline defines if the attack should be performed with HTTP 1.1 Pipelining" - HTTPRequestDoc.Fields[25].Name = "unsafe" + HTTPRequestDoc.Fields[24].Description = "ReqCondition automatically assigns numbers to requests and preserves their history.\n\nThis allows matching on them later for multi-request conditions." + HTTPRequestDoc.Fields[24].Comments[encoder.LineComment] = "ReqCondition automatically assigns numbers to requests and preserves their history." + HTTPRequestDoc.Fields[25].Name = "stop-at-first-match" HTTPRequestDoc.Fields[25].Type = "bool" HTTPRequestDoc.Fields[25].Note = "" - HTTPRequestDoc.Fields[25].Description = "Unsafe specifies whether to use rawhttp engine for sending Non RFC-Compliant requests.\n\nThis uses the [rawhttp](https://github.com/projectdiscovery/rawhttp) engine to achieve complete\ncontrol over the request, with no normalization performed by the client." - HTTPRequestDoc.Fields[25].Comments[encoder.LineComment] = "Unsafe specifies whether to use rawhttp engine for sending Non RFC-Compliant requests." - HTTPRequestDoc.Fields[26].Name = "race" + HTTPRequestDoc.Fields[25].Description = "StopAtFirstMatch stops the execution of the requests and template as soon as a match is found." + HTTPRequestDoc.Fields[25].Comments[encoder.LineComment] = "StopAtFirstMatch stops the execution of the requests and template as soon as a match is found." + HTTPRequestDoc.Fields[26].Name = "skip-variables-check" HTTPRequestDoc.Fields[26].Type = "bool" HTTPRequestDoc.Fields[26].Note = "" - HTTPRequestDoc.Fields[26].Description = "Race determines if all the request have to be attempted at the same time (Race Condition)\n\nThe actual number of requests that will be sent is determined by the `race_count` field." - HTTPRequestDoc.Fields[26].Comments[encoder.LineComment] = "Race determines if all the request have to be attempted at the same time (Race Condition)" - HTTPRequestDoc.Fields[27].Name = "req-condition" + HTTPRequestDoc.Fields[26].Description = "SkipVariablesCheck skips the check for unresolved variables in request" + HTTPRequestDoc.Fields[26].Comments[encoder.LineComment] = "SkipVariablesCheck skips the check for unresolved variables in request" + HTTPRequestDoc.Fields[27].Name = "iterate-all" HTTPRequestDoc.Fields[27].Type = "bool" HTTPRequestDoc.Fields[27].Note = "" - HTTPRequestDoc.Fields[27].Description = "ReqCondition automatically assigns numbers to requests and preserves their history.\n\nThis allows matching on them later for multi-request conditions." - HTTPRequestDoc.Fields[27].Comments[encoder.LineComment] = "ReqCondition automatically assigns numbers to requests and preserves their history." - HTTPRequestDoc.Fields[28].Name = "stop-at-first-match" - HTTPRequestDoc.Fields[28].Type = "bool" + HTTPRequestDoc.Fields[27].Description = "IterateAll iterates all the values extracted from internal extractors" + HTTPRequestDoc.Fields[27].Comments[encoder.LineComment] = "IterateAll iterates all the values extracted from internal extractors" + HTTPRequestDoc.Fields[28].Name = "digest-username" + HTTPRequestDoc.Fields[28].Type = "string" HTTPRequestDoc.Fields[28].Note = "" - HTTPRequestDoc.Fields[28].Description = "StopAtFirstMatch stops the execution of the requests and template as soon as a match is found." - HTTPRequestDoc.Fields[28].Comments[encoder.LineComment] = "StopAtFirstMatch stops the execution of the requests and template as soon as a match is found." - HTTPRequestDoc.Fields[29].Name = "skip-variables-check" - HTTPRequestDoc.Fields[29].Type = "bool" + HTTPRequestDoc.Fields[28].Description = "DigestAuthUsername specifies the username for digest authentication" + HTTPRequestDoc.Fields[28].Comments[encoder.LineComment] = "DigestAuthUsername specifies the username for digest authentication" + HTTPRequestDoc.Fields[29].Name = "digest-password" + HTTPRequestDoc.Fields[29].Type = "string" HTTPRequestDoc.Fields[29].Note = "" - HTTPRequestDoc.Fields[29].Description = "SkipVariablesCheck skips the check for unresolved variables in request" - HTTPRequestDoc.Fields[29].Comments[encoder.LineComment] = "SkipVariablesCheck skips the check for unresolved variables in request" - HTTPRequestDoc.Fields[30].Name = "iterate-all" - HTTPRequestDoc.Fields[30].Type = "bool" - HTTPRequestDoc.Fields[30].Note = "" - HTTPRequestDoc.Fields[30].Description = "IterateAll iterates all the values extracted from internal extractors" - HTTPRequestDoc.Fields[30].Comments[encoder.LineComment] = "IterateAll iterates all the values extracted from internal extractors" - HTTPRequestDoc.Fields[31].Name = "digest-username" - HTTPRequestDoc.Fields[31].Type = "string" - HTTPRequestDoc.Fields[31].Note = "" - HTTPRequestDoc.Fields[31].Description = "DigestAuthUsername specifies the username for digest authentication" - HTTPRequestDoc.Fields[31].Comments[encoder.LineComment] = "DigestAuthUsername specifies the username for digest authentication" - HTTPRequestDoc.Fields[32].Name = "digest-password" - HTTPRequestDoc.Fields[32].Type = "string" - HTTPRequestDoc.Fields[32].Note = "" - HTTPRequestDoc.Fields[32].Description = "DigestAuthPassword specifies the password for digest authentication" - HTTPRequestDoc.Fields[32].Comments[encoder.LineComment] = "DigestAuthPassword specifies the password for digest authentication" - - MATCHERSMatcherDoc.Type = "matchers.Matcher" - MATCHERSMatcherDoc.Comments[encoder.LineComment] = " Matcher is used to match a part in the output from a protocol." - MATCHERSMatcherDoc.Description = "Matcher is used to match a part in the output from a protocol." - MATCHERSMatcherDoc.AppearsIn = []encoder.Appearance{ - { - TypeName: "http.Request", - FieldName: "matchers", - }, - { - TypeName: "dns.Request", - FieldName: "matchers", - }, - { - TypeName: "file.Request", - FieldName: "matchers", - }, - { - TypeName: "network.Request", - FieldName: "matchers", - }, - { - TypeName: "headless.Request", - FieldName: "matchers", - }, - { - TypeName: "ssl.Request", - FieldName: "matchers", - }, - { - TypeName: "websocket.Request", - FieldName: "matchers", - }, - { - TypeName: "whois.Request", - FieldName: "matchers", - }, - } - MATCHERSMatcherDoc.Fields = make([]encoder.Doc, 14) - MATCHERSMatcherDoc.Fields[0].Name = "type" - MATCHERSMatcherDoc.Fields[0].Type = "MatcherTypeHolder" - MATCHERSMatcherDoc.Fields[0].Note = "" - MATCHERSMatcherDoc.Fields[0].Description = "Type is the type of the matcher." - MATCHERSMatcherDoc.Fields[0].Comments[encoder.LineComment] = "Type is the type of the matcher." - MATCHERSMatcherDoc.Fields[1].Name = "condition" - MATCHERSMatcherDoc.Fields[1].Type = "string" - MATCHERSMatcherDoc.Fields[1].Note = "" - MATCHERSMatcherDoc.Fields[1].Description = "Condition is the optional condition between two matcher variables. By default,\nthe condition is assumed to be OR." - MATCHERSMatcherDoc.Fields[1].Comments[encoder.LineComment] = "Condition is the optional condition between two matcher variables. By default," - MATCHERSMatcherDoc.Fields[1].Values = []string{ - "and", - "or", - } - MATCHERSMatcherDoc.Fields[2].Name = "part" - MATCHERSMatcherDoc.Fields[2].Type = "string" - MATCHERSMatcherDoc.Fields[2].Note = "" - MATCHERSMatcherDoc.Fields[2].Description = "Part is the part of the request response to match data from.\n\nEach protocol exposes a lot of different parts which are well\ndocumented in docs for each request type." - MATCHERSMatcherDoc.Fields[2].Comments[encoder.LineComment] = "Part is the part of the request response to match data from." - - MATCHERSMatcherDoc.Fields[2].AddExample("", "body") - - MATCHERSMatcherDoc.Fields[2].AddExample("", "raw") - MATCHERSMatcherDoc.Fields[3].Name = "negative" - MATCHERSMatcherDoc.Fields[3].Type = "bool" - MATCHERSMatcherDoc.Fields[3].Note = "" - MATCHERSMatcherDoc.Fields[3].Description = "Negative specifies if the match should be reversed\nIt will only match if the condition is not true." - MATCHERSMatcherDoc.Fields[3].Comments[encoder.LineComment] = "Negative specifies if the match should be reversed" - MATCHERSMatcherDoc.Fields[4].Name = "name" - MATCHERSMatcherDoc.Fields[4].Type = "string" - MATCHERSMatcherDoc.Fields[4].Note = "" - MATCHERSMatcherDoc.Fields[4].Description = "Name of the matcher. Name should be lowercase and must not contain\nspaces or underscores (_)." - MATCHERSMatcherDoc.Fields[4].Comments[encoder.LineComment] = "Name of the matcher. Name should be lowercase and must not contain" - - MATCHERSMatcherDoc.Fields[4].AddExample("", "cookie-matcher") - MATCHERSMatcherDoc.Fields[5].Name = "status" - MATCHERSMatcherDoc.Fields[5].Type = "[]int" - MATCHERSMatcherDoc.Fields[5].Note = "" - MATCHERSMatcherDoc.Fields[5].Description = "Status are the acceptable status codes for the response." - MATCHERSMatcherDoc.Fields[5].Comments[encoder.LineComment] = "Status are the acceptable status codes for the response." - - MATCHERSMatcherDoc.Fields[5].AddExample("", []int{200, 302}) - MATCHERSMatcherDoc.Fields[6].Name = "size" - MATCHERSMatcherDoc.Fields[6].Type = "[]int" - MATCHERSMatcherDoc.Fields[6].Note = "" - MATCHERSMatcherDoc.Fields[6].Description = "Size is the acceptable size for the response" - MATCHERSMatcherDoc.Fields[6].Comments[encoder.LineComment] = "Size is the acceptable size for the response" - - MATCHERSMatcherDoc.Fields[6].AddExample("", []int{3029, 2042}) - MATCHERSMatcherDoc.Fields[7].Name = "words" - MATCHERSMatcherDoc.Fields[7].Type = "[]string" - MATCHERSMatcherDoc.Fields[7].Note = "" - MATCHERSMatcherDoc.Fields[7].Description = "Words contains word patterns required to be present in the response part." - MATCHERSMatcherDoc.Fields[7].Comments[encoder.LineComment] = "Words contains word patterns required to be present in the response part." - - MATCHERSMatcherDoc.Fields[7].AddExample("Match for Outlook mail protection domain", []string{"mail.protection.outlook.com"}) - - MATCHERSMatcherDoc.Fields[7].AddExample("Match for application/json in response headers", []string{"application/json"}) - MATCHERSMatcherDoc.Fields[8].Name = "regex" - MATCHERSMatcherDoc.Fields[8].Type = "[]string" - MATCHERSMatcherDoc.Fields[8].Note = "" - MATCHERSMatcherDoc.Fields[8].Description = "Regex contains Regular Expression patterns required to be present in the response part." - MATCHERSMatcherDoc.Fields[8].Comments[encoder.LineComment] = "Regex contains Regular Expression patterns required to be present in the response part." - - MATCHERSMatcherDoc.Fields[8].AddExample("Match for Linkerd Service via Regex", []string{`(?mi)^Via\\s*?:.*?linkerd.*$`}) - - MATCHERSMatcherDoc.Fields[8].AddExample("Match for Open Redirect via Location header", []string{`(?m)^(?:Location\\s*?:\\s*?)(?:https?://|//)?(?:[a-zA-Z0-9\\-_\\.@]*)example\\.com.*$`}) - MATCHERSMatcherDoc.Fields[9].Name = "binary" - MATCHERSMatcherDoc.Fields[9].Type = "[]string" - MATCHERSMatcherDoc.Fields[9].Note = "" - MATCHERSMatcherDoc.Fields[9].Description = "Binary are the binary patterns required to be present in the response part." - MATCHERSMatcherDoc.Fields[9].Comments[encoder.LineComment] = "Binary are the binary patterns required to be present in the response part." - - MATCHERSMatcherDoc.Fields[9].AddExample("Match for Springboot Heapdump Actuator \"JAVA PROFILE\", \"HPROF\", \"Gunzip magic byte\"", []string{"4a4156412050524f46494c45", "4850524f46", "1f8b080000000000"}) - - MATCHERSMatcherDoc.Fields[9].AddExample("Match for 7zip files", []string{"377ABCAF271C"}) - MATCHERSMatcherDoc.Fields[10].Name = "dsl" - MATCHERSMatcherDoc.Fields[10].Type = "[]string" - MATCHERSMatcherDoc.Fields[10].Note = "" - MATCHERSMatcherDoc.Fields[10].Description = "DSL are the dsl expressions that will be evaluated as part of nuclei matching rules.\nA list of these helper functions are available [here](https://nuclei.projectdiscovery.io/templating-guide/helper-functions/)." - MATCHERSMatcherDoc.Fields[10].Comments[encoder.LineComment] = "DSL are the dsl expressions that will be evaluated as part of nuclei matching rules." - - MATCHERSMatcherDoc.Fields[10].AddExample("DSL Matcher for package.json file", []string{"contains(body, 'packages') && contains(tolower(all_headers), 'application/octet-stream') && status_code == 200"}) - - MATCHERSMatcherDoc.Fields[10].AddExample("DSL Matcher for missing strict transport security header", []string{"!contains(tolower(all_headers), ''strict-transport-security'')"}) - MATCHERSMatcherDoc.Fields[11].Name = "encoding" - MATCHERSMatcherDoc.Fields[11].Type = "string" - MATCHERSMatcherDoc.Fields[11].Note = "" - MATCHERSMatcherDoc.Fields[11].Description = "Encoding specifies the encoding for the words field if any." - MATCHERSMatcherDoc.Fields[11].Comments[encoder.LineComment] = "Encoding specifies the encoding for the words field if any." - MATCHERSMatcherDoc.Fields[11].Values = []string{ - "hex", - } - MATCHERSMatcherDoc.Fields[12].Name = "case-insensitive" - MATCHERSMatcherDoc.Fields[12].Type = "bool" - MATCHERSMatcherDoc.Fields[12].Note = "" - MATCHERSMatcherDoc.Fields[12].Description = "CaseInsensitive enables case-insensitive matches. Default is false." - MATCHERSMatcherDoc.Fields[12].Comments[encoder.LineComment] = "CaseInsensitive enables case-insensitive matches. Default is false." - MATCHERSMatcherDoc.Fields[12].Values = []string{ - "false", - "true", - } - MATCHERSMatcherDoc.Fields[13].Name = "match-all" - MATCHERSMatcherDoc.Fields[13].Type = "bool" - MATCHERSMatcherDoc.Fields[13].Note = "" - MATCHERSMatcherDoc.Fields[13].Description = "MatchAll enables matching for all matcher values. Default is false." - MATCHERSMatcherDoc.Fields[13].Comments[encoder.LineComment] = "MatchAll enables matching for all matcher values. Default is false." - MATCHERSMatcherDoc.Fields[13].Values = []string{ - "false", - "true", - } - - MatcherTypeHolderDoc.Type = "MatcherTypeHolder" - MatcherTypeHolderDoc.Comments[encoder.LineComment] = " MatcherTypeHolder is used to hold internal type of the matcher" - MatcherTypeHolderDoc.Description = "MatcherTypeHolder is used to hold internal type of the matcher" - MatcherTypeHolderDoc.AppearsIn = []encoder.Appearance{ - { - TypeName: "matchers.Matcher", - FieldName: "type", - }, - } - MatcherTypeHolderDoc.Fields = make([]encoder.Doc, 1) - MatcherTypeHolderDoc.Fields[0].Name = "" - MatcherTypeHolderDoc.Fields[0].Type = "MatcherType" - MatcherTypeHolderDoc.Fields[0].Note = "" - MatcherTypeHolderDoc.Fields[0].Description = "" - MatcherTypeHolderDoc.Fields[0].Comments[encoder.LineComment] = "" - MatcherTypeHolderDoc.Fields[0].EnumFields = []string{ - "word", - "regex", - "binary", - "status", - "size", - "dsl", - } - - EXTRACTORSExtractorDoc.Type = "extractors.Extractor" - EXTRACTORSExtractorDoc.Comments[encoder.LineComment] = " Extractor is used to extract part of response using a regex." - EXTRACTORSExtractorDoc.Description = "Extractor is used to extract part of response using a regex." - EXTRACTORSExtractorDoc.AppearsIn = []encoder.Appearance{ - { - TypeName: "http.Request", - FieldName: "extractors", - }, - { - TypeName: "dns.Request", - FieldName: "extractors", - }, - { - TypeName: "file.Request", - FieldName: "extractors", - }, - { - TypeName: "network.Request", - FieldName: "extractors", - }, - { - TypeName: "headless.Request", - FieldName: "extractors", - }, - { - TypeName: "ssl.Request", - FieldName: "extractors", - }, - { - TypeName: "websocket.Request", - FieldName: "extractors", - }, - { - TypeName: "whois.Request", - FieldName: "extractors", - }, - } - EXTRACTORSExtractorDoc.Fields = make([]encoder.Doc, 12) - EXTRACTORSExtractorDoc.Fields[0].Name = "name" - EXTRACTORSExtractorDoc.Fields[0].Type = "string" - EXTRACTORSExtractorDoc.Fields[0].Note = "" - EXTRACTORSExtractorDoc.Fields[0].Description = "Name of the extractor. Name should be lowercase and must not contain\nspaces or underscores (_)." - EXTRACTORSExtractorDoc.Fields[0].Comments[encoder.LineComment] = "Name of the extractor. Name should be lowercase and must not contain" - - EXTRACTORSExtractorDoc.Fields[0].AddExample("", "cookie-extractor") - EXTRACTORSExtractorDoc.Fields[1].Name = "type" - EXTRACTORSExtractorDoc.Fields[1].Type = "ExtractorTypeHolder" - EXTRACTORSExtractorDoc.Fields[1].Note = "" - EXTRACTORSExtractorDoc.Fields[1].Description = "Type is the type of the extractor." - EXTRACTORSExtractorDoc.Fields[1].Comments[encoder.LineComment] = "Type is the type of the extractor." - EXTRACTORSExtractorDoc.Fields[2].Name = "regex" - EXTRACTORSExtractorDoc.Fields[2].Type = "[]string" - EXTRACTORSExtractorDoc.Fields[2].Note = "" - EXTRACTORSExtractorDoc.Fields[2].Description = "Regex contains the regular expression patterns to extract from a part.\n\nGo regex engine does not support lookaheads or lookbehinds, so as a result\nthey are also not supported in nuclei." - EXTRACTORSExtractorDoc.Fields[2].Comments[encoder.LineComment] = "Regex contains the regular expression patterns to extract from a part." - - EXTRACTORSExtractorDoc.Fields[2].AddExample("Braintree Access Token Regex", []string{"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-f]{32}"}) - - EXTRACTORSExtractorDoc.Fields[2].AddExample("Wordpress Author Extraction regex", []string{"Author:(?:[A-Za-z0-9 -\\_=\"]+)?([A-Za-z0-9]+)<\\/span>"}) - EXTRACTORSExtractorDoc.Fields[3].Name = "group" - EXTRACTORSExtractorDoc.Fields[3].Type = "int" - EXTRACTORSExtractorDoc.Fields[3].Note = "" - EXTRACTORSExtractorDoc.Fields[3].Description = "Group specifies a numbered group to extract from the regex." - EXTRACTORSExtractorDoc.Fields[3].Comments[encoder.LineComment] = "Group specifies a numbered group to extract from the regex." - - EXTRACTORSExtractorDoc.Fields[3].AddExample("Example Regex Group", 1) - EXTRACTORSExtractorDoc.Fields[4].Name = "kval" - EXTRACTORSExtractorDoc.Fields[4].Type = "[]string" - EXTRACTORSExtractorDoc.Fields[4].Note = "" - EXTRACTORSExtractorDoc.Fields[4].Description = "description: |\n kval contains the key-value pairs present in the HTTP response header.\n kval extractor can be used to extract HTTP response header and cookie key-value pairs.\n kval extractor inputs are case-insensitive, and does not support dash (-) in input which can replaced with underscores (_)\n For example, Content-Type should be replaced with content_type\n\n A list of supported parts is available in docs for request types.\n examples:\n - name: Extract Server Header From HTTP Response\n value: >\n []string{\"server\"}\n - name: Extracting value of PHPSESSID Cookie\n value: >\n []string{\"phpsessid\"}\n - name: Extracting value of Content-Type Cookie\n value: >\n []string{\"content_type\"}" - EXTRACTORSExtractorDoc.Fields[4].Comments[encoder.LineComment] = " description: |" - EXTRACTORSExtractorDoc.Fields[5].Name = "json" - EXTRACTORSExtractorDoc.Fields[5].Type = "[]string" - EXTRACTORSExtractorDoc.Fields[5].Note = "" - EXTRACTORSExtractorDoc.Fields[5].Description = "JSON allows using jq-style syntax to extract items from json response" - EXTRACTORSExtractorDoc.Fields[5].Comments[encoder.LineComment] = "JSON allows using jq-style syntax to extract items from json response" - - EXTRACTORSExtractorDoc.Fields[5].AddExample("", []string{".[] | .id"}) - - EXTRACTORSExtractorDoc.Fields[5].AddExample("", []string{".batters | .batter | .[] | .id"}) - EXTRACTORSExtractorDoc.Fields[6].Name = "xpath" - EXTRACTORSExtractorDoc.Fields[6].Type = "[]string" - EXTRACTORSExtractorDoc.Fields[6].Note = "" - EXTRACTORSExtractorDoc.Fields[6].Description = "XPath allows using xpath expressions to extract items from html response" - EXTRACTORSExtractorDoc.Fields[6].Comments[encoder.LineComment] = "XPath allows using xpath expressions to extract items from html response" - - EXTRACTORSExtractorDoc.Fields[6].AddExample("", []string{"/html/body/div/p[2]/a"}) - EXTRACTORSExtractorDoc.Fields[7].Name = "attribute" - EXTRACTORSExtractorDoc.Fields[7].Type = "string" - EXTRACTORSExtractorDoc.Fields[7].Note = "" - EXTRACTORSExtractorDoc.Fields[7].Description = "Attribute is an optional attribute to extract from response XPath." - EXTRACTORSExtractorDoc.Fields[7].Comments[encoder.LineComment] = "Attribute is an optional attribute to extract from response XPath." - - EXTRACTORSExtractorDoc.Fields[7].AddExample("", "href") - EXTRACTORSExtractorDoc.Fields[8].Name = "dsl" - EXTRACTORSExtractorDoc.Fields[8].Type = "[]string" - EXTRACTORSExtractorDoc.Fields[8].Note = "" - EXTRACTORSExtractorDoc.Fields[8].Description = "Extracts using DSL expressions." - EXTRACTORSExtractorDoc.Fields[8].Comments[encoder.LineComment] = "Extracts using DSL expressions." - EXTRACTORSExtractorDoc.Fields[9].Name = "part" - EXTRACTORSExtractorDoc.Fields[9].Type = "string" - EXTRACTORSExtractorDoc.Fields[9].Note = "" - EXTRACTORSExtractorDoc.Fields[9].Description = "Part is the part of the request response to extract data from.\n\nEach protocol exposes a lot of different parts which are well\ndocumented in docs for each request type." - EXTRACTORSExtractorDoc.Fields[9].Comments[encoder.LineComment] = "Part is the part of the request response to extract data from." - - EXTRACTORSExtractorDoc.Fields[9].AddExample("", "body") - - EXTRACTORSExtractorDoc.Fields[9].AddExample("", "raw") - EXTRACTORSExtractorDoc.Fields[10].Name = "internal" - EXTRACTORSExtractorDoc.Fields[10].Type = "bool" - EXTRACTORSExtractorDoc.Fields[10].Note = "" - EXTRACTORSExtractorDoc.Fields[10].Description = "Internal, when set to true will allow using the value extracted\nin the next request for some protocols (like HTTP)." - EXTRACTORSExtractorDoc.Fields[10].Comments[encoder.LineComment] = "Internal, when set to true will allow using the value extracted" - EXTRACTORSExtractorDoc.Fields[11].Name = "case-insensitive" - EXTRACTORSExtractorDoc.Fields[11].Type = "bool" - EXTRACTORSExtractorDoc.Fields[11].Note = "" - EXTRACTORSExtractorDoc.Fields[11].Description = "CaseInsensitive enables case-insensitive extractions. Default is false." - EXTRACTORSExtractorDoc.Fields[11].Comments[encoder.LineComment] = "CaseInsensitive enables case-insensitive extractions. Default is false." - EXTRACTORSExtractorDoc.Fields[11].Values = []string{ - "false", - "true", - } - - ExtractorTypeHolderDoc.Type = "ExtractorTypeHolder" - ExtractorTypeHolderDoc.Comments[encoder.LineComment] = " ExtractorTypeHolder is used to hold internal type of the extractor" - ExtractorTypeHolderDoc.Description = "ExtractorTypeHolder is used to hold internal type of the extractor" - ExtractorTypeHolderDoc.AppearsIn = []encoder.Appearance{ - { - TypeName: "extractors.Extractor", - FieldName: "type", - }, - } - ExtractorTypeHolderDoc.Fields = make([]encoder.Doc, 1) - ExtractorTypeHolderDoc.Fields[0].Name = "" - ExtractorTypeHolderDoc.Fields[0].Type = "ExtractorType" - ExtractorTypeHolderDoc.Fields[0].Note = "" - ExtractorTypeHolderDoc.Fields[0].Description = "" - ExtractorTypeHolderDoc.Fields[0].Comments[encoder.LineComment] = "" - ExtractorTypeHolderDoc.Fields[0].EnumFields = []string{ - "regex", - "kval", - "xpath", - "json", - "dsl", - } + HTTPRequestDoc.Fields[29].Description = "DigestAuthPassword specifies the password for digest authentication" + HTTPRequestDoc.Fields[29].Comments[encoder.LineComment] = "DigestAuthPassword specifies the password for digest authentication" GENERATORSAttackTypeHolderDoc.Type = "generators.AttackTypeHolder" GENERATORSAttackTypeHolderDoc.Comments[encoder.LineComment] = " AttackTypeHolder is used to hold internal type of the protocol" @@ -1129,49 +779,30 @@ func init() { Value: "Trace contains trace data for DNS request if enabled", }, } - DNSRequestDoc.Fields = make([]encoder.Doc, 12) - DNSRequestDoc.Fields[0].Name = "matchers" - DNSRequestDoc.Fields[0].Type = "[]matchers.Matcher" + DNSRequestDoc.Fields = make([]encoder.Doc, 9) + DNSRequestDoc.Fields[0].Name = "id" + DNSRequestDoc.Fields[0].Type = "string" DNSRequestDoc.Fields[0].Note = "" - DNSRequestDoc.Fields[0].Description = "Matchers contains the detection mechanism for the request to identify\nwhether the request was successful by doing pattern matching\non request/responses.\n\nMultiple matchers can be combined with `matcher-condition` flag\nwhich accepts either `and` or `or` as argument." - DNSRequestDoc.Fields[0].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify" - DNSRequestDoc.Fields[1].Name = "extractors" - DNSRequestDoc.Fields[1].Type = "[]extractors.Extractor" + DNSRequestDoc.Fields[0].Description = "ID is the optional id of the request" + DNSRequestDoc.Fields[0].Comments[encoder.LineComment] = " ID is the optional id of the request" + DNSRequestDoc.Fields[1].Name = "name" + DNSRequestDoc.Fields[1].Type = "string" DNSRequestDoc.Fields[1].Note = "" - DNSRequestDoc.Fields[1].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response." - DNSRequestDoc.Fields[1].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify" - DNSRequestDoc.Fields[2].Name = "matchers-condition" - DNSRequestDoc.Fields[2].Type = "string" + DNSRequestDoc.Fields[1].Description = "Name is the Hostname to make DNS request for.\n\nGenerally, it is set to {{FQDN}} which is the domain we get from input." + DNSRequestDoc.Fields[1].Comments[encoder.LineComment] = "Name is the Hostname to make DNS request for." + + DNSRequestDoc.Fields[1].AddExample("", "{{FQDN}}") + DNSRequestDoc.Fields[2].Name = "type" + DNSRequestDoc.Fields[2].Type = "DNSRequestTypeHolder" DNSRequestDoc.Fields[2].Note = "" - DNSRequestDoc.Fields[2].Description = "MatchersCondition is the condition between the matchers. Default is OR." - DNSRequestDoc.Fields[2].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR." - DNSRequestDoc.Fields[2].Values = []string{ - "and", - "or", - } - DNSRequestDoc.Fields[3].Name = "id" + DNSRequestDoc.Fields[2].Description = "RequestType is the type of DNS request to make." + DNSRequestDoc.Fields[2].Comments[encoder.LineComment] = "RequestType is the type of DNS request to make." + DNSRequestDoc.Fields[3].Name = "class" DNSRequestDoc.Fields[3].Type = "string" DNSRequestDoc.Fields[3].Note = "" - DNSRequestDoc.Fields[3].Description = "ID is the optional id of the request" - DNSRequestDoc.Fields[3].Comments[encoder.LineComment] = " ID is the optional id of the request" - DNSRequestDoc.Fields[4].Name = "name" - DNSRequestDoc.Fields[4].Type = "string" - DNSRequestDoc.Fields[4].Note = "" - DNSRequestDoc.Fields[4].Description = "Name is the Hostname to make DNS request for.\n\nGenerally, it is set to {{FQDN}} which is the domain we get from input." - DNSRequestDoc.Fields[4].Comments[encoder.LineComment] = "Name is the Hostname to make DNS request for." - - DNSRequestDoc.Fields[4].AddExample("", "{{FQDN}}") - DNSRequestDoc.Fields[5].Name = "type" - DNSRequestDoc.Fields[5].Type = "DNSRequestTypeHolder" - DNSRequestDoc.Fields[5].Note = "" - DNSRequestDoc.Fields[5].Description = "RequestType is the type of DNS request to make." - DNSRequestDoc.Fields[5].Comments[encoder.LineComment] = "RequestType is the type of DNS request to make." - DNSRequestDoc.Fields[6].Name = "class" - DNSRequestDoc.Fields[6].Type = "string" - DNSRequestDoc.Fields[6].Note = "" - DNSRequestDoc.Fields[6].Description = "Class is the class of the DNS request.\n\nUsually it's enough to just leave it as INET." - DNSRequestDoc.Fields[6].Comments[encoder.LineComment] = "Class is the class of the DNS request." - DNSRequestDoc.Fields[6].Values = []string{ + DNSRequestDoc.Fields[3].Description = "Class is the class of the DNS request.\n\nUsually it's enough to just leave it as INET." + DNSRequestDoc.Fields[3].Comments[encoder.LineComment] = "Class is the class of the DNS request." + DNSRequestDoc.Fields[3].Values = []string{ "inet", "csnet", "chaos", @@ -1179,35 +810,35 @@ func init() { "none", "any", } - DNSRequestDoc.Fields[7].Name = "retries" - DNSRequestDoc.Fields[7].Type = "int" + DNSRequestDoc.Fields[4].Name = "retries" + DNSRequestDoc.Fields[4].Type = "int" + DNSRequestDoc.Fields[4].Note = "" + DNSRequestDoc.Fields[4].Description = "Retries is the number of retries for the DNS request" + DNSRequestDoc.Fields[4].Comments[encoder.LineComment] = "Retries is the number of retries for the DNS request" + + DNSRequestDoc.Fields[4].AddExample("Use a retry of 3 to 5 generally", 5) + DNSRequestDoc.Fields[5].Name = "trace" + DNSRequestDoc.Fields[5].Type = "bool" + DNSRequestDoc.Fields[5].Note = "" + DNSRequestDoc.Fields[5].Description = "Trace performs a trace operation for the target." + DNSRequestDoc.Fields[5].Comments[encoder.LineComment] = "Trace performs a trace operation for the target." + DNSRequestDoc.Fields[6].Name = "trace-max-recursion" + DNSRequestDoc.Fields[6].Type = "int" + DNSRequestDoc.Fields[6].Note = "" + DNSRequestDoc.Fields[6].Description = "TraceMaxRecursion is the number of max recursion allowed for trace operations" + DNSRequestDoc.Fields[6].Comments[encoder.LineComment] = "TraceMaxRecursion is the number of max recursion allowed for trace operations" + + DNSRequestDoc.Fields[6].AddExample("Use a retry of 100 to 150 generally", 100) + DNSRequestDoc.Fields[7].Name = "recursion" + DNSRequestDoc.Fields[7].Type = "dns.bool" DNSRequestDoc.Fields[7].Note = "" - DNSRequestDoc.Fields[7].Description = "Retries is the number of retries for the DNS request" - DNSRequestDoc.Fields[7].Comments[encoder.LineComment] = "Retries is the number of retries for the DNS request" - - DNSRequestDoc.Fields[7].AddExample("Use a retry of 3 to 5 generally", 5) - DNSRequestDoc.Fields[8].Name = "trace" - DNSRequestDoc.Fields[8].Type = "bool" + DNSRequestDoc.Fields[7].Description = "Recursion determines if resolver should recurse all records to get fresh results." + DNSRequestDoc.Fields[7].Comments[encoder.LineComment] = "Recursion determines if resolver should recurse all records to get fresh results." + DNSRequestDoc.Fields[8].Name = "resolvers" + DNSRequestDoc.Fields[8].Type = "[]string" DNSRequestDoc.Fields[8].Note = "" - DNSRequestDoc.Fields[8].Description = "Trace performs a trace operation for the target." - DNSRequestDoc.Fields[8].Comments[encoder.LineComment] = "Trace performs a trace operation for the target." - DNSRequestDoc.Fields[9].Name = "trace-max-recursion" - DNSRequestDoc.Fields[9].Type = "int" - DNSRequestDoc.Fields[9].Note = "" - DNSRequestDoc.Fields[9].Description = "TraceMaxRecursion is the number of max recursion allowed for trace operations" - DNSRequestDoc.Fields[9].Comments[encoder.LineComment] = "TraceMaxRecursion is the number of max recursion allowed for trace operations" - - DNSRequestDoc.Fields[9].AddExample("Use a retry of 100 to 150 generally", 100) - DNSRequestDoc.Fields[10].Name = "recursion" - DNSRequestDoc.Fields[10].Type = "dns.bool" - DNSRequestDoc.Fields[10].Note = "" - DNSRequestDoc.Fields[10].Description = "Recursion determines if resolver should recurse all records to get fresh results." - DNSRequestDoc.Fields[10].Comments[encoder.LineComment] = "Recursion determines if resolver should recurse all records to get fresh results." - DNSRequestDoc.Fields[11].Name = "resolvers" - DNSRequestDoc.Fields[11].Type = "[]string" - DNSRequestDoc.Fields[11].Note = "" - DNSRequestDoc.Fields[11].Description = "Resolvers to use for the dns requests" - DNSRequestDoc.Fields[11].Comments[encoder.LineComment] = " Resolvers to use for the dns requests" + DNSRequestDoc.Fields[8].Description = "Resolvers to use for the dns requests" + DNSRequestDoc.Fields[8].Comments[encoder.LineComment] = " Resolvers to use for the dns requests" DNSRequestTypeHolderDoc.Type = "DNSRequestTypeHolder" DNSRequestTypeHolderDoc.Comments[encoder.LineComment] = " DNSRequestTypeHolder is used to hold internal type of the DNS type" @@ -1279,57 +910,38 @@ func init() { Value: "Raw contains the raw file contents", }, } - FILERequestDoc.Fields = make([]encoder.Doc, 8) - FILERequestDoc.Fields[0].Name = "matchers" - FILERequestDoc.Fields[0].Type = "[]matchers.Matcher" + FILERequestDoc.Fields = make([]encoder.Doc, 5) + FILERequestDoc.Fields[0].Name = "extensions" + FILERequestDoc.Fields[0].Type = "[]string" FILERequestDoc.Fields[0].Note = "" - FILERequestDoc.Fields[0].Description = "Matchers contains the detection mechanism for the request to identify\nwhether the request was successful by doing pattern matching\non request/responses.\n\nMultiple matchers can be combined with `matcher-condition` flag\nwhich accepts either `and` or `or` as argument." - FILERequestDoc.Fields[0].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify" - FILERequestDoc.Fields[1].Name = "extractors" - FILERequestDoc.Fields[1].Type = "[]extractors.Extractor" + FILERequestDoc.Fields[0].Description = "Extensions is the list of extensions or mime types to perform matching on." + FILERequestDoc.Fields[0].Comments[encoder.LineComment] = "Extensions is the list of extensions or mime types to perform matching on." + + FILERequestDoc.Fields[0].AddExample("", []string{".txt", ".go", ".json"}) + FILERequestDoc.Fields[1].Name = "denylist" + FILERequestDoc.Fields[1].Type = "[]string" FILERequestDoc.Fields[1].Note = "" - FILERequestDoc.Fields[1].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response." - FILERequestDoc.Fields[1].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify" - FILERequestDoc.Fields[2].Name = "matchers-condition" + FILERequestDoc.Fields[1].Description = "DenyList is the list of file, directories, mime types or extensions to deny during matching.\n\nBy default, it contains some non-interesting extensions that are hardcoded\nin nuclei." + FILERequestDoc.Fields[1].Comments[encoder.LineComment] = "DenyList is the list of file, directories, mime types or extensions to deny during matching." + + FILERequestDoc.Fields[1].AddExample("", []string{".avi", ".mov", ".mp3"}) + FILERequestDoc.Fields[2].Name = "id" FILERequestDoc.Fields[2].Type = "string" FILERequestDoc.Fields[2].Note = "" - FILERequestDoc.Fields[2].Description = "MatchersCondition is the condition between the matchers. Default is OR." - FILERequestDoc.Fields[2].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR." - FILERequestDoc.Fields[2].Values = []string{ - "and", - "or", - } - FILERequestDoc.Fields[3].Name = "extensions" - FILERequestDoc.Fields[3].Type = "[]string" + FILERequestDoc.Fields[2].Description = "ID is the optional id of the request" + FILERequestDoc.Fields[2].Comments[encoder.LineComment] = " ID is the optional id of the request" + FILERequestDoc.Fields[3].Name = "max-size" + FILERequestDoc.Fields[3].Type = "string" FILERequestDoc.Fields[3].Note = "" - FILERequestDoc.Fields[3].Description = "Extensions is the list of extensions or mime types to perform matching on." - FILERequestDoc.Fields[3].Comments[encoder.LineComment] = "Extensions is the list of extensions or mime types to perform matching on." + FILERequestDoc.Fields[3].Description = "MaxSize is the maximum size of the file to run request on.\n\nBy default, nuclei will process 1 GB of content and not go more than that.\nIt can be set to much lower or higher depending on use.\nIf set to \"no\" then all content will be processed" + FILERequestDoc.Fields[3].Comments[encoder.LineComment] = "MaxSize is the maximum size of the file to run request on." - FILERequestDoc.Fields[3].AddExample("", []string{".txt", ".go", ".json"}) - FILERequestDoc.Fields[4].Name = "denylist" - FILERequestDoc.Fields[4].Type = "[]string" + FILERequestDoc.Fields[3].AddExample("", "5Mb") + FILERequestDoc.Fields[4].Name = "no-recursive" + FILERequestDoc.Fields[4].Type = "bool" FILERequestDoc.Fields[4].Note = "" - FILERequestDoc.Fields[4].Description = "DenyList is the list of file, directories, mime types or extensions to deny during matching.\n\nBy default, it contains some non-interesting extensions that are hardcoded\nin nuclei." - FILERequestDoc.Fields[4].Comments[encoder.LineComment] = "DenyList is the list of file, directories, mime types or extensions to deny during matching." - - FILERequestDoc.Fields[4].AddExample("", []string{".avi", ".mov", ".mp3"}) - FILERequestDoc.Fields[5].Name = "id" - FILERequestDoc.Fields[5].Type = "string" - FILERequestDoc.Fields[5].Note = "" - FILERequestDoc.Fields[5].Description = "ID is the optional id of the request" - FILERequestDoc.Fields[5].Comments[encoder.LineComment] = " ID is the optional id of the request" - FILERequestDoc.Fields[6].Name = "max-size" - FILERequestDoc.Fields[6].Type = "string" - FILERequestDoc.Fields[6].Note = "" - FILERequestDoc.Fields[6].Description = "MaxSize is the maximum size of the file to run request on.\n\nBy default, nuclei will process 1 GB of content and not go more than that.\nIt can be set to much lower or higher depending on use.\nIf set to \"no\" then all content will be processed" - FILERequestDoc.Fields[6].Comments[encoder.LineComment] = "MaxSize is the maximum size of the file to run request on." - - FILERequestDoc.Fields[6].AddExample("", "5Mb") - FILERequestDoc.Fields[7].Name = "no-recursive" - FILERequestDoc.Fields[7].Type = "bool" - FILERequestDoc.Fields[7].Note = "" - FILERequestDoc.Fields[7].Description = "NoRecursive specifies whether to not do recursive checks if folders are provided." - FILERequestDoc.Fields[7].Comments[encoder.LineComment] = "NoRecursive specifies whether to not do recursive checks if folders are provided." + FILERequestDoc.Fields[4].Description = "NoRecursive specifies whether to not do recursive checks if folders are provided." + FILERequestDoc.Fields[4].Comments[encoder.LineComment] = "NoRecursive specifies whether to not do recursive checks if folders are provided." NETWORKRequestDoc.Type = "network.Request" NETWORKRequestDoc.Comments[encoder.LineComment] = " Request contains a Network protocol request to be made from a template" @@ -1380,7 +992,7 @@ func init() { Value: "Full Network protocol data", }, } - NETWORKRequestDoc.Fields = make([]encoder.Doc, 10) + NETWORKRequestDoc.Fields = make([]encoder.Doc, 7) NETWORKRequestDoc.Fields[0].Name = "id" NETWORKRequestDoc.Fields[0].Type = "string" NETWORKRequestDoc.Fields[0].Note = "" @@ -1422,25 +1034,6 @@ func init() { NETWORKRequestDoc.Fields[6].Comments[encoder.LineComment] = "ReadAll determines if the data stream should be read till the end regardless of the size" NETWORKRequestDoc.Fields[6].AddExample("", false) - NETWORKRequestDoc.Fields[7].Name = "matchers" - NETWORKRequestDoc.Fields[7].Type = "[]matchers.Matcher" - NETWORKRequestDoc.Fields[7].Note = "" - NETWORKRequestDoc.Fields[7].Description = "Matchers contains the detection mechanism for the request to identify\nwhether the request was successful by doing pattern matching\non request/responses.\n\nMultiple matchers can be combined with `matcher-condition` flag\nwhich accepts either `and` or `or` as argument." - NETWORKRequestDoc.Fields[7].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify" - NETWORKRequestDoc.Fields[8].Name = "extractors" - NETWORKRequestDoc.Fields[8].Type = "[]extractors.Extractor" - NETWORKRequestDoc.Fields[8].Note = "" - NETWORKRequestDoc.Fields[8].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response." - NETWORKRequestDoc.Fields[8].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify" - NETWORKRequestDoc.Fields[9].Name = "matchers-condition" - NETWORKRequestDoc.Fields[9].Type = "string" - NETWORKRequestDoc.Fields[9].Note = "" - NETWORKRequestDoc.Fields[9].Description = "MatchersCondition is the condition between the matchers. Default is OR." - NETWORKRequestDoc.Fields[9].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR." - NETWORKRequestDoc.Fields[9].Values = []string{ - "and", - "or", - } NETWORKInputDoc.Type = "network.Input" NETWORKInputDoc.Comments[encoder.LineComment] = "" @@ -1548,7 +1141,7 @@ func init() { Value: "Headless response received from client (default)", }, } - HEADLESSRequestDoc.Fields = make([]encoder.Doc, 10) + HEADLESSRequestDoc.Fields = make([]encoder.Doc, 7) HEADLESSRequestDoc.Fields[0].Name = "id" HEADLESSRequestDoc.Fields[0].Type = "string" HEADLESSRequestDoc.Fields[0].Note = "" @@ -1584,25 +1177,6 @@ func init() { HEADLESSRequestDoc.Fields[6].Note = "" HEADLESSRequestDoc.Fields[6].Description = "StopAtFirstMatch stops the execution of the requests and template as soon as a match is found." HEADLESSRequestDoc.Fields[6].Comments[encoder.LineComment] = "StopAtFirstMatch stops the execution of the requests and template as soon as a match is found." - HEADLESSRequestDoc.Fields[7].Name = "matchers" - HEADLESSRequestDoc.Fields[7].Type = "[]matchers.Matcher" - HEADLESSRequestDoc.Fields[7].Note = "" - HEADLESSRequestDoc.Fields[7].Description = "Matchers contains the detection mechanism for the request to identify\nwhether the request was successful by doing pattern matching\non request/responses.\n\nMultiple matchers can be combined with `matcher-condition` flag\nwhich accepts either `and` or `or` as argument." - HEADLESSRequestDoc.Fields[7].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify" - HEADLESSRequestDoc.Fields[8].Name = "extractors" - HEADLESSRequestDoc.Fields[8].Type = "[]extractors.Extractor" - HEADLESSRequestDoc.Fields[8].Note = "" - HEADLESSRequestDoc.Fields[8].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response." - HEADLESSRequestDoc.Fields[8].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify" - HEADLESSRequestDoc.Fields[9].Name = "matchers-condition" - HEADLESSRequestDoc.Fields[9].Type = "string" - HEADLESSRequestDoc.Fields[9].Note = "" - HEADLESSRequestDoc.Fields[9].Description = "MatchersCondition is the condition between the matchers. Default is OR." - HEADLESSRequestDoc.Fields[9].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR." - HEADLESSRequestDoc.Fields[9].Values = []string{ - "and", - "or", - } ENGINEActionDoc.Type = "engine.Action" ENGINEActionDoc.Comments[encoder.LineComment] = " Action is an action taken by the browser to reach a navigation" @@ -1728,70 +1302,46 @@ func init() { Value: "Matched is the input which was matched upon", }, } - SSLRequestDoc.Fields = make([]encoder.Doc, 8) - SSLRequestDoc.Fields[0].Name = "matchers" - SSLRequestDoc.Fields[0].Type = "[]matchers.Matcher" + SSLRequestDoc.Fields = make([]encoder.Doc, 5) + SSLRequestDoc.Fields[0].Name = "address" + SSLRequestDoc.Fields[0].Type = "string" SSLRequestDoc.Fields[0].Note = "" - SSLRequestDoc.Fields[0].Description = "Matchers contains the detection mechanism for the request to identify\nwhether the request was successful by doing pattern matching\non request/responses.\n\nMultiple matchers can be combined with `matcher-condition` flag\nwhich accepts either `and` or `or` as argument." - SSLRequestDoc.Fields[0].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify" - SSLRequestDoc.Fields[1].Name = "extractors" - SSLRequestDoc.Fields[1].Type = "[]extractors.Extractor" + SSLRequestDoc.Fields[0].Description = "Address contains address for the request" + SSLRequestDoc.Fields[0].Comments[encoder.LineComment] = "Address contains address for the request" + SSLRequestDoc.Fields[1].Name = "min_version" + SSLRequestDoc.Fields[1].Type = "string" SSLRequestDoc.Fields[1].Note = "" - SSLRequestDoc.Fields[1].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response." - SSLRequestDoc.Fields[1].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify" - SSLRequestDoc.Fields[2].Name = "matchers-condition" + SSLRequestDoc.Fields[1].Description = "Minimum tls version - auto if not specified." + SSLRequestDoc.Fields[1].Comments[encoder.LineComment] = "Minimum tls version - auto if not specified." + SSLRequestDoc.Fields[1].Values = []string{ + "sslv3", + "tls10", + "tls11", + "tls12", + "tls13", + } + SSLRequestDoc.Fields[2].Name = "max_version" SSLRequestDoc.Fields[2].Type = "string" SSLRequestDoc.Fields[2].Note = "" - SSLRequestDoc.Fields[2].Description = "MatchersCondition is the condition between the matchers. Default is OR." - SSLRequestDoc.Fields[2].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR." + SSLRequestDoc.Fields[2].Description = "Max tls version - auto if not specified." + SSLRequestDoc.Fields[2].Comments[encoder.LineComment] = "Max tls version - auto if not specified." SSLRequestDoc.Fields[2].Values = []string{ - "and", - "or", + "sslv3", + "tls10", + "tls11", + "tls12", + "tls13", } - SSLRequestDoc.Fields[3].Name = "address" - SSLRequestDoc.Fields[3].Type = "string" + SSLRequestDoc.Fields[3].Name = "cipher_suites" + SSLRequestDoc.Fields[3].Type = "[]string" SSLRequestDoc.Fields[3].Note = "" - SSLRequestDoc.Fields[3].Description = "Address contains address for the request" - SSLRequestDoc.Fields[3].Comments[encoder.LineComment] = "Address contains address for the request" - SSLRequestDoc.Fields[4].Name = "min_version" + SSLRequestDoc.Fields[3].Description = "Client Cipher Suites - auto if not specified." + SSLRequestDoc.Fields[3].Comments[encoder.LineComment] = "Client Cipher Suites - auto if not specified." + SSLRequestDoc.Fields[4].Name = "scan_mode" SSLRequestDoc.Fields[4].Type = "string" SSLRequestDoc.Fields[4].Note = "" - SSLRequestDoc.Fields[4].Description = "Minimum tls version - auto if not specified." - SSLRequestDoc.Fields[4].Comments[encoder.LineComment] = "Minimum tls version - auto if not specified." - SSLRequestDoc.Fields[4].Values = []string{ - "sslv3", - "tls10", - "tls11", - "tls12", - "tls13", - } - SSLRequestDoc.Fields[5].Name = "max_version" - SSLRequestDoc.Fields[5].Type = "string" - SSLRequestDoc.Fields[5].Note = "" - SSLRequestDoc.Fields[5].Description = "Max tls version - auto if not specified." - SSLRequestDoc.Fields[5].Comments[encoder.LineComment] = "Max tls version - auto if not specified." - SSLRequestDoc.Fields[5].Values = []string{ - "sslv3", - "tls10", - "tls11", - "tls12", - "tls13", - } - SSLRequestDoc.Fields[6].Name = "cipher_suites" - SSLRequestDoc.Fields[6].Type = "[]string" - SSLRequestDoc.Fields[6].Note = "" - SSLRequestDoc.Fields[6].Description = "Client Cipher Suites - auto if not specified." - SSLRequestDoc.Fields[6].Comments[encoder.LineComment] = "Client Cipher Suites - auto if not specified." - SSLRequestDoc.Fields[7].Name = "scan_mode" - SSLRequestDoc.Fields[7].Type = "string" - SSLRequestDoc.Fields[7].Note = "" - SSLRequestDoc.Fields[7].Description = "Tls Scan Mode - auto if not specified" - SSLRequestDoc.Fields[7].Comments[encoder.LineComment] = "Tls Scan Mode - auto if not specified" - SSLRequestDoc.Fields[7].Values = []string{ - "ctls", - "ztls", - "auto", - } + SSLRequestDoc.Fields[4].Description = "description: |\n Tls Scan Mode - auto if not specified\n values:\n - \"ctls\"\n - \"ztls\"\n - \"auto\"\n - \"openssl\" # reverts to \"auto\" is openssl is not installed" + SSLRequestDoc.Fields[4].Comments[encoder.LineComment] = " description: |" WEBSOCKETRequestDoc.Type = "websocket.Request" WEBSOCKETRequestDoc.Comments[encoder.LineComment] = " Request is a request for the Websocket protocol" @@ -1828,51 +1378,32 @@ func init() { Value: "Matched is the input which was matched upon", }, } - WEBSOCKETRequestDoc.Fields = make([]encoder.Doc, 8) - WEBSOCKETRequestDoc.Fields[0].Name = "matchers" - WEBSOCKETRequestDoc.Fields[0].Type = "[]matchers.Matcher" + WEBSOCKETRequestDoc.Fields = make([]encoder.Doc, 5) + WEBSOCKETRequestDoc.Fields[0].Name = "address" + WEBSOCKETRequestDoc.Fields[0].Type = "string" WEBSOCKETRequestDoc.Fields[0].Note = "" - WEBSOCKETRequestDoc.Fields[0].Description = "Matchers contains the detection mechanism for the request to identify\nwhether the request was successful by doing pattern matching\non request/responses.\n\nMultiple matchers can be combined with `matcher-condition` flag\nwhich accepts either `and` or `or` as argument." - WEBSOCKETRequestDoc.Fields[0].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify" - WEBSOCKETRequestDoc.Fields[1].Name = "extractors" - WEBSOCKETRequestDoc.Fields[1].Type = "[]extractors.Extractor" + WEBSOCKETRequestDoc.Fields[0].Description = "Address contains address for the request" + WEBSOCKETRequestDoc.Fields[0].Comments[encoder.LineComment] = "Address contains address for the request" + WEBSOCKETRequestDoc.Fields[1].Name = "inputs" + WEBSOCKETRequestDoc.Fields[1].Type = "[]websocket.Input" WEBSOCKETRequestDoc.Fields[1].Note = "" - WEBSOCKETRequestDoc.Fields[1].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response." - WEBSOCKETRequestDoc.Fields[1].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify" - WEBSOCKETRequestDoc.Fields[2].Name = "matchers-condition" - WEBSOCKETRequestDoc.Fields[2].Type = "string" + WEBSOCKETRequestDoc.Fields[1].Description = "Inputs contains inputs for the websocket protocol" + WEBSOCKETRequestDoc.Fields[1].Comments[encoder.LineComment] = "Inputs contains inputs for the websocket protocol" + WEBSOCKETRequestDoc.Fields[2].Name = "headers" + WEBSOCKETRequestDoc.Fields[2].Type = "map[string]string" WEBSOCKETRequestDoc.Fields[2].Note = "" - WEBSOCKETRequestDoc.Fields[2].Description = "MatchersCondition is the condition between the matchers. Default is OR." - WEBSOCKETRequestDoc.Fields[2].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR." - WEBSOCKETRequestDoc.Fields[2].Values = []string{ - "and", - "or", - } - WEBSOCKETRequestDoc.Fields[3].Name = "address" - WEBSOCKETRequestDoc.Fields[3].Type = "string" + WEBSOCKETRequestDoc.Fields[2].Description = "Headers contains headers for the request." + WEBSOCKETRequestDoc.Fields[2].Comments[encoder.LineComment] = "Headers contains headers for the request." + WEBSOCKETRequestDoc.Fields[3].Name = "attack" + WEBSOCKETRequestDoc.Fields[3].Type = "generators.AttackTypeHolder" WEBSOCKETRequestDoc.Fields[3].Note = "" - WEBSOCKETRequestDoc.Fields[3].Description = "Address contains address for the request" - WEBSOCKETRequestDoc.Fields[3].Comments[encoder.LineComment] = "Address contains address for the request" - WEBSOCKETRequestDoc.Fields[4].Name = "inputs" - WEBSOCKETRequestDoc.Fields[4].Type = "[]websocket.Input" + WEBSOCKETRequestDoc.Fields[3].Description = "Attack is the type of payload combinations to perform.\n\nSniper is each payload once, pitchfork combines multiple payload sets and clusterbomb generates\npermutations and combinations for all payloads." + WEBSOCKETRequestDoc.Fields[3].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform." + WEBSOCKETRequestDoc.Fields[4].Name = "payloads" + WEBSOCKETRequestDoc.Fields[4].Type = "map[string]interface{}" WEBSOCKETRequestDoc.Fields[4].Note = "" - WEBSOCKETRequestDoc.Fields[4].Description = "Inputs contains inputs for the websocket protocol" - WEBSOCKETRequestDoc.Fields[4].Comments[encoder.LineComment] = "Inputs contains inputs for the websocket protocol" - WEBSOCKETRequestDoc.Fields[5].Name = "headers" - WEBSOCKETRequestDoc.Fields[5].Type = "map[string]string" - WEBSOCKETRequestDoc.Fields[5].Note = "" - WEBSOCKETRequestDoc.Fields[5].Description = "Headers contains headers for the request." - WEBSOCKETRequestDoc.Fields[5].Comments[encoder.LineComment] = "Headers contains headers for the request." - WEBSOCKETRequestDoc.Fields[6].Name = "attack" - WEBSOCKETRequestDoc.Fields[6].Type = "generators.AttackTypeHolder" - WEBSOCKETRequestDoc.Fields[6].Note = "" - WEBSOCKETRequestDoc.Fields[6].Description = "Attack is the type of payload combinations to perform.\n\nSniper is each payload once, pitchfork combines multiple payload sets and clusterbomb generates\npermutations and combinations for all payloads." - WEBSOCKETRequestDoc.Fields[6].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform." - WEBSOCKETRequestDoc.Fields[7].Name = "payloads" - WEBSOCKETRequestDoc.Fields[7].Type = "map[string]interface{}" - WEBSOCKETRequestDoc.Fields[7].Note = "" - WEBSOCKETRequestDoc.Fields[7].Description = "Payloads contains any payloads for the current request.\n\nPayloads support both key-values combinations where a list\nof payloads is provided, or optionally a single file can also\nbe provided as payload which will be read on run-time." - WEBSOCKETRequestDoc.Fields[7].Comments[encoder.LineComment] = "Payloads contains any payloads for the current request." + WEBSOCKETRequestDoc.Fields[4].Description = "Payloads contains any payloads for the current request.\n\nPayloads support both key-values combinations where a list\nof payloads is provided, or optionally a single file can also\nbe provided as payload which will be read on run-time." + WEBSOCKETRequestDoc.Fields[4].Comments[encoder.LineComment] = "Payloads contains any payloads for the current request." WEBSOCKETInputDoc.Type = "websocket.Input" WEBSOCKETInputDoc.Comments[encoder.LineComment] = "" @@ -1910,109 +1441,17 @@ func init() { FieldName: "whois", }, } - WHOISRequestDoc.Fields = make([]encoder.Doc, 5) - WHOISRequestDoc.Fields[0].Name = "matchers" - WHOISRequestDoc.Fields[0].Type = "[]matchers.Matcher" + WHOISRequestDoc.Fields = make([]encoder.Doc, 2) + WHOISRequestDoc.Fields[0].Name = "query" + WHOISRequestDoc.Fields[0].Type = "string" WHOISRequestDoc.Fields[0].Note = "" - WHOISRequestDoc.Fields[0].Description = "Matchers contains the detection mechanism for the request to identify\nwhether the request was successful by doing pattern matching\non request/responses.\n\nMultiple matchers can be combined with `matcher-condition` flag\nwhich accepts either `and` or `or` as argument." - WHOISRequestDoc.Fields[0].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify" - WHOISRequestDoc.Fields[1].Name = "extractors" - WHOISRequestDoc.Fields[1].Type = "[]extractors.Extractor" + WHOISRequestDoc.Fields[0].Description = "Query contains query for the request" + WHOISRequestDoc.Fields[0].Comments[encoder.LineComment] = "Query contains query for the request" + WHOISRequestDoc.Fields[1].Name = "server" + WHOISRequestDoc.Fields[1].Type = "string" WHOISRequestDoc.Fields[1].Note = "" - WHOISRequestDoc.Fields[1].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response." - WHOISRequestDoc.Fields[1].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify" - WHOISRequestDoc.Fields[2].Name = "matchers-condition" - WHOISRequestDoc.Fields[2].Type = "string" - WHOISRequestDoc.Fields[2].Note = "" - WHOISRequestDoc.Fields[2].Description = "MatchersCondition is the condition between the matchers. Default is OR." - WHOISRequestDoc.Fields[2].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR." - WHOISRequestDoc.Fields[2].Values = []string{ - "and", - "or", - } - WHOISRequestDoc.Fields[3].Name = "query" - WHOISRequestDoc.Fields[3].Type = "string" - WHOISRequestDoc.Fields[3].Note = "" - WHOISRequestDoc.Fields[3].Description = "Query contains query for the request" - WHOISRequestDoc.Fields[3].Comments[encoder.LineComment] = "Query contains query for the request" - WHOISRequestDoc.Fields[4].Name = "server" - WHOISRequestDoc.Fields[4].Type = "string" - WHOISRequestDoc.Fields[4].Note = "" - WHOISRequestDoc.Fields[4].Description = "description: |\n Optional WHOIS server URL.\n\n If present, specifies the WHOIS server to execute the Request on.\n Otherwise, nil enables bootstrapping" - WHOISRequestDoc.Fields[4].Comments[encoder.LineComment] = " description: |" - - WORKFLOWSWorkflowTemplateDoc.Type = "workflows.WorkflowTemplate" - WORKFLOWSWorkflowTemplateDoc.Comments[encoder.LineComment] = "" - WORKFLOWSWorkflowTemplateDoc.Description = "" - WORKFLOWSWorkflowTemplateDoc.AppearsIn = []encoder.Appearance{ - { - TypeName: "Template", - FieldName: "workflows", - }, - { - TypeName: "workflows.WorkflowTemplate", - FieldName: "subtemplates", - }, - { - TypeName: "workflows.Matcher", - FieldName: "subtemplates", - }, - } - WORKFLOWSWorkflowTemplateDoc.Fields = make([]encoder.Doc, 4) - WORKFLOWSWorkflowTemplateDoc.Fields[0].Name = "template" - WORKFLOWSWorkflowTemplateDoc.Fields[0].Type = "string" - WORKFLOWSWorkflowTemplateDoc.Fields[0].Note = "" - WORKFLOWSWorkflowTemplateDoc.Fields[0].Description = "Template is a single template or directory to execute as part of workflow." - WORKFLOWSWorkflowTemplateDoc.Fields[0].Comments[encoder.LineComment] = "Template is a single template or directory to execute as part of workflow." - - WORKFLOWSWorkflowTemplateDoc.Fields[0].AddExample("A single template", "dns/worksites-detection.yaml") - - WORKFLOWSWorkflowTemplateDoc.Fields[0].AddExample("A template directory", "misconfigurations/aem") - WORKFLOWSWorkflowTemplateDoc.Fields[1].Name = "tags" - WORKFLOWSWorkflowTemplateDoc.Fields[1].Type = "stringslice.StringSlice" - WORKFLOWSWorkflowTemplateDoc.Fields[1].Note = "" - WORKFLOWSWorkflowTemplateDoc.Fields[1].Description = "Tags to run templates based on." - WORKFLOWSWorkflowTemplateDoc.Fields[1].Comments[encoder.LineComment] = "Tags to run templates based on." - WORKFLOWSWorkflowTemplateDoc.Fields[2].Name = "matchers" - WORKFLOWSWorkflowTemplateDoc.Fields[2].Type = "[]workflows.Matcher" - WORKFLOWSWorkflowTemplateDoc.Fields[2].Note = "" - WORKFLOWSWorkflowTemplateDoc.Fields[2].Description = "Matchers perform name based matching to run subtemplates for a workflow." - WORKFLOWSWorkflowTemplateDoc.Fields[2].Comments[encoder.LineComment] = "Matchers perform name based matching to run subtemplates for a workflow." - WORKFLOWSWorkflowTemplateDoc.Fields[3].Name = "subtemplates" - WORKFLOWSWorkflowTemplateDoc.Fields[3].Type = "[]workflows.WorkflowTemplate" - WORKFLOWSWorkflowTemplateDoc.Fields[3].Note = "" - WORKFLOWSWorkflowTemplateDoc.Fields[3].Description = "Subtemplates are run if the `template` field Template matches." - WORKFLOWSWorkflowTemplateDoc.Fields[3].Comments[encoder.LineComment] = "Subtemplates are run if the `template` field Template matches." - - WORKFLOWSMatcherDoc.Type = "workflows.Matcher" - WORKFLOWSMatcherDoc.Comments[encoder.LineComment] = "" - WORKFLOWSMatcherDoc.Description = "" - WORKFLOWSMatcherDoc.AppearsIn = []encoder.Appearance{ - { - TypeName: "workflows.WorkflowTemplate", - FieldName: "matchers", - }, - } - WORKFLOWSMatcherDoc.Fields = make([]encoder.Doc, 3) - WORKFLOWSMatcherDoc.Fields[0].Name = "name" - WORKFLOWSMatcherDoc.Fields[0].Type = "stringslice.StringSlice" - WORKFLOWSMatcherDoc.Fields[0].Note = "" - WORKFLOWSMatcherDoc.Fields[0].Description = "Name is the name of the items to match." - WORKFLOWSMatcherDoc.Fields[0].Comments[encoder.LineComment] = "Name is the name of the items to match." - WORKFLOWSMatcherDoc.Fields[1].Name = "condition" - WORKFLOWSMatcherDoc.Fields[1].Type = "string" - WORKFLOWSMatcherDoc.Fields[1].Note = "" - WORKFLOWSMatcherDoc.Fields[1].Description = "Condition is the optional condition between names. By default,\nthe condition is assumed to be OR." - WORKFLOWSMatcherDoc.Fields[1].Comments[encoder.LineComment] = "Condition is the optional condition between names. By default," - WORKFLOWSMatcherDoc.Fields[1].Values = []string{ - "and", - "or", - } - WORKFLOWSMatcherDoc.Fields[2].Name = "subtemplates" - WORKFLOWSMatcherDoc.Fields[2].Type = "[]workflows.WorkflowTemplate" - WORKFLOWSMatcherDoc.Fields[2].Note = "" - WORKFLOWSMatcherDoc.Fields[2].Description = "Subtemplates are run if the name of matcher matches." - WORKFLOWSMatcherDoc.Fields[2].Comments[encoder.LineComment] = "Subtemplates are run if the name of matcher matches." + WHOISRequestDoc.Fields[1].Description = "description: |\n Optional WHOIS server URL.\n\n If present, specifies the WHOIS server to execute the Request on.\n Otherwise, nil enables bootstrapping" + WHOISRequestDoc.Fields[1].Comments[encoder.LineComment] = " description: |" HTTPSignatureTypeHolderDoc.Type = "http.SignatureTypeHolder" HTTPSignatureTypeHolderDoc.Comments[encoder.LineComment] = " SignatureTypeHolder is used to hold internal type of the signature" @@ -2046,13 +1485,10 @@ func GetTemplateDoc() *encoder.FileDoc { &TemplateDoc, &MODELInfoDoc, &STRINGSLICEStringSliceDoc, + &STRINGSLICERawStringSliceDoc, &SEVERITYHolderDoc, &MODELClassificationDoc, &HTTPRequestDoc, - &MATCHERSMatcherDoc, - &MatcherTypeHolderDoc, - &EXTRACTORSExtractorDoc, - &ExtractorTypeHolderDoc, &GENERATORSAttackTypeHolderDoc, &HTTPMethodTypeHolderDoc, &FUZZRuleDoc, @@ -2071,8 +1507,6 @@ func GetTemplateDoc() *encoder.FileDoc { &WEBSOCKETRequestDoc, &WEBSOCKETInputDoc, &WHOISRequestDoc, - &WORKFLOWSWorkflowTemplateDoc, - &WORKFLOWSMatcherDoc, &HTTPSignatureTypeHolderDoc, &VARIABLESVariableDoc, },