Documentation ¶
Index ¶
- Constants
- func CleanupHandlersUnix(s *Scanner)
- func ConnectPort(host string, port int, timeout time.Duration) (bool, error)
- func GetInterfaceFromIP(ip net.IP) (*net.Interface, error)
- func GetSourceIP(dstip net.IP) (net.IP, error)
- func GetSrcParameters(destIP string) (srcIP net.IP, networkInterface *net.Interface, err error)
- func NewScannerUnix(scanner *Scanner) error
- func SetupHandlerUnix(s *Scanner, interfaceName string) error
- func TCPReadWorkerPCAPUnix(s *Scanner)
- func WhatsMyIP() (string, error)
- type Handlers
- type Options
- type Ping
- type PingResult
- type PingResultType
- type PkgFlag
- type PkgResult
- type PkgSend
- type Scanner
- func (s *Scanner) ACKPort(dstIP string, port int, timeout time.Duration) (bool, error)
- func (s *Scanner) CdnCheck(ip string) (bool, error)
- func (s *Scanner) CleanupHandlers()
- func (s *Scanner) Close()
- func (s *Scanner) ConnectVerify(host string, ports map[int]struct{}) map[int]struct{}
- func (s *Scanner) EnqueueICMP(ip string, pkgtype PkgFlag)
- func (s *Scanner) EnqueueTCP(ip string, port int, pkgtype PkgFlag)
- func (s *Scanner) ICMPReadWorker()
- func (s *Scanner) ICMPWriteWorker()
- func (s *Scanner) ScanSyn(ip string)
- func (s *Scanner) SendAsyncPkg(ip string, port int, pkgFlag PkgFlag)
- func (s *Scanner) SetupHandler(interfaceName string) error
- func (s *Scanner) SetupHandlers() error
- func (s *Scanner) StartWorkers()
- func (s *Scanner) TCPReadWorker()
- func (s *Scanner) TCPReadWorkerPCAP()
- func (s *Scanner) TCPResultWorker()
- func (s *Scanner) TCPWriteWorker()
- func (s *Scanner) TuneSource(ip string) error
- type State
- type TCPSequencer
Constants ¶
const ( DeadlineSec = 10 ProtocolICMP = 1 )
Some constants
Variables ¶
This section is empty.
Functions ¶
func ConnectPort ¶
ConnectPort a single host and port
func GetInterfaceFromIP ¶
GetInterfaceFromIP gets the name of the network interface from local ip address
func GetSourceIP ¶
GetSourceIP gets the local ip based on our destination ip
func GetSrcParameters ¶
GetSrcParameters gets the network parameters from the destination ip
func NewScannerUnix ¶
func SetupHandlerUnix ¶
func TCPReadWorkerPCAPUnix ¶
func TCPReadWorkerPCAPUnix(s *Scanner)
Types ¶
type Options ¶
type Options struct { Timeout time.Duration Retries int Rate int Debug bool Root bool ExcludeCdn bool ExcludedIps []string }
Options of the scan
type Ping ¶
type Ping struct { Type PingResultType Latency time.Duration Error error Host string }
Ping contains the results for ping on a single host
type PingResult ¶
type PingResult struct {
Hosts []Ping
}
PingResult contains the results for the Ping request
func PingHosts ¶
func PingHosts(addresses []string) (*PingResult, error)
PingHosts pings the addresses given and returns the latencies of each host If the address returns an error, that address is marked as unusable.
func (*PingResult) GetFastestHost ¶
func (p *PingResult) GetFastestHost() (Ping, error)
GetFastestHost gets the fastest host from the ping responses
type PingResultType ¶
type PingResultType int
PingResultType contains the type of result for ping request on an address
const ( HostInactive PingResultType = iota HostActive )
Type of ping responses
type PkgResult ¶
type PkgResult struct {
// contains filtered or unexported fields
}
PkgResult contains the results of sending TCP packages
type PkgSend ¶
type PkgSend struct { SourceIP string // contains filtered or unexported fields }
PkgSend is a TCP package
type Scanner ¶
type Scanner struct { SourceIP net.IP Ports []int IPRanger *ipranger.IPRanger State State ScanResults *result.Result NetworkInterface *net.Interface // contains filtered or unexported fields }
func NewScanner ¶
NewScanner creates a new full port scanner that scans all ports using SYN packets.
func (*Scanner) CleanupHandlers ¶
func (s *Scanner) CleanupHandlers()
CleanupHandlers for all interfaces
func (*Scanner) ConnectVerify ¶
ConnectVerify is used to verify if ports are accurate using a connect request
func (*Scanner) EnqueueICMP ¶
EnqueueICMP outgoing ICMP packets
func (*Scanner) EnqueueTCP ¶
EnqueueTCP outgoing TCP packets
func (*Scanner) ICMPReadWorker ¶
func (s *Scanner) ICMPReadWorker()
ICMPReadWorker reads packets from the network layer
func (*Scanner) ICMPWriteWorker ¶
func (s *Scanner) ICMPWriteWorker()
ICMPWriteWorker writes packet to the network layer
func (*Scanner) SendAsyncPkg ¶
SendAsyncPkg sends a single packet to a port
func (*Scanner) SetupHandler ¶
SetupHandler to listen on the specified interface
func (*Scanner) SetupHandlers ¶
SetupHandlers to listen on all interfaces
func (*Scanner) TCPReadWorker ¶
func (s *Scanner) TCPReadWorker()
TCPReadWorker reads and parse incoming TCP packets
func (*Scanner) TCPReadWorkerPCAP ¶
func (s *Scanner) TCPReadWorkerPCAP()
TCPReadWorkerPCAP reads and parse incoming TCP packets with pcap
func (*Scanner) TCPResultWorker ¶
func (s *Scanner) TCPResultWorker()
TCPResultWorker handles probes and scan results
func (*Scanner) TCPWriteWorker ¶
func (s *Scanner) TCPWriteWorker()
TCPWriteWorker that sends out TCP packets
func (*Scanner) TuneSource ¶
TuneSource automatically with ip and interface
type TCPSequencer ¶
type TCPSequencer struct {
// contains filtered or unexported fields
}
TCPSequencer generates linear TCP sequence numbers that wrap around after reaching their maximum value.
According to specs, this is the correct way to approach TCP sequence number since linearity will be guaranteed by the wrapping around to initial 0.
func NewTCPSequencer ¶
func NewTCPSequencer() *TCPSequencer
NewTCPSequencer creates a new linear tcp sequenc enumber generator
func (*TCPSequencer) Next ¶
func (t *TCPSequencer) Next() uint32
Next returns the next number in the sequence of tcp sequence numbers