dnstun

package module
v0.0.0-...-6e7f565 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 20 Imported by: 0

README

dnstun

DNS tunnel library in Go

Debug

For more verbose messages, add tags debug to the go build command:

go build -tags debug

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey() string

func ListenForClients

func ListenForClients(agentstr string, listen string, port int, session *yamux.Session) error

Catches local clients and connects to yamux

func RandBytes

func RandBytes(n int) []byte

RandBytes generates random bytes of n size It returns the generated random bytes

func YamuxConfig

func YamuxConfig() *yamux.Config

Types

type DnsTunnel

type DnsTunnel struct {
	TargetDomain  string
	EncryptionKey string
	PortNum       int
	PortInc       int
	ClientsListen string
	Dns           *dns.Server
	Transport     *transport.DnsStream
	Sleeptime     time.Duration
	Yamuxconfig   *yamux.Config
	ReadBuffer    map[string]MemBuffer
	// contains filtered or unexported fields
}

func NewDnsTunnel

func NewDnsTunnel(targetDomain string, encryptionKey string) *DnsTunnel

func (*DnsTunnel) DnsClient

func (dt *DnsTunnel) DnsClient() (*yamux.Session, error)

func (*DnsTunnel) DnsServer

func (dt *DnsTunnel) DnsServer(dnslisten string, clients string) error

func (*DnsTunnel) DnsServerStart

func (dt *DnsTunnel) DnsServerStart() error

func (*DnsTunnel) DnsTimeoutCheck

func (dt *DnsTunnel) DnsTimeoutCheck()

Function - Timeout checking loop

func (*DnsTunnel) HandleDnsRequest

func (dt *DnsTunnel) HandleDnsRequest(w dns.ResponseWriter, r *dns.Msg)

func (*DnsTunnel) ParseQuery

func (dt *DnsTunnel) ParseQuery(m *dns.Msg) Sessioninfo

func (*DnsTunnel) PollCacheCleaner

func (dt *DnsTunnel) PollCacheCleaner()

Function - Poll-cache cleaner

func (*DnsTunnel) SetDnsConfig

func (dt *DnsTunnel) SetDnsConfig(DnsDomain string, enckey string)

func (*DnsTunnel) SetDnsDelay

func (dt *DnsTunnel) SetDnsDelay(dnsdelay string) error

type MemBuffer

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

type Sessioninfo

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

func (*Sessioninfo) Close

func (si *Sessioninfo) Close() error

func (*Sessioninfo) Read

func (si *Sessioninfo) Read(data []byte) (int, error)

func (*Sessioninfo) Write

func (si *Sessioninfo) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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