scanner

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

ARP table helpers. Resolves IP addresses to MAC addresses by shelling out to the system arp command (works on macOS and Linux).

OS fingerprinting based on ICMP TTL values and open port patterns. Accepts a pre-captured TTL so the device only gets pinged once.

Vendor lookup backed by the macvendors.com API. Results are cached in memory and outgoing requests are serialised with a short delay to stay within the free-tier rate limit.

Network scanner. Probes every host in a CIDR range concurrently using TCP connect and ICMP ping, then resolves hostname, MAC, vendor, latency, open ports, and OS for each live device.

Wake-on-LAN. Sends a magic packet (6x 0xFF + 16x MAC) via UDP broadcast to port 9 to wake a sleeping device on the network.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectNetwork

func DetectNetwork() (localIP string, cidr string, ifaceName string, err error)

func FingerprintOS

func FingerprintOS(openPorts []string, ttl int) string

func LookupMAC

func LookupMAC(ip string) string

func SendWOL

func SendWOL(macAddr string) error

Types

type Device

type Device struct {
	IP        string
	Hostname  string
	MAC       string
	Vendor    string
	OS        string
	Online    bool
	LastSeen  time.Time
	Latency   time.Duration
	OpenPorts []string
}

type DeviceFoundMsg

type DeviceFoundMsg struct{ Device Device }

type ErrMsg

type ErrMsg struct{ Err error }

type ScanCompleteMsg

type ScanCompleteMsg struct{}

type ScanProgressMsg

type ScanProgressMsg struct {
	Current int
	Total   int
}

type ScanStartMsg

type ScanStartMsg struct{}

type Scanner

type Scanner struct {
	Timeout      time.Duration
	Concurrency  int
	VendorLookup *VendorLookup
}

func New

func New() *Scanner

func (*Scanner) Scan

func (s *Scanner) Scan(ctx context.Context, cidr string, p *tea.Program)

type TickMsg

type TickMsg time.Time

type VendorLookup

type VendorLookup struct {
	// contains filtered or unexported fields
}

func NewVendorLookup

func NewVendorLookup() *VendorLookup

func (*VendorLookup) Lookup

func (vl *VendorLookup) Lookup(mac string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL