Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SlowBodyReadRequest ¶
type SlowBodyReadRequest struct {
Target Target `embed:""`
// Method - the HTTP method to use, one of POST / PUT. Defaults to POST.
Method string `name:"http-method" help:"the HTTP method to use, one of POST / PUT. Defaults to POST."`
// BodyReadTimeout - the timeout for reading the request body. Defaults to hang forever.
BodyReadTimeout time.Duration `name:"http-read-timeout" help:"the timeout for reading the request body. Defaults to hang forever."`
// contains filtered or unexported fields
}
SlowBodyReadRequest provides the configurations for simulating slow request body reading attack.
Example ¶
u, err := url.Parse("http://127.0.0.1:8080")
if err != nil {
panic(err)
}
s := SlowBodyReadRequest{
Target: Target{
Url: *u,
},
Method: http.MethodPost,
BodyReadTimeout: 180 * time.Second,
}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
_ = s.Run(ctx)
type Slowloris ¶
type Slowloris struct {
Target Target `embed:""`
// Method - the HTTP method to use. Defaults to GET
Method string `name:"http-method" help:"the HTTP method to use. Defaults to GET"`
// UserAgents - list of user agents to use.
// If more than one is provided, a random one will be selected.
// If none is provided, a default one will be used.
UserAgents []string `` /* 167-byte string literal not displayed */
// SendGibberish - whether to send gibberish data in the request header.
SendGibberish bool `name:"http-send-gibberish" help:"whether to send gibberish data in the request header"`
// GibberishInterval - the random interval to send gibberish data in the request header. Defaults to 3s.
GibberishInterval time.Duration `name:"http-gibberish-interval" help:"the random interval to send gibberish data in the request header"`
// WriteTimeout - the timeout for writing the request header. Defaults to 10s.
WriteTimeout time.Duration `name:"http-write-timeout" help:"the timeout for writing the request header. Defaults to 10s."`
// contains filtered or unexported fields
}
Slowloris provides the configurations for running slowloris attack.
Example ¶
u, err := url.Parse("http://127.0.0.1:8080")
if err != nil {
panic(err)
}
s := Slowloris{
Target: Target{
Url: *u,
},
SendGibberish: true,
GibberishInterval: 5 * time.Millisecond,
UserAgents: []string{
"turtle/0.0.1",
"turtle/0.0.1 - slowloris",
},
}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
_ = s.Run(ctx)
type Target ¶
type Target struct {
// Url - the url of the target.
Url url.URL `arg:"" name:"target-url" help:"the url of the target"`
// Duration - the duration of the attack. Defaults to 30s.
Duration time.Duration `name:"target-duration" help:"the duration of the attack. Defaults to 30s"`
// Connections - the number of connections to be made. Defaults to 100.
Connections int `name:"target-connections" help:"the number of connections to be made. Defaults to 100"`
}
Target provides target configuration.
Click to show internal directories.
Click to hide internal directories.