runner

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Full        = "1-65535"
	NmapTop100  = "" /* 393-byte string literal not displayed */
	NmapTop1000 = "" /* 3813-byte string literal not displayed */
)

List of default ports

View Source
const Version = `1.1.1`

Version is the current version of naabu

Variables

This section is empty.

Functions

func ParsePorts

func ParsePorts(options *Options) (map[int]struct{}, error)

ParsePorts parses the list of ports an creates a port map

func WriteHostOutput

func WriteHostOutput(host string, results map[int]struct{}, writer io.Writer) error

WriteHostOutput writes the output list of host ports to an io.Writer

func WriteJSONOutput

func WriteJSONOutput(host string, results map[int]struct{}, writer io.Writer) error

WriteJSONOutput writes the output list of subdomain in JSON to an io.Writer

Types

type JSONResult

type JSONResult struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

JSONResult contains the result for a host in JSON format

type Options

type Options struct {
	Retries         int    // Retries is the number of retries for the port
	Rate            int    // Rate is the rate of port scan requests
	Verbose         bool   // Verbose flag indicates whether to show verbose output or not
	NoColor         bool   // No-Color disables the colored output
	Threads         int    // Thread controls the number of parallel host to enumerate
	Timeout         int    // Timeout is the seconds to wait for ports to respond
	Host            string // Host is the host to find ports for
	HostsFile       string // HostsFile is the file containing list of hosts to find port for
	Output          string // Output is the file to write found ports to.
	OutputDirectory string // OutputDirectory is the directory to write results to in case list of hosts is given
	JSON            bool   // JSON specifies whether to use json for output format or text file
	Silent          bool   // Silent suppresses any extra text and only writes found host:port to screen
	Ports           string // Ports is the ports to use for enumeration
	PortsFile       string // PortsFile is the file containing ports to use for enumeration
	ExcludePorts    string // ExcludePorts is the list of ports to exclude from enumeration
	Stdin           bool   // Stdin specifies whether stdin input was given to the process
	Verify          bool   // Verify is used to check if the ports found were valid using CONNECT method
	Version         bool   // Version specifies if we should just show version and exit
	Ping            bool   // Ping uses ping probes to discover fastest active host and discover dead hosts
}

Options contains the configuration options for tuning the port enumeration process.

func ParseOptions

func ParseOptions() *Options

ParseOptions parses the command line flags provided by a user

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner is an instance of the port enumeration client used to orchestrate the whole process.

func NewRunner

func NewRunner(options *Options) (*Runner, error)

NewRunner creates a new runner struct instance by parsing the configuration options, configuring sources, reading lists, etc

func (*Runner) EnumerateMultipleHosts

func (r *Runner) EnumerateMultipleHosts(reader io.Reader, ports map[int]struct{})

EnumerateMultipleHosts enumerates hosts for ports. We keep enumerating ports for a given host until we reach an error

func (*Runner) EnumerateSingleHost

func (r *Runner) EnumerateSingleHost(host string, ports map[int]struct{}, output string, add bool)

EnumerateSingleHost performs port enumeration against a single host

func (*Runner) RunEnumeration

func (r *Runner) RunEnumeration() error

RunEnumeration runs the ports enumeration flow on the targets specified

Jump to

Keyboard shortcuts

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