tcp

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package tcp provides a raw TCP client for exploit modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Conn    net.Conn
	Target  string
	Timeout time.Duration
	// contains filtered or unexported fields
}

Session holds a TCP connection to a target.

func Dial

func Dial(ctx context.Context, target string, timeout time.Duration) (*Session, error)

Dial connects to target (host:port) with context and timeout.

func FromModule

func FromModule(params sdk.Params) (*Session, error)

FromModule creates a TCP session from module params (mirrors http.FromModule).

func (*Session) Close

func (s *Session) Close() error

Close closes the connection.

func (*Session) Recv

func (s *Session) Recv(n int) ([]byte, error)

Recv reads up to n bytes from the connection.

func (*Session) Send

func (s *Session) Send(data []byte) error

Send writes data to the connection.

func (*Session) SendRecv

func (s *Session) SendRecv(data []byte, recvSize int) ([]byte, error)

SendRecv sends data and reads the response.

Jump to

Keyboard shortcuts

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