protocol

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptAESGCM

func DecryptAESGCM(key []byte, ciphertext []byte) ([]byte, error)

DecryptAESGCM decrypts ciphertext using AES-GCM with the derived key

func DeriveKey

func DeriveKey(secret string) []byte

DeriveKey creates a 32-byte AES key from a string (e.g., UUID)

func EncryptAESGCM

func EncryptAESGCM(key []byte, plaintext []byte) ([]byte, error)

EncryptAESGCM encrypts plaintext using AES-GCM with the derived key

Types

type Connection

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

Connection wraps a net.Conn with Mimic protocol logic

func Dial

func Dial(address string, secret string) (*Connection, error)

Dial connects to the remote address

func NewConnection

func NewConnection(conn net.Conn, secret string) *Connection

NewConnection creates a new Mimic connection wrapper

func (*Connection) Close

func (c *Connection) Close() error

Close closes the underlying connection

func (*Connection) GenerateFakeClientHello

func (c *Connection) GenerateFakeClientHello(sni string, sessionID string) ([]byte, error)

GenerateFakeClientHello leverages uTLS to generate a robust Chrome fingerprint

func (*Connection) HandshakeClient

func (c *Connection) HandshakeClient(sni string, sessionID string) error

HandshakeClient performs the client-side handshake

func (*Connection) HandshakeServer

func (c *Connection) HandshakeServer() (string, string, []byte, error)

HandshakeServer peeks at the ClientHello. Returns SNI, SessionID, the peeked hello bytes, and error.

func (*Connection) LocalAddr

func (c *Connection) LocalAddr() net.Addr

LocalAddr returns the local network address

func (*Connection) Read

func (c *Connection) Read(b []byte) (int, error)

Read reads data, stripping the TLS 1.3 Application Data record framing

func (*Connection) ReadTLSRecord

func (c *Connection) ReadTLSRecord() ([]byte, error)

ReadTLSRecord reads a TLS 1.3 Application Data record

func (*Connection) RemoteAddr

func (c *Connection) RemoteAddr() net.Addr

RemoteAddr returns the remote network address

func (*Connection) SetDeadline

func (c *Connection) SetDeadline(t time.Time) error

SetDeadline sets the read and write deadlines

func (*Connection) SetReadDeadline

func (c *Connection) SetReadDeadline(t time.Time) error

SetReadDeadline sets the deadline for future Read calls

func (*Connection) SetWriteDeadline

func (c *Connection) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the deadline for future Write calls

func (*Connection) Write

func (c *Connection) Write(b []byte) (int, error)

Write sends data, wrapping it in a TLS 1.3 Application Data record

func (*Connection) WriteTLSRecord

func (c *Connection) WriteTLSRecord(payload []byte) error

WriteTLSRecord wraps payload in a TLS 1.3 Application Data record

type Protocol

type Protocol interface {
	// Handshake establishes a secure connection with the server
	Handshake() error
	// Send transmits data with the current mimicry pattern
	Send(data []byte) (int, error)
	// Receive reads data from the connection
	Receive() ([]byte, error)
}

Protocol defines the core interface for the Mimic protocol. It handles the obfuscation and transmission of data.

Jump to

Keyboard shortcuts

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