Documentation ¶
Overview ¶
Package cmd implements the CobraCLI commands for the methodwebtest CLI. Subcommands for the CLI should all live within this package. Logic should be delegated to internal packages and functions to keep the CLI commands clean and focused on CLI I/O.
Index ¶
- func LoadHeaderBufferOverflowConfig(targets []string, bodySize int, timeout int, sleep int, retries int) *methodwebtest.HeaderBufferOverflowConfig
- func LoadHeaderMisconfigurationConfig(targets []string, HeaderEvent methodwebtest.HeaderEvent, timeout int, ...) *methodwebtest.HeaderMisconfigurationConfig
- func LoadHeaderServerOverloadConfig(targets, headerNames []string, payloadSize int, timeout int, sleep int, ...) *methodwebtest.HeaderServerOverloadConfig
- func LoadHeaderUserAgentConfig(targets []string, agentheader string, timeout int, sleep int, retries int) *methodwebtest.HeaderUserAgentConfig
- func LoadMultiInjectionConfig(targets []string, method methodwebtest.HttpMethod, ...) *methodwebtest.MultiInjectionConfig
- func LoadPathCrlfConfig(targets []string, headerName string, headerValue string, timeout int, ...) *methodwebtest.PathCrlfConfig
- func LoadPathModFileConfig(targets []string, timeout int, sleep int, retries int) *methodwebtest.PathModFileConfig
- func LoadPathTraversalConfig(targets, paths []string, pathlists []string, queryParam string, ...) *methodwebtest.PathTraversalConfig
- func LoadQueryReverseProxyConfig(targets []string, redirectAddress string, timeout int, retries int, sleep int) *methodwebtest.QueryReverseProxyConfig
- type MethodWebTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadHeaderBufferOverflowConfig ¶
func LoadHeaderBufferOverflowConfig(targets []string, bodySize int, timeout int, sleep int, retries int) *methodwebtest.HeaderBufferOverflowConfig
func LoadHeaderMisconfigurationConfig ¶
func LoadHeaderMisconfigurationConfig(targets []string, HeaderEvent methodwebtest.HeaderEvent, timeout int, sleep int, retries int) *methodwebtest.HeaderMisconfigurationConfig
LoadHeaderMisconfigurationConfig loads the configuration for a path-based fuzzing run.
func LoadHeaderServerOverloadConfig ¶
func LoadHeaderServerOverloadConfig(targets, headerNames []string, payloadSize int, timeout int, sleep int, retries int) *methodwebtest.HeaderServerOverloadConfig
LoadHeaderServerOverloadConfig loads the configuration for a path-based fuzzing run.
func LoadHeaderUserAgentConfig ¶
func LoadHeaderUserAgentConfig(targets []string, agentheader string, timeout int, sleep int, retries int) *methodwebtest.HeaderUserAgentConfig
LoadHeaderUserAgentConfig loads the configuration for a path-based fuzzing run.
func LoadMultiInjectionConfig ¶
func LoadMultiInjectionConfig(targets []string, method methodwebtest.HttpMethod, injectionLocation methodwebtest.InjectionLocation, eventType methodwebtest.MultiEvent, variableData map[string]string, timeout int, retries int, sleep int) *methodwebtest.MultiInjectionConfig
LoadMultiInjectionConfig loads the configuration for a multi location injection run.
func LoadPathCrlfConfig ¶
func LoadPathCrlfConfig(targets []string, headerName string, headerValue string, timeout int, sleep int, retries int) *methodwebtest.PathCrlfConfig
LoadPathCrlfConfig loads the configuration for a path-based fuzzing run.
func LoadPathModFileConfig ¶
func LoadPathModFileConfig(targets []string, timeout int, sleep int, retries int) *methodwebtest.PathModFileConfig
func LoadPathTraversalConfig ¶
func LoadPathTraversalConfig(targets, paths []string, pathlists []string, queryParam string, responseCodes string, ignoreBaseContent bool, timeout, sleep, retries int, successfulOnly bool) *methodwebtest.PathTraversalConfig
LoadPathTraversalConfig loads the configuration for a path-based fuzzing run.
func LoadQueryReverseProxyConfig ¶
func LoadQueryReverseProxyConfig(targets []string, redirectAddress string, timeout int, retries int, sleep int) *methodwebtest.QueryReverseProxyConfig
Types ¶
type MethodWebTest ¶
type MethodWebTest struct { Version string RootFlags config.RootFlags OutputConfig writer.OutputConfig OutputSignal signal.Signal RootCmd *cobra.Command VersionCmd *cobra.Command }
MethodWebTest is the main struct for the methodwebtest CLI. It contains both the root command and all subcommands that can be invoked during the execution of the CLI. It also is responsible for managing the output configuration as well as the output signal itself, which will be written after the execution of the invoked command's Run function.
func NewMethodWebTest ¶
func NewMethodWebTest(version string) *MethodWebTest
NewMethodWebTest creates a new MethodWebTest struct with the provided version string. The Methodwebtest struct is used throughout the subcommands as a contex within which output results and configuration values can be stored. We pass the version value in from the main.go file, where we set the version string during the build process.
func (*MethodWebTest) InitApacheCommand ¶
func (a *MethodWebTest) InitApacheCommand()
InitApacheCommand initializes the apache command for the methodwebtest CLI.
func (*MethodWebTest) InitGeneralCommand ¶
func (a *MethodWebTest) InitGeneralCommand()
InitGeneralCommand initializes the general command for the methodwebtest CLI.
func (*MethodWebTest) InitNginxCommand ¶
func (a *MethodWebTest) InitNginxCommand()
InitNginxCommand initializes the nginx command for the methodwebtest CLI.
func (*MethodWebTest) InitRootCommand ¶
func (a *MethodWebTest) InitRootCommand()
InitRootCommand initializes the root command for the methodwebtest CLI. This command is the parent command for all other subcommands that can be invoked. It also sets up the version command, which prints the version of the CLI when invoked. The root command also sets up the output configuration and signal, which are used to write the output of the subcommands to the appropriate location (file or stdout). Here, we set the PersistentPreRunE and PersistentPostRunE functions that are propagated to all subcommands. These functions are used to set up the output configuration and signal before the command is run, and to write the output signal after the command has completed.