Documentation ¶
Index ¶
- Variables
- type Handler4
- type Handler6
- func (h *Handler6) Close() error
- func (h *Handler6) FindRouter(ip netip.Addr) Router
- func (h *Handler6) PingAll() error
- func (h *Handler6) PrintTable()
- func (h *Handler6) ProcessPacket(pkt packet.Frame) (err error)
- func (h *Handler6) StartHunt(addr packet.Addr) (packet.HuntStage, error)
- func (h *Handler6) StartRADVS(managed bool, other bool, prefixes []packet.PrefixInformation, ...) (*RADVS, error)
- func (h *Handler6) StopHunt(addr packet.Addr) (packet.HuntStage, error)
- type RADVS
- type Router
Constants ¶
This section is empty.
Variables ¶
var Logger4 = fastlog.New("icmp4")
var Logger6 = fastlog.New("icmp6")
var ( RDNSSCLoudflare = &packet.RecursiveDNSServer{ Lifetime: time.Minute * 10, Servers: []net.IP{packet.DNSv6Cloudflare1.AsSlice(), packet.DNSv6Cloudflare2.AsSlice()}, } )
Functions ¶
This section is empty.
Types ¶
type Handler4 ¶
type Handler4 struct {
// contains filtered or unexported fields
}
Handler4 maintains the underlying socket connection
func (*Handler4) ProcessPacket ¶
ProcessPacket parses an ICMP4 packet and log the frame.
This is a simple processor to common ICMP4 packets includin echo request/reply, destination unreacheable and redirect. It does not contain any logic beyond logging.
type Handler6 ¶
type Handler6 struct { Router *Router LANRouters map[netip.Addr]*Router sync.Mutex // contains filtered or unexported fields }
Handler implements ICMPv6 Neighbor Discovery Protocol see: https://mdlayher.com/blog/network-protocol-breakdown-ndp-and-go/
func (*Handler6) Close ¶
Close releases underlying resources. The handler is not longer usable after calling Close().
func (*Handler6) PingAll ¶
PingAll sends an echo request to the IPv6 multicast address to encourage hosts to reply.
func (*Handler6) PrintTable ¶
func (h *Handler6) PrintTable()
PrintTable logs ICMP6 tables to standard out
func (*Handler6) ProcessPacket ¶
ProcessPacket handles icmp6 packets and executes neighbor advertising spoofing for target LLAs.
func (*Handler6) StartHunt ¶
StartHunt will actively poison the target IP with fake icmp6 NA to redirect all traffic to us. Poisoning will continue until StopHunt() is called.
The target IP must be a IPv6 LLA or nil. If IP is nil, we use unicast ethernet address but the multicast ip address to get the packet to the target host.
func (*Handler6) StartRADVS ¶
func (h *Handler6) StartRADVS(managed bool, other bool, prefixes []packet.PrefixInformation, rdnss *packet.RecursiveDNSServer) (*RADVS, error)
type Router ¶
type Router struct { Addr packet.Addr ManagedFlag bool // if true, hosts should get IP from DHCP, if false, use SLAAC IP OtherCondigFlag bool // if true, hosts should get other info from DHCP Preference byte MTU uint32 ReacheableTime int // Must be no greater than 3,600,000 milliseconds (1hour) RetransTimer int // CurHopLimit uint8 DefaultLifetime time.Duration // A value of zero means the router is not to be used as a default router Prefixes []packet.PrefixInformation RDNSS *packet.RecursiveDNSServer // Pointer to facilitate comparison Options packet.NewOptions // contains filtered or unexported fields }
Router holds a router identification and is useful to implement Router Advertisement Servers.
As of April 22, THIS IS INCOMPLETE and not working yet