tools

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrCheck added in v1.0.2

func ErrCheck(err error)

func GetInterfaceIpv4Addr added in v1.0.2

func GetInterfaceIpv4Addr(interfaceName string, ipOverride string) (addr string, err error)

Thanks https://gist.github.com/schwarzeni/f25031a3123f895ff3785970921e962c

func GetPacketInfo added in v1.0.2

func GetPacketInfo(packet gopacket.Packet, p *PacketStruct, minimal bool)

Populate the PacketStruct

func IpBlacklistFilter added in v1.0.2

func IpBlacklistFilter(p *PacketStruct, blacklistMap map[string]bool, interfaceAddress string) bool

Create a blacklist map of outgoing IP's This is to prevent printing established traffic

For every packet add destination IP to blacklist (unless it's the listening device's IP)

This prevents the response from the remote server to get logged.
If the source IP (remote server) matches an IP that has already been a destination then dont log it.

This is to be able to only show connection attempts made from the outside

func MiniFilter

func MiniFilter(p *PacketStruct, memoryHashmap map[string]bool) bool

A basic version of the ignore filter stores all rows for x minutes so duplicates do not get printed

Returns true if srcIpPort and dstIpPort has been seen before

func PrintHeader added in v1.0.2

func PrintHeader(portScanMode bool, separatorCharacter string, minimal bool)

Print the header

func PrintPacketInfo added in v1.0.2

func PrintPacketInfo(p *PacketStruct, memoryHashmap map[string]bool, blacklistHashmap map[string]bool, t int64, sep string, minimal bool, portScanMode bool, interfaceAddress string)

Print packet information, return true if packet was printed

func StartCapture added in v1.0.2

func StartCapture(inputInterface string, snapshotLen int32, promiscuous bool, timeout time.Duration, separatorCharacter string, memoryLifetimeSeconds int, minimal bool, portScanMode bool, interfaceAddress string)

Types

type PacketStruct added in v1.0.2

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

Jump to

Keyboard shortcuts

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