From e995b0ce48679882d49503a9e02e04047d2b94db Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 10 May 2023 21:58:38 +0000 Subject: [PATCH] Auto Generate Syntax Docs + JSONSchema [Wed May 10 21:58:38 UTC 2023] :robot: --- SYNTAX-REFERENCE.md | 35 +++++++++++++++++++++++++++++++ nuclei-jsonschema.json | 15 +++++++++++++ v2/pkg/templates/templates_doc.go | 32 ++++++++++++++++++++-------- 3 files changed, 73 insertions(+), 9 deletions(-) diff --git a/SYNTAX-REFERENCE.md b/SYNTAX-REFERENCE.md index 4aaae9113..b17b2fbca 100755 --- a/SYNTAX-REFERENCE.md +++ b/SYNTAX-REFERENCE.md @@ -1470,6 +1470,8 @@ Appears in: - http.Request.attack +- dns.Request.attack + - network.Request.attack - headless.Request.attack @@ -1949,6 +1951,39 @@ trace-max-recursion: 100 ``` + + +
+ +
+ +attack generators.AttackTypeHolder + +
+
+ +Attack is the type of payload combinations to perform. + +Batteringram is inserts the same payload into all defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates +permutations and combinations for all payloads. + +
+ +
+ +
+ +payloads map[string]interface{} + +
+
+ +Payloads contains any payloads for the current request. + +Payloads support both key-values combinations where a list +of payloads is provided, or optionally a single file can also +be provided as payload which will be read on run-time. +

diff --git a/nuclei-jsonschema.json b/nuclei-jsonschema.json index a89990929..160679bf8 100644 --- a/nuclei-jsonschema.json +++ b/nuclei-jsonschema.json @@ -477,6 +477,21 @@ "title": "trace-max-recursion level for dns request", "description": "TraceMaxRecursion is the number of max recursion allowed for trace operations" }, + "attack": { + "$ref": "#/definitions/generators.AttackTypeHolder", + "title": "attack is the payload combination", + "description": "Attack is the type of payload combinations to perform" + }, + "payloads": { + "patternProperties": { + ".*": { + "additionalProperties": true + } + }, + "type": "object", + "title": "payloads for the network request", + "description": "Payloads contains any payloads for the current request" + }, "recursion": { "type": "boolean", "title": "recurse all servers", diff --git a/v2/pkg/templates/templates_doc.go b/v2/pkg/templates/templates_doc.go index 554780200..7b714220c 100644 --- a/v2/pkg/templates/templates_doc.go +++ b/v2/pkg/templates/templates_doc.go @@ -606,6 +606,10 @@ func init() { TypeName: "http.Request", FieldName: "attack", }, + { + TypeName: "dns.Request", + FieldName: "attack", + }, { TypeName: "network.Request", FieldName: "attack", @@ -807,7 +811,7 @@ func init() { Value: "Trace contains trace data for DNS request if enabled", }, } - DNSRequestDoc.Fields = make([]encoder.Doc, 9) + DNSRequestDoc.Fields = make([]encoder.Doc, 11) DNSRequestDoc.Fields[0].Name = "id" DNSRequestDoc.Fields[0].Type = "string" DNSRequestDoc.Fields[0].Note = "" @@ -857,16 +861,26 @@ func init() { 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].Name = "attack" + DNSRequestDoc.Fields[7].Type = "generators.AttackTypeHolder" DNSRequestDoc.Fields[7].Note = "" - 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[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." + DNSRequestDoc.Fields[7].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform." + DNSRequestDoc.Fields[8].Name = "payloads" + DNSRequestDoc.Fields[8].Type = "map[string]interface{}" DNSRequestDoc.Fields[8].Note = "" - DNSRequestDoc.Fields[8].Description = "Resolvers to use for the dns requests" - DNSRequestDoc.Fields[8].Comments[encoder.LineComment] = " Resolvers to use for the dns requests" + DNSRequestDoc.Fields[8].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." + DNSRequestDoc.Fields[8].Comments[encoder.LineComment] = "Payloads contains any payloads for the current request." + DNSRequestDoc.Fields[9].Name = "recursion" + DNSRequestDoc.Fields[9].Type = "dns.bool" + DNSRequestDoc.Fields[9].Note = "" + DNSRequestDoc.Fields[9].Description = "Recursion determines if resolver should recurse all records to get fresh results." + DNSRequestDoc.Fields[9].Comments[encoder.LineComment] = "Recursion determines if resolver should recurse all records to get fresh results." + DNSRequestDoc.Fields[10].Name = "resolvers" + DNSRequestDoc.Fields[10].Type = "[]string" + DNSRequestDoc.Fields[10].Note = "" + DNSRequestDoc.Fields[10].Description = "Resolvers to use for the dns requests" + DNSRequestDoc.Fields[10].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"