Documentation ¶
Index ¶
- Variables
- type DNSOptions
- type DNSResolver
- type DNSResult
- type DNSWork
- type DNSWorker
- type GenericResolver
- type ResolverMetadata
- type SliverDNSClient
- func (s *SliverDNSClient) CloseSession() error
- func (s *SliverDNSClient) ReadEnvelope() (*pb.Envelope, error)
- func (s *SliverDNSClient) SessionInit() error
- func (s *SliverDNSClient) SplitBuffer(msg *dnspb.DNSMessage, encoder encoders.Encoder, data []byte) ([]string, error)
- func (s *SliverDNSClient) WriteEnvelope(envelope *pb.Envelope) error
- type SystemResolver
Constants ¶
This section is empty.
Variables ¶
var ( ErrTimeout = errors.New("{{if .Config.Debug}}DNS Timeout{{end}}") ErrClosed = errors.New("dns session closed") ErrInvalidResponse = errors.New("invalid response") ErrInvalidIndex = errors.New("invalid start/stop index") ErrEmptyResponse = errors.New("empty response") ErrInvalidMsg = errors.New("invalid dns message") )
var ( // ErrInvalidRcode - Returned when the response code is not a success ErrInvalidRcode = errors.New("invalid rcode") )
Functions ¶
This section is empty.
Types ¶
type DNSOptions ¶
type DNSOptions struct { QueryTimeout time.Duration RetryWait time.Duration RetryCount int MaxErrors int WorkersPerResolver int ForceBase32 bool NoTXT bool ForceResolvConf string ForceResolvers string }
DNSOptions - c2 specific options
func ParseDNSOptions ¶
func ParseDNSOptions(c2URI *url.URL) *DNSOptions
ParseDNSOptions - Parse c2 specific options
type DNSResolver ¶
type DNSResolver interface { Address() string A(string) ([]byte, time.Duration, error) AAAA(string) ([]byte, time.Duration, error) TXT(string) ([]byte, time.Duration, error) }
Abstraction on top of miekg/dns and net/dns
func NewGenericResolver ¶
func NewGenericResolver(address string, port string, retryWait time.Duration, retries int, timeout time.Duration, parent string) DNSResolver
NewGenericResolver - Instantiate a new generic resolver
func NewSystemResolver ¶
func NewSystemResolver() DNSResolver
NewSystemResolver - Initialize a new system resolver
type DNSWorker ¶
type DNSWorker struct { Metadata *ResolverMetadata Ctrl chan struct{} // contains filtered or unexported fields }
DNSWorker - Used for parallel send/recv
type GenericResolver ¶
type GenericResolver struct {
// contains filtered or unexported fields
}
GenericResolver - Cross-platform Go DNS resolver
func (*GenericResolver) Address ¶
func (r *GenericResolver) Address() string
Address - Return the address of the resolver
type ResolverMetadata ¶
type ResolverMetadata struct { Address string EnableBase58 bool Metrics []time.Duration Errors int }
ResolverMetadata - Metadata for the resolver
type SliverDNSClient ¶
type SliverDNSClient struct { WorkersPerResolver int // contains filtered or unexported fields }
SliverDNSClient - The DNS client context
func DNSStartSession ¶
func DNSStartSession(parent string, opts *DNSOptions) (*SliverDNSClient, error)
DNSStartSession - Attempt to establish a connection to the DNS server of 'parent'
func NewDNSClient ¶
func NewDNSClient(parent string, opts *DNSOptions) *SliverDNSClient
NewDNSClient - Initialize a new DNS client, generally you should use DNSStartSession instead of this function, this is exported mostly for unit testing
func (*SliverDNSClient) CloseSession ¶
func (s *SliverDNSClient) CloseSession() error
Close - Close the dns session
func (*SliverDNSClient) ReadEnvelope ¶
func (s *SliverDNSClient) ReadEnvelope() (*pb.Envelope, error)
ReadEnvelope - Recv an envelope from the server
func (*SliverDNSClient) SessionInit ¶
func (s *SliverDNSClient) SessionInit() error
SessionInit - Initialize DNS session
func (*SliverDNSClient) SplitBuffer ¶
func (s *SliverDNSClient) SplitBuffer(msg *dnspb.DNSMessage, encoder encoders.Encoder, data []byte) ([]string, error)
SplitBuffer - There's probably a fancy way to calculate this with math and shit but it's much easier to just encode bytes and check the length until we hit the limit
func (*SliverDNSClient) WriteEnvelope ¶
func (s *SliverDNSClient) WriteEnvelope(envelope *pb.Envelope) error
WriteEnvelope - Send an envelope to the server
type SystemResolver ¶
type SystemResolver struct {
// contains filtered or unexported fields
}
SystemResolver -
func (*SystemResolver) Address ¶
func (r *SystemResolver) Address() string
Address - Returns the address of the resolver