Documentation
¶
Index ¶
- func DecryptAESGCM(key []byte, ciphertext []byte) ([]byte, error)
- func DeriveKey(secret string) []byte
- func EncryptAESGCM(key []byte, plaintext []byte) ([]byte, error)
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) GenerateFakeClientHello(sni string, sessionID string) ([]byte, error)
- func (c *Connection) HandshakeClient(sni string, sessionID string) error
- func (c *Connection) HandshakeServer() (string, string, []byte, error)
- func (c *Connection) LocalAddr() net.Addr
- func (c *Connection) Read(b []byte) (int, error)
- func (c *Connection) ReadTLSRecord() ([]byte, error)
- func (c *Connection) RemoteAddr() net.Addr
- func (c *Connection) SetDeadline(t time.Time) error
- func (c *Connection) SetReadDeadline(t time.Time) error
- func (c *Connection) SetWriteDeadline(t time.Time) error
- func (c *Connection) Write(b []byte) (int, error)
- func (c *Connection) WriteTLSRecord(payload []byte) error
- type Protocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptAESGCM ¶
DecryptAESGCM decrypts ciphertext 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.