scanner

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

ARP scanning requires libpcap. macOS: available via Xcode command line tools or `brew install libpcap` Linux: `apt install libpcap-dev` or equivalent

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ARPScan

func ARPScan(iface *netinfo.InterfaceInfo, onHost func(ip string, mac net.HardwareAddr)) error

func FallbackScan

func FallbackScan(iface *netinfo.InterfaceInfo, onHost func(ip string, mac net.HardwareAddr)) error

FallbackScan discovers hosts without root by parsing arp -a and doing a ping sweep.

func MeasureLatency

func MeasureLatency(ip string, openPorts []int) (time.Duration, error)

MeasureLatency measures round-trip time to a host. It tries TCP connect to known open ports, falling back to port 80.

func RunScan

func RunScan(p *tea.Program, state *models.ScanState, cfg ScanConfig)

RunScan performs the full scan pipeline, sending messages to the Bubble Tea program.

func ScanPorts

func ScanPorts(ip string, ports []int) []models.Port

ScanPorts scans the given ports on a host using TCP connect.

Types

type HostDiscoveredMsg

type HostDiscoveredMsg struct {
	IP  string
	MAC string
}

type ScanCompleteMsg

type ScanCompleteMsg struct{}

type ScanConfig

type ScanConfig struct {
	Interface string
	Range     string
	Ports     []int
	TopPorts  int
	FastMode  bool
}

type ScanProgressMsg

type ScanProgressMsg struct {
	Phase    string
	Progress float64
}

Messages sent to the Bubble Tea program during scanning

Jump to

Keyboard shortcuts

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