Auto Generate Syntax Docs + JSONSchema [Sat Feb 5 15:00:13 UTC 2022] 🤖

dev
GitHub Action 2022-02-05 15:00:13 +00:00
parent 145faeef8d
commit 845bae5c32
3 changed files with 82 additions and 18 deletions

View File

@ -2092,6 +2092,8 @@ Appears in:
- <code><a href="#networkrequest">network.Request</a>.attack</code> - <code><a href="#networkrequest">network.Request</a>.attack</code>
- <code><a href="#headlessrequest">headless.Request</a>.attack</code>
- <code><a href="#websocketrequest">websocket.Request</a>.attack</code> - <code><a href="#websocketrequest">websocket.Request</a>.attack</code>
@ -3136,6 +3138,39 @@ ID is the optional id of the request
<div class="dd"> <div class="dd">
<code>attack</code> <i><a href="#generatorsattacktypeholder">generators.AttackTypeHolder</a></i>
</div>
<div class="dt">
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.
</div>
<hr />
<div class="dd">
<code>payloads</code> <i>map[string]interface{}</i>
</div>
<div class="dt">
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.
</div>
<hr />
<div class="dd">
<code>steps</code> <i>[]<a href="#engineaction">engine.Action</a></i> <code>steps</code> <i>[]<a href="#engineaction">engine.Action</a></i>
</div> </div>

View File

@ -502,6 +502,21 @@
"title": "id of the request", "title": "id of the request",
"description": "Optional ID of the headless request" "description": "Optional ID of the headless request"
}, },
"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 headless request",
"description": "Payloads contains any payloads for the current request"
},
"steps": { "steps": {
"items": { "items": {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",

View File

@ -879,6 +879,10 @@ func init() {
TypeName: "network.Request", TypeName: "network.Request",
FieldName: "attack", FieldName: "attack",
}, },
{
TypeName: "headless.Request",
FieldName: "attack",
},
{ {
TypeName: "websocket.Request", TypeName: "websocket.Request",
FieldName: "attack", FieldName: "attack",
@ -1423,33 +1427,43 @@ func init() {
Value: "Headless response recieved from client (default)", Value: "Headless response recieved from client (default)",
}, },
} }
HEADLESSRequestDoc.Fields = make([]encoder.Doc, 5) HEADLESSRequestDoc.Fields = make([]encoder.Doc, 7)
HEADLESSRequestDoc.Fields[0].Name = "id" HEADLESSRequestDoc.Fields[0].Name = "id"
HEADLESSRequestDoc.Fields[0].Type = "string" HEADLESSRequestDoc.Fields[0].Type = "string"
HEADLESSRequestDoc.Fields[0].Note = "" HEADLESSRequestDoc.Fields[0].Note = ""
HEADLESSRequestDoc.Fields[0].Description = "ID is the optional id of the request" HEADLESSRequestDoc.Fields[0].Description = "ID is the optional id of the request"
HEADLESSRequestDoc.Fields[0].Comments[encoder.LineComment] = " ID is the optional id of the request" HEADLESSRequestDoc.Fields[0].Comments[encoder.LineComment] = " ID is the optional id of the request"
HEADLESSRequestDoc.Fields[1].Name = "steps" HEADLESSRequestDoc.Fields[1].Name = "attack"
HEADLESSRequestDoc.Fields[1].Type = "[]engine.Action" HEADLESSRequestDoc.Fields[1].Type = "generators.AttackTypeHolder"
HEADLESSRequestDoc.Fields[1].Note = "" HEADLESSRequestDoc.Fields[1].Note = ""
HEADLESSRequestDoc.Fields[1].Description = "Steps is the list of actions to run for headless request" HEADLESSRequestDoc.Fields[1].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."
HEADLESSRequestDoc.Fields[1].Comments[encoder.LineComment] = "Steps is the list of actions to run for headless request" HEADLESSRequestDoc.Fields[1].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform."
HEADLESSRequestDoc.Fields[2].Name = "matchers" HEADLESSRequestDoc.Fields[2].Name = "payloads"
HEADLESSRequestDoc.Fields[2].Type = "[]matchers.Matcher" HEADLESSRequestDoc.Fields[2].Type = "map[string]interface{}"
HEADLESSRequestDoc.Fields[2].Note = "" HEADLESSRequestDoc.Fields[2].Note = ""
HEADLESSRequestDoc.Fields[2].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[2].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."
HEADLESSRequestDoc.Fields[2].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify" HEADLESSRequestDoc.Fields[2].Comments[encoder.LineComment] = "Payloads contains any payloads for the current request."
HEADLESSRequestDoc.Fields[3].Name = "extractors" HEADLESSRequestDoc.Fields[3].Name = "steps"
HEADLESSRequestDoc.Fields[3].Type = "[]extractors.Extractor" HEADLESSRequestDoc.Fields[3].Type = "[]engine.Action"
HEADLESSRequestDoc.Fields[3].Note = "" HEADLESSRequestDoc.Fields[3].Note = ""
HEADLESSRequestDoc.Fields[3].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response." HEADLESSRequestDoc.Fields[3].Description = "Steps is the list of actions to run for headless request"
HEADLESSRequestDoc.Fields[3].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify" HEADLESSRequestDoc.Fields[3].Comments[encoder.LineComment] = "Steps is the list of actions to run for headless request"
HEADLESSRequestDoc.Fields[4].Name = "matchers-condition" HEADLESSRequestDoc.Fields[4].Name = "matchers"
HEADLESSRequestDoc.Fields[4].Type = "string" HEADLESSRequestDoc.Fields[4].Type = "[]matchers.Matcher"
HEADLESSRequestDoc.Fields[4].Note = "" HEADLESSRequestDoc.Fields[4].Note = ""
HEADLESSRequestDoc.Fields[4].Description = "MatchersCondition is the condition between the matchers. Default is OR." HEADLESSRequestDoc.Fields[4].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[4].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR." HEADLESSRequestDoc.Fields[4].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify"
HEADLESSRequestDoc.Fields[4].Values = []string{ HEADLESSRequestDoc.Fields[5].Name = "extractors"
HEADLESSRequestDoc.Fields[5].Type = "[]extractors.Extractor"
HEADLESSRequestDoc.Fields[5].Note = ""
HEADLESSRequestDoc.Fields[5].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response."
HEADLESSRequestDoc.Fields[5].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify"
HEADLESSRequestDoc.Fields[6].Name = "matchers-condition"
HEADLESSRequestDoc.Fields[6].Type = "string"
HEADLESSRequestDoc.Fields[6].Note = ""
HEADLESSRequestDoc.Fields[6].Description = "MatchersCondition is the condition between the matchers. Default is OR."
HEADLESSRequestDoc.Fields[6].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR."
HEADLESSRequestDoc.Fields[6].Values = []string{
"and", "and",
"or", "or",
} }