Documentation
¶
Overview ¶
Package discovery implements a host discovery scan module using Nmap and related protocols.
Index ¶
- Constants
- func CheckSetup(nmapDir, nmapPath string) error
- func InitInventories(logger utils.Logger, config map[string]map[string]string) error
- func QueryInterfaces(target string) (string, []string, error)
- func Setup(logger utils.Logger, nmapDir string, nmapPath string) error
- type DCERPCTransport
- type Host
- type Inventory
- type Result
- type Scanner
- type Script
- type ServerAlive2Response
- type Service
Constants ¶
const Label = "Discovery"
Variables ¶
This section is empty.
Functions ¶
func CheckSetup ¶
CheckSetup checks whether Setup() executed accordingly. Scan arguments should be checked by the scanner.
func InitInventories ¶
func QueryInterfaces ¶
QueryInterfaces connects to a remote host via RPC to query its hostname and network interfaces
Types ¶
type DCERPCTransport ¶
type DCERPCTransport struct {
// contains filtered or unexported fields
}
type Host ¶
type Host struct {
MacAddress string
Ip string
DnsName string
OtherNames []string
OtherIps []string
Hops []string // Traceroute hops to the target host
OsGuesses []string
OsSmb string
LastBoot time.Time
Uptime time.Duration
DetectionReason string // Reason why Nmap considers this host "up"
AdminUsers []string
RdpUsers []string
Services []Service // mapping port to Service result
Scripts []Script // list of Script results
Company string // Optional attribute that could be filled by the agent with asset inventory information
Department string // Optional attribute that could be filled by the agent with asset inventory information
Owner string // Optional attribute that could be filled by the agent with asset inventory information
Critical bool // Optional attribute that could be filled by the agent with asset inventory information
Ad *ad.Ad
}
type Inventory ¶
type Inventory interface {
Init(logger utils.Logger, conf map[string]map[string]string) error
Initialized() bool
ByIp(logger utils.Logger, ip string) (company string, department string, owner string, hostnames []string, ips []string, critical bool, err error)
ByFqdn(logger utils.Logger, hostname string, expectedIps []string) (company string, department string, owner string, hostnames []string, ips []string, critical bool, err error)
}
type Scanner ¶
type Scanner struct {
Label string
Started time.Time
Finished time.Time
// contains filtered or unexported fields
}
func NewScanner ¶
func NewScanner( logger utils.Logger, targets []string, nmapPath string, nmapArgs []string, nmapVersionAll bool, nmapBlacklist []string, nmapBlacklistFile string, domainOrder []string, ldapServer string, ldapDomain string, ldapUser string, ldapPassword string, disableGssapi bool, excludeDomains []string, dialTimeout time.Duration, ) (*Scanner, error)
func (*Scanner) EnableOtScanner ¶ added in v1.1.0
EnableOtScanner initializes the OT discovery scanner (PROFINET DCP, EtherCAT, LLDP, etc.) and enables OT discovery scanning. A network interface to use for the OT scans must be defined. The OT scan can only target a local L2 network segment. sets the network interface for
func (*Scanner) Run ¶
Run starts scan execution. This must either be executed as a goroutine, or another thread must be active listening on the scan's result channel, in order to avoid a deadlock situation. The timeout argument is optional and allows cancelling the scan after a given duration. This timeout is intended for dry runs only. For actual scan timeouts, use appropriate Nmap arguments instead.
type ServerAlive2Response ¶
type ServerAlive2Response struct {
// contains filtered or unexported fields
}
type Service ¶
type Service struct {
Port int
Protocol string
Name string // ATTENTION: Nmap sometimes uses the tunnel attribute (XML output) to indicate an encrypted service port.
Tunnel string // ATTENTION: Nmap sometimes describes a service like "https" as "http" in combination with the tunnel attribute set to "SSL"!
Product string
Version string
DeviceType string
Flavor string
Cpes []string // "Common Platform Enumeration" describes platform indicated by the Service
Info string
Method string // Detection method used by Nmap
Ttl int // TTL to Service. If host has ports with different TTL there might be port forwarding active
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ad provides Active Directory and LDAP query capabilities for host discovery.
|
Package ad provides Active Directory and LDAP query capabilities for host discovery. |
|
Package netapi provides platform-specific network API wrappers for host discovery.
|
Package netapi provides platform-specific network API wrappers for host discovery. |
|
Package ot implements operational technology protocol scanners including PROFINET, EtherCAT, and mDNS.
|
Package ot implements operational technology protocol scanners including PROFINET, EtherCAT, and mDNS. |