scanner

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 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, services map[uint16]string)

func ProcessCapturedPacket added in v0.3.4

func ProcessCapturedPacket(handle *pcap.Handle, srcIP, dstIP net.IP, srcPort, dstPort uint16, timeout time.Duration) (string, error)

ProcessCapturedPacket processes the captured packet and returns the status of the connection.

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.

func StartPacketCapture added in v0.3.4

func StartPacketCapture(srcIP, dstIP net.IP, srcPort, dstPort uint16) (*pcap.Handle, func(), error)

StartPacketCapture starts a packet capture on the specified source and destination IPs and ports.

Types

This section is empty.

Jump to

Keyboard shortcuts

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