Documentation ¶
Index ¶
- type ArpScanResult
- type ArpScanner
- func (s *ArpScanner) IncludeHostNames(v bool)
- func (s *ArpScanner) IncludeVendorInfo(repo oui.VendorRepo)
- func (s *ArpScanner) Results() chan *ScanResult
- func (s *ArpScanner) Scan() error
- func (s *ArpScanner) SetIdleTimeout(duration time.Duration)
- func (s *ArpScanner) SetPacketCapture(cap PacketCapture)
- func (s *ArpScanner) SetRequestNotifications(c chan *Request)
- func (s *ArpScanner) SetTiming(d time.Duration)
- func (s *ArpScanner) Stop()
- type FullScanner
- func (s *FullScanner) IncludeHostNames(v bool)
- func (s *FullScanner) IncludeVendorInfo(repo oui.VendorRepo)
- func (s *FullScanner) Results() chan *ScanResult
- func (s *FullScanner) Scan() error
- func (s *FullScanner) SetIdleTimeout(d time.Duration)
- func (s *FullScanner) SetPacketCapture(cap PacketCapture)
- func (s *FullScanner) SetRequestNotifications(c chan *Request)
- func (s *FullScanner) SetTiming(d time.Duration)
- func (s *FullScanner) Stop()
- type Option
- type PacketCapture
- type PacketCaptureHandle
- type Port
- type PortStatus
- type Request
- type RequestType
- type ResultType
- type ScanResult
- type Scanner
- type Status
- type SynPacket
- type SynScanResult
- type SynScanner
- func (s *SynScanner) IncludeHostNames(v bool)
- func (s *SynScanner) IncludeVendorInfo(_ oui.VendorRepo)
- func (s *SynScanner) Results() chan *ScanResult
- func (s *SynScanner) Scan() error
- func (s *SynScanner) SetIdleTimeout(duration time.Duration)
- func (s *SynScanner) SetPacketCapture(cap PacketCapture)
- func (s *SynScanner) SetRequestNotifications(c chan *Request)
- func (s *SynScanner) SetTargets(targets []*ArpScanResult)
- func (s *SynScanner) SetTiming(d time.Duration)
- func (s *SynScanner) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArpScanResult ¶
ArpScanResult represents a single network device result from arp scan
func (*ArpScanResult) Serializable ¶
func (r *ArpScanResult) Serializable() interface{}
Serializable returns a serializable version of ArpScanResult
type ArpScanner ¶
type ArpScanner struct {
// contains filtered or unexported fields
}
ArpScanner implements the Scanner interface for ARP scanning
func NewArpScanner ¶
func NewArpScanner( targets []string, networkInfo network.Network, options ...Option, ) *ArpScanner
NewArpScanner returns a new instance of ArpScanner
func (*ArpScanner) IncludeHostNames ¶ added in v1.15.0
func (s *ArpScanner) IncludeHostNames(v bool)
IncludeHostNames sets whether reverse dns look up is performed to find hostname
func (*ArpScanner) IncludeVendorInfo ¶
func (s *ArpScanner) IncludeVendorInfo(repo oui.VendorRepo)
IncludeVendorInfo sets whether or not to include vendor info in the scan
func (*ArpScanner) Results ¶ added in v1.12.0
func (s *ArpScanner) Results() chan *ScanResult
Results returns the results channel for notifying when a target arp reply is detected
func (*ArpScanner) Scan ¶
func (s *ArpScanner) Scan() error
Scan implements the Scan method for ARP scanning
func (*ArpScanner) SetIdleTimeout ¶
func (s *ArpScanner) SetIdleTimeout(duration time.Duration)
SetIdleTimeout sets the idle timeout for this scanner
func (*ArpScanner) SetPacketCapture ¶ added in v1.9.0
func (s *ArpScanner) SetPacketCapture(cap PacketCapture)
SetPacketCapture sets the data structure used for capture packets
func (*ArpScanner) SetRequestNotifications ¶
func (s *ArpScanner) SetRequestNotifications(c chan *Request)
SetRequestNotifications sets the channel for notifying when ARP requests are sent
func (*ArpScanner) SetTiming ¶ added in v1.14.0
func (s *ArpScanner) SetTiming(d time.Duration)
SetTiming sets the timing duration for how long to wait in-between packet sends for ARP requests
type FullScanner ¶
type FullScanner struct {
// contains filtered or unexported fields
}
FullScanner implements Scanner interface to perform both ARP and SYN scanning
func NewFullScanner ¶
func NewFullScanner( netInfo network.Network, targets, ports []string, listenPort uint16, options ...Option, ) *FullScanner
NewFullScanner returns a new instance of FullScanner
func (*FullScanner) IncludeHostNames ¶ added in v1.15.0
func (s *FullScanner) IncludeHostNames(v bool)
IncludeHostNames sets whether reverse dns look up is performed to find hostname
func (*FullScanner) IncludeVendorInfo ¶
func (s *FullScanner) IncludeVendorInfo(repo oui.VendorRepo)
IncludeVendorInfo sets whether or not to include vendor info when scanning
func (*FullScanner) Results ¶ added in v1.12.0
func (s *FullScanner) Results() chan *ScanResult
Results returns the channel used for notifying of new scan results
func (*FullScanner) SetIdleTimeout ¶
func (s *FullScanner) SetIdleTimeout(d time.Duration)
SetIdleTimeout sets the idle timeout for ARP and SYN scanning
func (*FullScanner) SetPacketCapture ¶ added in v1.9.0
func (s *FullScanner) SetPacketCapture(cap PacketCapture)
SetPacketCapture sets the packet capture implementation for this scanner
func (*FullScanner) SetRequestNotifications ¶
func (s *FullScanner) SetRequestNotifications(c chan *Request)
SetRequestNotifications sets the channel for notifying when SYN & ARP requests are sent
func (*FullScanner) SetTiming ¶ added in v1.14.0
func (s *FullScanner) SetTiming(d time.Duration)
SetTiming sets the timing duration for how long to wait in-between packet sends for both ARP & SYN requests
type Option ¶ added in v1.14.1
type Option = func(s Scanner)
Option represents an option that can be passed to any of the "New" scanner constructors
func WithHostnames ¶ added in v1.15.0
WithHostnames sets whether or not to perform reverse dns lookup
func WithIdleTimeout ¶
WithIdleTimeout sets the idle timeout for the scanner
func WithPacketCapture ¶ added in v1.9.0
func WithPacketCapture(cap PacketCapture) Option
WithPacketCapture sets the packet capture implementation for the scanner
func WithRequestNotifications ¶
WithRequestNotifications sets channel for request notifications
func WithTiming ¶ added in v1.14.0
WithTiming sets the timing duration for how long to wait in-between each packet send
func WithVendorInfo ¶
func WithVendorInfo(repo oui.VendorRepo) Option
WithVendorInfo sets whether or not to include vendor info when scanning
type PacketCapture ¶ added in v1.9.0
type PacketCapture interface { OpenLive(device string, snaplen int32, promisc bool, timeout time.Duration) (handle PacketCaptureHandle, _ error) SerializeLayers(w gopacket.SerializeBuffer, opts gopacket.SerializeOptions, layers ...gopacket.SerializableLayer) error }
PacketCapture interface for creating PacketCaptureHandles and serializing packet layers
type PacketCaptureHandle ¶ added in v1.9.0
type PacketCaptureHandle interface { Close() ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) ZeroCopyReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) WritePacketData(data []byte) (err error) SetBPFFilter(expr string) (err error) }
PacketCaptureHandle interface for writing and reading packets to and from the wire
type Port ¶
type Port struct { ID uint16 `json:"id"` Service string `json:"service"` Status PortStatus `json:"status"` }
Port data structure representing a server port
type PortStatus ¶
type PortStatus string
PortStatus represents possible port statuses
const ( // PortOpen status used when a port is marked open PortOpen PortStatus = "open" // PortClosed status used when a port is marked closed PortClosed PortStatus = "closed" )
type Request ¶
type Request struct { Type RequestType IP string Port uint16 }
Request represents a notification for a request packet sent to target host
type RequestType ¶
type RequestType string
RequestType represents a type of request packet sent to target
const ( // ArpRequest represents an ARP request ArpRequest RequestType = "ARP" // SynRequest represents a SYN request SynRequest RequestType = "SYN" )
type ResultType ¶
type ResultType string
ResultType represents a type of result sent through the result channel in each scanner implementation
const ( // ARPResult represents an ARP Result message ARPResult ResultType = "ARP" // ARPDone represents an ARP Done message ARPDone ResultType = "ARP_DONE" // SYNResult represents an SYN Result message SYNResult ResultType = "SYN" // SYNDone represents an SYN Done message SYNDone ResultType = "SYN_DONE" )
type ScanResult ¶
type ScanResult struct { Type ResultType Payload any }
ScanResult represents a scanning result sent through the results channel in each in scanner implementation
type Scanner ¶
type Scanner interface { Scan() error Stop() Results() chan *ScanResult SetTiming(d time.Duration) SetRequestNotifications(c chan *Request) SetIdleTimeout(d time.Duration) IncludeVendorInfo(repo oui.VendorRepo) IncludeHostNames(v bool) SetPacketCapture(cap PacketCapture) }
Scanner interface for scanning network devices
type SynPacket ¶ added in v1.13.0
SynPacket represents a SYN packet response from one of the targeted hosts
type SynScanResult ¶
SynScanResult represents a single network device result from syn scan
type SynScanner ¶
type SynScanner struct {
// contains filtered or unexported fields
}
SynScanner implements the Scanner interface for SYN scanning
func NewSynScanner ¶
func NewSynScanner( targets []*ArpScanResult, networkInfo network.Network, ports []string, listenPort uint16, options ...Option, ) *SynScanner
NewSynScanner returns a new instance of SYNScanner
func (*SynScanner) IncludeHostNames ¶ added in v1.15.0
func (s *SynScanner) IncludeHostNames(v bool)
IncludeHostNames sets whether reverse dns look up is performed to find hostname
func (*SynScanner) IncludeVendorInfo ¶
func (s *SynScanner) IncludeVendorInfo(_ oui.VendorRepo)
IncludeVendorInfo N/A for SYN scanner but here to satisfy Scanner interface
func (*SynScanner) Results ¶ added in v1.12.0
func (s *SynScanner) Results() chan *ScanResult
Results returns the channel for notifying when SYN responses are received from targeted hosts
func (*SynScanner) SetIdleTimeout ¶
func (s *SynScanner) SetIdleTimeout(duration time.Duration)
SetIdleTimeout sets the idle timeout for this scanner
func (*SynScanner) SetPacketCapture ¶ added in v1.9.0
func (s *SynScanner) SetPacketCapture(cap PacketCapture)
SetPacketCapture sets the packet capture implementation for this scanner
func (*SynScanner) SetRequestNotifications ¶
func (s *SynScanner) SetRequestNotifications(c chan *Request)
SetRequestNotifications sets the channel for notifying when SYN requests are sent
func (*SynScanner) SetTargets ¶ added in v1.12.0
func (s *SynScanner) SetTargets(targets []*ArpScanResult)
SetTargets sets the targets for SYN scanning
func (*SynScanner) SetTiming ¶ added in v1.14.0
func (s *SynScanner) SetTiming(d time.Duration)
SetTiming sets the timing duration for how long to wait in-between packet sends for SYN requests