cmd

package
v0.0.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package cmd implements the CobraCLI commands for the webscan 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

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadWebserverHeadergrabConfig added in v0.0.44

func LoadWebserverHeadergrabConfig(targets []string, timeout int) *webscan.WebserverHeadergrabConfig

func LoadWebserverProbeConfig added in v0.0.44

func LoadWebserverProbeConfig(targets []string, timeout int) *webscan.WebserverProbeConfig

func LoadWebserverRatelimitConfig added in v0.0.44

func LoadWebserverRatelimitConfig(targets []string, maxRequests int, timespan int, timeout int) *webscan.WebserverRateLimitConfig

Types

type WebScan

type WebScan struct {
	Version      string
	RootFlags    config.RootFlags
	OutputConfig writer.OutputConfig
	OutputSignal signal.Signal
	RootCmd      *cobra.Command
	VersionCmd   *cobra.Command
}

WebScan is the main struct for the webscan 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 NewWebScan

func NewWebScan(version string) *WebScan

NewWebScan creates a new WebScan struct with the provided version string. The Webscan 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 (*WebScan) InitAppCommand added in v0.0.9

func (a *WebScan) InitAppCommand()

InitAppCommand initializes the app command for the webscan CLI.

func (*WebScan) InitPagecaptureCommand added in v0.0.21

func (a *WebScan) InitPagecaptureCommand()

InitPagecaptureCommand initializes the pagecapture command for the webscan CLI. This command is used to collect the HTML of a webpage from a URL target.

func (*WebScan) InitRootCommand

func (a *WebScan) InitRootCommand()

InitRootCommand initializes the root command for the webscan 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.

func (*WebScan) InitRoutecaptureCommand added in v0.0.21

func (a *WebScan) InitRoutecaptureCommand()

InitRoutecaptureCommand initializes the Routecapture command for the webscan CLI. This command is used to collect the HTML of a webpage from a URL target.

func (*WebScan) InitSpiderCommand

func (a *WebScan) InitSpiderCommand()

InitSpiderCommand initializes the spider command for the webscan CLI. This command is used to perform a web spider crawl against URL targets, capturing data about webpages and endpoints that exist on the target.

func (*WebScan) InitURLCommand added in v0.0.44

func (a *WebScan) InitURLCommand()

InitURLCommand initializes the URL command for the webscan CLI. This command is used to perform a URL scan against a URL target, capturing data TLS and HTTP methods that exist on the URL.

func (*WebScan) InitWebserverCommand added in v0.0.44

func (a *WebScan) InitWebserverCommand()

InitWebserverCommand initializes the webserver command for the webscan CLI. This command is used to perform detection tests for web applications.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL