sys

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureFirewall

func ConfigureFirewall(srcPort uint16) error

ConfigureFirewall configures iptables to drop all outgoing RST packets not originating from this uid, therefore preventing a connection reset by the kernel which it is not aware of any of our connections. sudo iptables -A OUTPUT -p tcp --sport <port> --tcp-flags RST RST -m owner ! --uid-owner <uid> -j DROP

func LocalIP

func LocalIP() (net.IP, error)

LocalIP fetches a local IP suitable for scanning.

func NewRawTCPSock

func NewRawTCPSock() (int, error)

NewRawTCPSock creates a new AF_INET, SOCK_RAW and IPPROTO_TCP socket and returns it's descriptor.

func RevertFirewall

func RevertFirewall(srcPort uint16) error

RevertFirewall deletes the previously set iptables rule.

Types

type EtherSender

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

EtherSender wraps a raw socket and the link layer.

func NewEtherSender

func NewEtherSender(iface string) (EtherSender, error)

NewEtherSender creates a new wrapper for sending Ethernet frames.

func (EtherSender) Send

func (s EtherSender) Send(packet []byte) error

Send sends an Ethernet frame.

Jump to

Keyboard shortcuts

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