Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupHandlersUnix()
- func SendAsyncPkg(listenHandler *ListenHandler, ip string, p *port.Port, pkgFlag PkgFlag)
- func SetupHandler(interfaceName string) error
- func SetupHandlerUnix(interfaceName, bpfFilter string, protocols ...protocol.Protocol) error
- func SetupHandlers() error
- func ToString(ip net.IP) string
- func TransportReadWorker()
- func TransportWriteWorker()
- func WhatsMyIP() (string, error)
- type Handlers
- type ListenHandler
- type Options
- type Phase
- type PkgFlag
- type PkgResult
- type PkgSend
- type Scanner
- func (s *Scanner) Close()
- func (s *Scanner) ConnectPort(host string, p *port.Port, timeout time.Duration) (bool, error)
- func (s *Scanner) ConnectVerify(host string, ports []*port.Port) []*port.Port
- func (s *Scanner) EnqueueEthernet(ip string, pkgtype PkgFlag)
- func (s *Scanner) EnqueueTCP(ip string, pkgtype PkgFlag, ports ...*port.Port)
- func (s *Scanner) EnqueueUDP(ip string, ports ...*port.Port)
- func (s *Scanner) ScanSyn(ip string)
- func (s *Scanner) StartWorkers(ctx context.Context)
- func (s *Scanner) TCPResultWorker(ctx context.Context)
- func (s *Scanner) UDPResultWorker(ctx context.Context)
- type State
- type TCPSequencer
Constants ¶
const ( IPv4 = "4" IPv6 = "6" )
Variables ¶
var ( ListenHandlers []*ListenHandler NetworkInterface string PkgRouter routing.Router NumberOfHandlers = 1 )
Functions ¶
func SendAsyncPkg ¶
func SendAsyncPkg(listenHandler *ListenHandler, ip string, p *port.Port, pkgFlag PkgFlag)
SendAsyncPkg sends a single packet to a port
func SetupHandler ¶
func SetupHandlerUnix ¶
SetupHandlerUnix on unix OS
func SetupHandlers ¶
func SetupHandlers() error
func TransportReadWorker ¶
func TransportReadWorker()
func TransportWriteWorker ¶
func TransportWriteWorker()
TCPWriteWorker that sends out TCP|UDP packets
Types ¶
type Handlers ¶
type Handlers struct {
InterfaceHandle map[string]*pcap.Handle
TransportActive []*pcap.Handle
LoopbackHandlers []*pcap.Handle
TransportInactive []*pcap.InactiveHandle
}
Handlers contains the list of pcap handlers
type ListenHandler ¶
type ListenHandler struct {
Busy bool
Phase *Phase
SourceHW net.HardwareAddr
SourceIp4 net.IP
SourceIP6 net.IP
Port int
TcpConn4, UdpConn4, TcpConn6, UdpConn6 *net.IPConn
TcpChan, UdpChan chan *PkgResult
}
func Acquire ¶
func Acquire(options *Options) (*ListenHandler, error)
func NewListenHandler ¶
func NewListenHandler() *ListenHandler
func (*ListenHandler) Release ¶
func (l *ListenHandler) Release()
func (*ListenHandler) TcpReadWorker4 ¶
func (l *ListenHandler) TcpReadWorker4()
func (*ListenHandler) TcpReadWorker6 ¶
func (l *ListenHandler) TcpReadWorker6()
func (*ListenHandler) UdpReadWorker4 ¶
func (l *ListenHandler) UdpReadWorker4()
func (*ListenHandler) UdpReadWorker6 ¶
func (l *ListenHandler) UdpReadWorker6()
type Options ¶
type Options struct {
Timeout time.Duration
Rate int
OnReceive result.ResultCallback
ScanType string
Proxy string
ProxyAuth string
}
Options of the scan
type PkgResult ¶
type PkgResult struct {
// contains filtered or unexported fields
}
PkgResult contains the results of sending TCP packages
type PkgSend ¶
type PkgSend struct {
ListenHandler *ListenHandler
SourceIP string
// contains filtered or unexported fields
}
PkgSend is a TCP package
type Scanner ¶
type Scanner struct {
Ports []*port.Port
IPRanger *ipranger.IPRanger
HostDiscoveryResults *result.Result
ScanResults *result.Result
NetworkInterface *net.Interface
ListenHandler *ListenHandler
OnReceive result.ResultCallback
// contains filtered or unexported fields
}
func NewScanner ¶
NewScanner creates a new full port scanner that scans all ports using SYN packets.
func (*Scanner) ConnectPort ¶
ConnectPort a single host and port
func (*Scanner) ConnectVerify ¶
ConnectVerify is used to verify if ports are accurate using a connect request
func (*Scanner) EnqueueEthernet ¶
EnqueueEthernet outgoing Ethernet packets
func (*Scanner) EnqueueTCP ¶
EnqueueTCP outgoing TCP packets
func (*Scanner) EnqueueUDP ¶
EnqueueTCP outgoing TCP packets
func (*Scanner) StartWorkers ¶
StartWorkers of the scanner
func (*Scanner) TCPResultWorker ¶
TCPResultWorker handles probes and scan results
func (*Scanner) UDPResultWorker ¶
UDPResultWorker handles probes and scan results
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