misc sniper cleanups

This commit is contained in:
sandeep 2021-10-13 13:19:00 +05:30
parent cefb4094d3
commit a9cb83ff27
6 changed files with 19 additions and 19 deletions

View File

@ -823,14 +823,14 @@ in a combined manner allowing multirequest based matchers.
Attack is the type of payload combinations to perform. Attack is the type of payload combinations to perform.
Sniper is each payload once, pitchfork combines multiple payload sets and clusterbomb generates Batteringram is same payload into all of the defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates
permutations and combinations for all payloads. permutations and combinations for all payloads.
Valid values: Valid values:
- <code>sniper</code> - <code>batteringram</code>
- <code>pitchfork</code> - <code>pitchfork</code>
@ -2312,14 +2312,14 @@ host:
Attack is the type of payload combinations to perform. Attack is the type of payload combinations to perform.
Sniper is each payload once, pitchfork combines multiple payload sets and clusterbomb generates Batteringram is same payload into all of the defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates
permutations and combinations for all payloads. permutations and combinations for all payloads.
Valid values: Valid values:
- <code>sniper</code> - <code>batteringram</code>
- <code>pitchfork</code> - <code>pitchfork</code>

View File

@ -606,7 +606,7 @@
}, },
"attack": { "attack": {
"enum": [ "enum": [
"sniper", "batteringram",
"pitchfork", "pitchfork",
"clusterbomb" "clusterbomb"
], ],
@ -777,7 +777,7 @@
}, },
"attack": { "attack": {
"enum": [ "enum": [
"sniper", "batteringram",
"pitchfork", "pitchfork",
"clusterbomb" "clusterbomb"
], ],

View File

@ -14,7 +14,7 @@ type Generator struct {
type Type int type Type int
const ( const (
// Sniper replaces one iteration of the payload with a value. // Batteringram replaces same payload into all of the defined payload positions at once.
BatteringRam Type = iota + 1 BatteringRam Type = iota + 1
// PitchFork replaces variables with positional value from multiple wordlists // PitchFork replaces variables with positional value from multiple wordlists
PitchFork PitchFork
@ -43,10 +43,10 @@ func New(payloads map[string]interface{}, payloadType Type, templatePath string)
generator.Type = payloadType generator.Type = payloadType
generator.payloads = compiled generator.payloads = compiled
// Validate the sniper/batteringram payload set // Validate the batteringram payload set
if payloadType == BatteringRam { if payloadType == BatteringRam {
if len(payloads) != 1 { if len(payloads) != 1 {
return nil, errors.New("sniper/batteringram must have single payload set") return nil, errors.New("batteringram must have single payload set")
} }
} }
return generator, nil return generator, nil

View File

@ -46,13 +46,13 @@ type Request struct {
// description: | // description: |
// Attack is the type of payload combinations to perform. // Attack is the type of payload combinations to perform.
// //
// Sniper is each payload once, pitchfork combines multiple payload sets and clusterbomb generates // batteringram is same payload into all of the defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates
// permutations and combinations for all payloads. // permutations and combinations for all payloads.
// values: // values:
// - "sniper" // - "batteringram"
// - "pitchfork" // - "pitchfork"
// - "clusterbomb" // - "clusterbomb"
AttackType string `yaml:"attack,omitempty" jsonschema:"title=attack is the payload combination,description=Attack is the type of payload combinations to perform,enum=sniper,enum=pitchfork,enum=clusterbomb"` AttackType string `yaml:"attack,omitempty" jsonschema:"title=attack is the payload combination,description=Attack is the type of payload combinations to perform,enum=batteringram,enum=pitchfork,enum=clusterbomb"`
// description: | // description: |
// Method is the HTTP Request Method. // Method is the HTTP Request Method.
// values: // values:

View File

@ -35,13 +35,13 @@ type Request struct {
// description: | // description: |
// Attack is the type of payload combinations to perform. // Attack is the type of payload combinations to perform.
// //
// Sniper is each payload once, pitchfork combines multiple payload sets and clusterbomb generates // Batteringram is same payload into all of the defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates
// permutations and combinations for all payloads. // permutations and combinations for all payloads.
// values: // values:
// - "sniper" // - "batteringram"
// - "pitchfork" // - "pitchfork"
// - "clusterbomb" // - "clusterbomb"
AttackType string `yaml:"attack,omitempty" jsonschema:"title=attack is the payload combination,description=Attack is the type of payload combinations to perform,enum=sniper,enum=pitchfork,enum=clusterbomb"` AttackType string `yaml:"attack,omitempty" jsonschema:"title=attack is the payload combination,description=Attack is the type of payload combinations to perform,enum=batteringram,enum=pitchfork,enum=clusterbomb"`
// description: | // description: |
// Payloads contains any payloads for the current request. // Payloads contains any payloads for the current request.
// //

View File

@ -317,10 +317,10 @@ func init() {
HTTPRequestDoc.Fields[7].Name = "attack" HTTPRequestDoc.Fields[7].Name = "attack"
HTTPRequestDoc.Fields[7].Type = "string" HTTPRequestDoc.Fields[7].Type = "string"
HTTPRequestDoc.Fields[7].Note = "" HTTPRequestDoc.Fields[7].Note = ""
HTTPRequestDoc.Fields[7].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." HTTPRequestDoc.Fields[7].Description = "Attack is the type of payload combinations to perform.\n\nBatteringram is same payload into all of the 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].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform."
HTTPRequestDoc.Fields[7].Values = []string{ HTTPRequestDoc.Fields[7].Values = []string{
"sniper", "batteringram",
"pitchfork", "pitchfork",
"clusterbomb", "clusterbomb",
} }
@ -854,10 +854,10 @@ func init() {
NETWORKRequestDoc.Fields[2].Name = "attack" NETWORKRequestDoc.Fields[2].Name = "attack"
NETWORKRequestDoc.Fields[2].Type = "string" NETWORKRequestDoc.Fields[2].Type = "string"
NETWORKRequestDoc.Fields[2].Note = "" NETWORKRequestDoc.Fields[2].Note = ""
NETWORKRequestDoc.Fields[2].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." NETWORKRequestDoc.Fields[2].Description = "Attack is the type of payload combinations to perform.\n\nBatteringram is same payload into all of the defined payload positions at once, pitchfork combines multiple payload sets and clusterbomb generates\npermutations and combinations for all payloads."
NETWORKRequestDoc.Fields[2].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform." NETWORKRequestDoc.Fields[2].Comments[encoder.LineComment] = "Attack is the type of payload combinations to perform."
NETWORKRequestDoc.Fields[2].Values = []string{ NETWORKRequestDoc.Fields[2].Values = []string{
"sniper", "batteringram",
"pitchfork", "pitchfork",
"clusterbomb", "clusterbomb",
} }