cmd

package
v0.0.26 Latest Latest
Warning

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

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

Documentation

Overview

Package cmd implements the CobraCLI commands for the networkscan 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 LoadBruteForceConfig added in v0.0.13

func LoadBruteForceConfig(module bruteforcefern.ModuleType, targets []string, usernames []string, passwords []string, timeout int, sleep int, retries int, successfulOnly bool, stopFirstSuccess bool) (*bruteforcefern.BruteForceRunConfig, error)

func LoadFingerprintConfig added in v0.0.22

func LoadFingerprintConfig(targets []string, resourceType addressfern.AddressFingerprintResourceType, modules []*addressfern.AddressFingerprintResourceModule, insecure bool, successfulOnly bool, timeout int) addressfern.AddressFingerprintConfig

func LoadTLSConfig added in v0.0.19

func LoadTLSConfig(targets []string, timeout int, insecure bool) addressfern.AddressTlsConfig

Types

type NetworkScan

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

NetworkScan is the main struct for the networkscan CLI that holds the root command and all subcommands used throughout execution of the CLI. It is also responsible for holding the Output configuration and the Output signal that is used by subcommands. The Output Signal is used to write the output of the command to the desired output format after the execution of the invoked command's Run function.

func NewNetworkScan

func NewNetworkScan(version string) *NetworkScan

NewNetworkScan creates a new NetworkScan struct with the provided version string. The NetworkScan struct is used to hold the root command and all subcommands used throughout execution of the CLI. We pass the version command here from the main.go file, where we set the version string during the build process.

func (*NetworkScan) InitAddressCommand added in v0.0.10

func (a *NetworkScan) InitAddressCommand()

InitAddressCommand initializes the address command for the networkscan CLI. It also sets up the flags for the address command and its subcommands.

func (*NetworkScan) InitFTPCommand added in v0.0.20

func (a *NetworkScan) InitFTPCommand()

func (*NetworkScan) InitHostCommand added in v0.0.3

func (a *NetworkScan) InitHostCommand()

InitHostCommand initializes the host command for the networkscan CLI. It also sets up the flags for the host command and its subcommands.

func (*NetworkScan) InitOSCommand added in v0.0.3

func (a *NetworkScan) InitOSCommand()

InitOSCommand initializes the os command for the networkscan CLI. It also sets up the flags for the port command and its subcommands.

func (*NetworkScan) InitPortCommand added in v0.0.3

func (a *NetworkScan) InitPortCommand()

InitPortCommand initializes the port command for the networkscan CLI. It also sets up the flags for the port command and its subcommands.

func (*NetworkScan) InitRootCommand

func (a *NetworkScan) InitRootCommand()

InitRootCommand initializes the root command for the networkscan CLI. This function sets up the root command and version command for the CLI. It also sets up the persistent flags for the root command, such as the log level, output format, and output file. Critically, this sets the PersistentPreRunE and PersistentPostRunE functions that are inherited by all subcommands. The PersistentPreRunE function is used to validate the output flags. The PersistentPostRunE function is used to write the output of the command to the desired output format after the execution of the invoked command's Run function.

func (*NetworkScan) InitSSHCommand added in v0.0.20

func (a *NetworkScan) InitSSHCommand()

Jump to

Keyboard shortcuts

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