diff --git a/SYNTAX-REFERENCE.md b/SYNTAX-REFERENCE.md index 5980ec5dd..9222e34aa 100755 --- a/SYNTAX-REFERENCE.md +++ b/SYNTAX-REFERENCE.md @@ -1614,12 +1614,12 @@ DisablePathAutomerge disables merging target url path with raw request path
-filters []matchers.Matcher +pre-condition []matchers.Matcher
-Filter is matcher-like field to check if fuzzing should be performed on this request or not +Fuzz PreCondition is matcher-like field to check if fuzzing should be performed on this request or not
@@ -1627,12 +1627,12 @@ Filter is matcher-like field to check if fuzzing should be performed on this req
-filters-condition string +pre-condition-operator string
-Filter condition is the condition to apply on the filter (AND/OR). Default is OR +FuzzPreConditionOperator is the operator between multiple PreConditions for fuzzing Default is OR
@@ -1982,7 +1982,7 @@ Matcher is used to match a part in the output from a protocol. Appears in: -- http.Request.filters +- http.Request.pre-condition @@ -4157,6 +4157,19 @@ Engine type
+pre-condition string + +
+
+ +PreCondition is a condition which is evaluated before sending the request. + +
+ +
+ +
+ args []string
diff --git a/nuclei-jsonschema.json b/nuclei-jsonschema.json index f39d5c89f..0f4c2a8f6 100644 --- a/nuclei-jsonschema.json +++ b/nuclei-jsonschema.json @@ -610,22 +610,22 @@ "title": "disable auto merging of path", "description": "Disable merging target url path with raw request path" }, - "filter": { + "pre-condition": { "items": { "$ref": "#/$defs/Matcher" }, "type": "array", - "title": "filter for fuzzing", - "description": "Filter is matcher-like field to check if fuzzing should be performed on this request or not" + "title": "pre-condition for fuzzing/dast", + "description": "PreCondition is matcher-like field to check if fuzzing should be performed on this request or not" }, - "filter-condition": { + "pre-condition-operator": { "type": "string", "enum": [ "and", "or" ], "title": "condition between the filters", - "description": "Conditions between the filters" + "description": "Operator to use between multiple per-conditions" } }, "additionalProperties": false, diff --git a/pkg/templates/templates_doc.go b/pkg/templates/templates_doc.go index 117331edc..dbd865c4e 100644 --- a/pkg/templates/templates_doc.go +++ b/pkg/templates/templates_doc.go @@ -653,16 +653,16 @@ func init() { HTTPRequestDoc.Fields[32].Note = "" HTTPRequestDoc.Fields[32].Description = "DisablePathAutomerge disables merging target url path with raw request path" HTTPRequestDoc.Fields[32].Comments[encoder.LineComment] = "DisablePathAutomerge disables merging target url path with raw request path" - HTTPRequestDoc.Fields[33].Name = "filters" + HTTPRequestDoc.Fields[33].Name = "pre-condition" HTTPRequestDoc.Fields[33].Type = "[]matchers.Matcher" HTTPRequestDoc.Fields[33].Note = "" - HTTPRequestDoc.Fields[33].Description = "Filter is matcher-like field to check if fuzzing should be performed on this request or not" - HTTPRequestDoc.Fields[33].Comments[encoder.LineComment] = "Filter is matcher-like field to check if fuzzing should be performed on this request or not" - HTTPRequestDoc.Fields[34].Name = "filters-condition" + HTTPRequestDoc.Fields[33].Description = "Fuzz PreCondition is matcher-like field to check if fuzzing should be performed on this request or not" + HTTPRequestDoc.Fields[33].Comments[encoder.LineComment] = "Fuzz PreCondition is matcher-like field to check if fuzzing should be performed on this request or not" + HTTPRequestDoc.Fields[34].Name = "pre-condition-operator" HTTPRequestDoc.Fields[34].Type = "string" HTTPRequestDoc.Fields[34].Note = "" - HTTPRequestDoc.Fields[34].Description = "Filter condition is the condition to apply on the filter (AND/OR). Default is OR" - HTTPRequestDoc.Fields[34].Comments[encoder.LineComment] = "Filter condition is the condition to apply on the filter (AND/OR). Default is OR" + HTTPRequestDoc.Fields[34].Description = "FuzzPreConditionOperator is the operator between multiple PreConditions for fuzzing Default is OR" + HTTPRequestDoc.Fields[34].Comments[encoder.LineComment] = "FuzzPreConditionOperator is the operator between multiple PreConditions for fuzzing Default is OR" GENERATORSAttackTypeHolderDoc.Type = "generators.AttackTypeHolder" GENERATORSAttackTypeHolderDoc.Comments[encoder.LineComment] = " AttackTypeHolder is used to hold internal type of the protocol" @@ -836,7 +836,7 @@ func init() { MATCHERSMatcherDoc.AppearsIn = []encoder.Appearance{ { TypeName: "http.Request", - FieldName: "filters", + FieldName: "pre-condition", }, } MATCHERSMatcherDoc.Fields = make([]encoder.Doc, 16) @@ -1851,7 +1851,7 @@ func init() { Value: "Matched is the input which was matched upon", }, } - CODERequestDoc.Fields = make([]encoder.Doc, 5) + CODERequestDoc.Fields = make([]encoder.Doc, 6) CODERequestDoc.Fields[0].Name = "id" CODERequestDoc.Fields[0].Type = "string" CODERequestDoc.Fields[0].Note = "" @@ -1862,21 +1862,26 @@ func init() { CODERequestDoc.Fields[1].Note = "" CODERequestDoc.Fields[1].Description = "Engine type" CODERequestDoc.Fields[1].Comments[encoder.LineComment] = "Engine type" - CODERequestDoc.Fields[2].Name = "args" - CODERequestDoc.Fields[2].Type = "[]string" + CODERequestDoc.Fields[2].Name = "pre-condition" + CODERequestDoc.Fields[2].Type = "string" CODERequestDoc.Fields[2].Note = "" - CODERequestDoc.Fields[2].Description = "Engine Arguments" - CODERequestDoc.Fields[2].Comments[encoder.LineComment] = "Engine Arguments" - CODERequestDoc.Fields[3].Name = "pattern" - CODERequestDoc.Fields[3].Type = "string" + CODERequestDoc.Fields[2].Description = "PreCondition is a condition which is evaluated before sending the request." + CODERequestDoc.Fields[2].Comments[encoder.LineComment] = "PreCondition is a condition which is evaluated before sending the request." + CODERequestDoc.Fields[3].Name = "args" + CODERequestDoc.Fields[3].Type = "[]string" CODERequestDoc.Fields[3].Note = "" - CODERequestDoc.Fields[3].Description = "Pattern preferred for file name" - CODERequestDoc.Fields[3].Comments[encoder.LineComment] = "Pattern preferred for file name" - CODERequestDoc.Fields[4].Name = "source" + CODERequestDoc.Fields[3].Description = "Engine Arguments" + CODERequestDoc.Fields[3].Comments[encoder.LineComment] = "Engine Arguments" + CODERequestDoc.Fields[4].Name = "pattern" CODERequestDoc.Fields[4].Type = "string" CODERequestDoc.Fields[4].Note = "" - CODERequestDoc.Fields[4].Description = "Source File/Snippet" - CODERequestDoc.Fields[4].Comments[encoder.LineComment] = "Source File/Snippet" + CODERequestDoc.Fields[4].Description = "Pattern preferred for file name" + CODERequestDoc.Fields[4].Comments[encoder.LineComment] = "Pattern preferred for file name" + CODERequestDoc.Fields[5].Name = "source" + CODERequestDoc.Fields[5].Type = "string" + CODERequestDoc.Fields[5].Note = "" + CODERequestDoc.Fields[5].Description = "Source File/Snippet" + CODERequestDoc.Fields[5].Comments[encoder.LineComment] = "Source File/Snippet" JAVASCRIPTRequestDoc.Type = "javascript.Request" JAVASCRIPTRequestDoc.Comments[encoder.LineComment] = " Request is a request for the javascript protocol"