Documentation
¶
Index ¶
- Constants
- func DoHealthCheck(options *Options, flagSet *goflags.FlagSet) string
- func ParsePorts(options *Options) ([]*port.Port, error)
- func ShowNetworkCapabilities(options *Options)
- func ShowNetworkInterfaces() error
- func WriteCsvOutput(host, ip string, ports []*port.Port, header bool, writer io.Writer) error
- func WriteHostOutput(host string, ports []*port.Port, writer io.Writer) error
- func WriteJSONOutput(host, ip string, ports []*port.Port, writer io.Writer) error
- type Options
- type Result
- type Runner
- func (r *Runner) AddTarget(target string) error
- func (r *Runner) BackgroundWorkers(ctx context.Context)
- func (r *Runner) Close()
- func (r *Runner) ConnectVerification()
- func (r *Runner) GetTargetIps(ipsCallback func() []*net.IPNet) (targets, targetsV4, targetsV6 []*net.IPNet, err error)
- func (r *Runner) IPs() *ipranger.IPRanger
- func (r *Runner) LoadTargets(targets []string) error
- func (r *Runner) PickIP(targets []*net.IPNet, index int64) string
- func (r *Runner) PickPort(index int) *port.Port
- func (r *Runner) PickSubnetIP(network *net.IPNet, index int64) string
- func (r *Runner) RawSocketEnumeration(ctx context.Context, ip string, p *port.Port)
- func (r *Runner) RunEnumeration(pctx context.Context) error
- func (r *Runner) SetInterface(interfaceName string) error
- func (r *Runner) SetSourceIP(sourceIP string) error
- func (r *Runner) ShowScanResultOnExit()
- func (r *Runner) Stats() clistats.StatisticsClient
- type Target
Constants ¶
const ( DefaultPortTimeoutSynScan = time.Second DefaultPortTimeoutConnectScan = 3 * time.Second DefaultRateSynScan = 1000 DefaultRateConnectScan = 1500 DefaultHostConcurrency = 1500 DefaultRetriesSynScan = 1 DefaultRetriesConnectScan = 1 SynScan = "s" ConnectScan = "c" )
const ( Full = "1-65535" NmapTop100 = "" /* 393-byte string literal not displayed */ NmapTop1000 = "" /* 3813-byte string literal not displayed */ )
List of default ports
Variables ¶
This section is empty.
Functions ¶
func ParsePorts ¶
ParsePorts parses the list of ports and creates a port map
func ShowNetworkCapabilities ¶
func ShowNetworkCapabilities(options *Options)
ShowNetworkCapabilities shows the network capabilities/scan types possible with the running user
func ShowNetworkInterfaces ¶
func ShowNetworkInterfaces() error
func WriteCsvOutput ¶
WriteCsvOutput writes the output list of subdomain in csv format to an io.Writer
func WriteHostOutput ¶
WriteHostOutput writes the output list of host ports to an io.Writer
Types ¶
type Options ¶
type Options struct {
Verbose bool // Verbose flag indicates whether to show verbose output or not
NoColor bool // No-Color disables the colored output
Silent bool // Silent suppresses any extra text and only writes found host:port to screen
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
Debug bool // Prints out debug information
InterfacesList bool // InterfacesList show interfaces list
Retries int // Retries is the number of retries for the port
Rate int // Rate is the rate of port scan requests
PerHostConcurrency int // PerHostConcurrency is the max number of concurrent port scan requests for each host
Timeout time.Duration // Timeout is the milliseconds to wait for ports to respond
WarmUpTime int // WarmUpTime between scan phases
Host goflags.StringSlice // Host is the single host or comma-separated list of hosts to find ports for
Output string // Output is the file to write found ports to.
Ports string // Ports is the ports to use for enumeration
TopPorts string // Tops ports to scan
Interface string // Interface to use for TCP packets
ConfigFile string // Config file contains a scan configuration
Threads int // Internal worker threads
IPVersion goflags.StringSlice // IP Version to use while resolving hostnames
ScanType string // Scan Type
Proxy string // Socks5 proxy
ProxyAuth string // Socks5 proxy authentication (username:password)
Resolvers string // Resolvers (comma separated or file)
OnResult result.ResultCallback // callback on final host result
OnReceive result.ResultCallback // callback on response receive
CSV bool
HealthCheck bool
TcpSynPingProbes goflags.StringSlice
TcpAckPingProbes goflags.StringSlice
// UdpPingProbes goflags.StringSlice - planned
// STcpInitPingProbes goflags.StringSlice - planned
IcmpEchoRequestProbe bool
IcmpTimestampRequestProbe bool
IcmpAddressMaskRequestProbe bool
// IpProtocolPingProbes goflags.StringSlice - planned
ArpPing bool
IPv6NeighborDiscoveryPing bool
// HostDiscoveryIgnoreRST bool - planned
InputReadTimeout time.Duration
// ReversePTR lookup for ips
ReversePTR bool
// contains filtered or unexported fields
}
Options contains the configuration options for tuning the port enumeration process. nolint:maligned // just an option structure
func ParseOptions ¶
func ParseOptions() *Options
ParseOptions parses the command line flags provided by a user
func (*Options) ConfigureOutput ¶
func (options *Options) ConfigureOutput()
ConfigureOutput configures the output on the screen
func (*Options) GetTimeout ¶
func (*Options) ShouldScanIPv4 ¶
func (*Options) ShouldScanIPv6 ¶
func (*Options) ValidateOptions ¶
ValidateOptions validates the configuration options passed
type Result ¶
type Result struct {
Host string `json:"host,omitempty" csv:"host"`
IP string `json:"ip,omitempty" csv:"ip"`
Port int `json:"port,omitempty" csv:"port"`
Protocol string `json:"protocol,omitempty" csv:"protocol"`
Label string `json:"label"`
TimeStamp time.Time `json:"timestamp,omitempty" csv:"timestamp"`
}
Result contains the result for a host
func (*Result) CSVHeaders ¶
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 ¶
NewRunner creates a new runner struct instance by parsing the configuration options, configuring sources, reading lists, etc
func (*Runner) BackgroundWorkers ¶
func (*Runner) ConnectVerification ¶
func (r *Runner) ConnectVerification()
func (*Runner) GetTargetIps ¶
func (*Runner) LoadTargets ¶
func (*Runner) RawSocketEnumeration ¶
func (*Runner) RunEnumeration ¶
RunEnumeration runs the ports enumeration flow on the targets specified
func (*Runner) SetInterface ¶
func (*Runner) SetSourceIP ¶
func (*Runner) ShowScanResultOnExit ¶
func (r *Runner) ShowScanResultOnExit()
func (*Runner) Stats ¶
func (r *Runner) Stats() clistats.StatisticsClient