arpspoof

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package arpspoof

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ARPSpoofConfig

type ARPSpoofConfig struct {
	Targets    string
	Gateway    *netip.Addr
	Interface  string
	FullDuplex bool
	Logger     *zerolog.Logger
	Debug      bool
}

func NewARPSpoofConfig added in v0.0.10

func NewARPSpoofConfig(s string, logger *zerolog.Logger) (*ARPSpoofConfig, error)

NewARPSpoofConfig creates ARPSpoofConfig from a list of options separated by semicolon and logger.

Example: "targets 10.0.0.1,10.0.0.5-10,192.168.1.*,192.168.10.0/24;fullduplex false;debug true;interface eth0;gateway 192.168.1.1". All fields in configuration string are optional.

type ARPSpoofer

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

func NewARPSpoofer

func NewARPSpoofer(conf *ARPSpoofConfig) (*ARPSpoofer, error)

func (*ARPSpoofer) ARPTable added in v0.0.14

func (ar *ARPSpoofer) ARPTable() *ARPTable

func (*ARPSpoofer) GatewayIP added in v0.0.14

func (ar *ARPSpoofer) GatewayIP() netip.Addr

func (*ARPSpoofer) GatewayMAC added in v0.0.14

func (ar *ARPSpoofer) GatewayMAC() net.HardwareAddr

func (*ARPSpoofer) HostIP added in v0.0.14

func (ar *ARPSpoofer) HostIP() netip.Addr

func (*ARPSpoofer) HostMAC added in v0.0.14

func (ar *ARPSpoofer) HostMAC() net.HardwareAddr

func (*ARPSpoofer) Interface added in v0.0.14

func (ar *ARPSpoofer) Interface() *net.Interface

func (*ARPSpoofer) Start

func (ar *ARPSpoofer) Start()

func (*ARPSpoofer) Stop

func (ar *ARPSpoofer) Stop() error

type ARPTable

type ARPTable struct {
	sync.RWMutex
	Ifname  string
	Entries map[string]net.HardwareAddr
}

func (*ARPTable) Delete

func (at *ARPTable) Delete(ip netip.Addr)

func (*ARPTable) Get

func (at *ARPTable) Get(ip netip.Addr) (net.HardwareAddr, bool)

func (*ARPTable) Refresh

func (at *ARPTable) Refresh() error

func (*ARPTable) Set

func (at *ARPTable) Set(ip netip.Addr, hw net.HardwareAddr)

func (*ARPTable) String

func (at *ARPTable) String() string

type Packet

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

Jump to

Keyboard shortcuts

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