scanner

package
v0.3.2-pre8 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyPrintScanResults

func PrettyPrintScanResults(results map[uint16]string)

func ReadSYNACKResponse

func ReadSYNACKResponse(srcIP net.IP, dstIP net.IP, srcPort, dstPort uint16, timeout time.Duration) (string, error)

ReadSYNACKResponse reads the response to a SYN packet sent to the specified destination IP and port, and returns the status of the port (open, closed, or filtered). It uses a PCAP handle to capture packets on the appropriate network interface, and applies a BPF filter to only capture relevant TCP packets. The function will block until a response is received or the specified timeout is reached, at which point it will return "filtered" if no response was received.

func Scan

func Scan(srcIP, dstIP net.IP, ports []uint16, timeout time.Duration) (map[uint16]string, error)

Scan performs a SYN scan on the given source and destination IP addresses and ports. It sends a SYN packet to each destination port and waits for a response. The function returns a map of port statuses, where the key is the port number and the value is the status ("open", "closed", "filtered", or "error"). The scan will timeout after the specified duration.

func SendSYNPacket

func SendSYNPacket(packetData []byte, srcIP, dstIP net.IP) error

SendSYNPacket sends a raw TCP SYN packet with the provided packet data, source IP, and destination IP. It creates a raw socket, binds it to the appropriate network interface, and sends the packet using the socket. This function is used to initiate a TCP connection by sending a SYN packet.

Types

This section is empty.

Jump to

Keyboard shortcuts

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