Documentation ¶
Index ¶
- func PrettyPrintScanResults(results map[uint16]string)
- func ReadSYNACKResponse(srcIP net.IP, dstIP net.IP, srcPort, dstPort uint16, timeout time.Duration) (string, error)
- func Scan(srcIP, dstIP net.IP, ports []uint16, timeout time.Duration) (map[uint16]string, error)
- func SendSYNPacket(packetData []byte, srcIP, dstIP net.IP) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrettyPrintScanResults ¶
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 ¶
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 ¶
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.