Documentation ¶
Index ¶
- Constants
- Variables
- func AddQuicPrefix(b []byte) (m []byte)
- func GetDefaultQueryMsg() *dns.Msg
- func GetPathParamFromDoHPath(uri string) (path string, param string, err *custom_errors.DoEError)
- func GetRandomizedQueryHost(host string) string
- func ResolveHost(hostname string, resolver net.IP, qh ConventionalDNSQueryHandlerI) ([]*net.IP, error)
- type CertQueryHandler
- type CertificateQuery
- type CertificateQueryHandler
- type CertificateResponse
- type Conn
- type ConventionalDNSQuery
- type ConventionalDNSQueryHandler
- func NewCanaryQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
- func NewConventionalDNSQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
- func NewDDRDNSSECQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
- func NewDDRQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
- func NewEDSRQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
- func NewPTRQueryHandler(config *QueryConfig) (qh *ConventionalDNSQueryHandler)
- type ConventionalDNSQueryHandlerI
- type ConventionalDNSResponse
- type DNSQuery
- type DNSResponse
- type DefaultCertQueryHandler
- type DefaultDoTQueryHandler
- type DefaultQueryHandlerDNS
- type DefaultQuicQueryHandler
- type DoEQuery
- type DoEResponse
- type DoHQuery
- type DoHQueryHandler
- type DoHResponse
- type DoQQuery
- type DoQQueryHandler
- type DoQResponse
- type DoTQuery
- type DoTQueryHandler
- type DoTResponse
- type HttpQueryHandler
- type PTRQuery
- type QueryConfig
- type QueryHandler
- type QueryHandlerDNS
- type QueryResponse
- type QuicConn
- type QuicQueryHandler
- type SSHDialWrapper
- type SSHDialer
- type SSHQuery
- type SSHQueryHandler
- type SSHResponse
- type TCPDialer
Constants ¶
View Source
const DEFAULT_BACKOFF_TIME time.Duration = 5000 * time.Millisecond
View Source
const DEFAULT_DNS_PORT = 53
View Source
const DEFAULT_DOH_PARAM = "dns"
View Source
const DEFAULT_DOH_PATH = "/dns-query{?dns}"
View Source
const DEFAULT_DOH_PORT = 443
View Source
const DEFAULT_DOH_TIMEOUT = 10000 * time.Millisecond
View Source
const DEFAULT_DOQ_PORT = 853
see https://www.rfc-editor.org/rfc/rfc9250.html#section-4.1.1
View Source
const DEFAULT_DOQ_TIMEOUT time.Duration = 10000 * time.Millisecond
View Source
const DEFAULT_DOT_PORT = 853
View Source
const DEFAULT_DOT_TIMEOUT time.Duration = 10000 * time.Millisecond
View Source
const DEFAULT_RECURSIVE_RESOLVER = "8.8.8.8"
View Source
const DEFAULT_TCP_RETRIES = 1
View Source
const DEFAULT_TCP_TIMEOUT time.Duration = 5000 * time.Millisecond
View Source
const DEFAULT_TLS_PORT = 443
View Source
const DEFAULT_TLS_TIMEOUT time.Duration = 5000 * time.Millisecond
View Source
const DEFAULT_UDP_RETRIES = 3
View Source
const DEFAULT_UDP_TIMEOUT time.Duration = 5000 * time.Millisecond
View Source
const DNS_DOT_PROTOCOL = "tcp-tls"
View Source
const DNS_TCP = "tcp"
View Source
const DNS_UDP = "udp"
View Source
const DOH_MEDIA_TYPE = "application/dns-message"
View Source
const HTTP_GET = "GET"
View Source
const HTTP_POST = "POST"
View Source
const HTTP_VERSION_1 = "HTTP/1.1"
View Source
const HTTP_VERSION_2 = "HTTP2"
View Source
const HTTP_VERSION_3 = "HTTP3"
View Source
const MAX_DNS_FQDN_LENGTH = 255
see https://datatracker.ietf.org/doc/html/rfc1035#section-3.1 however, let's be slightly below the threshold
View Source
const MAX_SUBDOMAIN_LENGTH = 25
View Source
const MAX_URI_LENGTH = 2048
View Source
const QUERY_HOST = "measurement.raiun.de."
View Source
const SSH_PORT = 22
View Source
const SSH_TIMEOUT = 2500 * time.Millisecond
View Source
const TLS_PROTOCOL_TCP = "tcp"
View Source
const TLS_PROTOCOL_UDP = "udp"
Variables ¶
View Source
var DOQ_TLS_PROTOCOLS = []string{"doq", "dq"}
see https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml nolint: gochecknoglobals
Functions ¶
func AddQuicPrefix ¶
AddQuicPrefix adds a 2-byte prefix with the DNS message length. see https://datatracker.ietf.org/doc/html/rfc9250#section-4.2-4
func GetDefaultQueryMsg ¶
func GetPathParamFromDoHPath ¶
func GetPathParamFromDoHPath(uri string) (path string, param string, err *custom_errors.DoEError)
func GetRandomizedQueryHost ¶
func ResolveHost ¶
Types ¶
type CertQueryHandler ¶
type CertificateQuery ¶
type CertificateQuery struct { // Host is the host for the dialer (required) Host string `json:"host"` // Port is the port for the dialer (default: 443) Port int `json:"port"` // Protocol is the protocol for the dialer (default: "tcp") Protocol string `json:"protocol"` // Timeout is the timeout in ms (default: 2500) Timeout time.Duration `json:"timeout"` // SNI SNI string `json:"sni"` // ALPN protocol ALPN []string `json:"alpn"` }
func NewCertificateQuery ¶
func NewCertificateQuery() (q *CertificateQuery)
func (*CertificateQuery) Check ¶
func (cq *CertificateQuery) Check() (err custom_errors.DoEErrors)
type CertificateQueryHandler ¶
type CertificateQueryHandler struct {
QueryHandler CertQueryHandler
}
func NewCertificateQueryHandler ¶
func NewCertificateQueryHandler(config *QueryConfig) (*CertificateQueryHandler, error)
func (*CertificateQueryHandler) Query ¶
func (qh *CertificateQueryHandler) Query(q *CertificateQuery) (*CertificateResponse, custom_errors.DoEErrors)
type CertificateResponse ¶
type CertificateResponse struct { // Certificate is the certificate Certificates []*x509.Certificate `json:"certificates"` RetryWithoutCertificateVerification bool `json:"retry_without_certificate_verification"` }
type Conn ¶
type Conn interface { Close() error ConnectionState() tls.ConnectionState }
type ConventionalDNSQuery ¶
type ConventionalDNSQuery struct { DNSQuery // protocol to use (default: udp) Protocol string `json:"protocol"` // maximum number of UDP retries (default: 3) MaxUDPRetries int `json:"max_udp_retries"` // fallback to TCP if UDP fails (default: true) AutoFallbackTCP bool `json:"auto_fallback_tcp"` // maximum number of TCP retries (default: 1) MaxTCPRetries int `json:"max_tcp_retries"` // timeout in ms for UDP (default: 5000) // // if Timeout is set, it will overwrite this value TimeoutUDP time.Duration `json:"timeout_udp"` // timeout in ms for TCP (default: 5000) // // if Timeout is set, it will overwrite this value TimeoutTCP time.Duration `json:"timeout_tcp"` // maximum backoff time in ms (default: 5000) MaxBackoffTime time.Duration `json:"max_backoff_time"` }
func NewCanaryQuery ¶
func NewCanaryQuery(canaryDomain string, host string) *ConventionalDNSQuery
func NewConventionalQuery ¶
func NewConventionalQuery() *ConventionalDNSQuery
func NewDDRDNSSECQuery ¶
func NewDDRDNSSECQuery(targetName string) *ConventionalDNSQuery
func NewDDRQuery ¶
func NewDDRQuery() *ConventionalDNSQuery
func NewEDSRQuery ¶
func NewEDSRQuery(targetName string) *ConventionalDNSQuery
type ConventionalDNSQueryHandler ¶
type ConventionalDNSQueryHandler struct { ConventionalDNSQueryHandlerI Sleeper sleeper QueryHandler QueryHandlerDNS }
func NewCanaryQueryHandler ¶
func NewCanaryQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
func NewConventionalDNSQueryHandler ¶
func NewConventionalDNSQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
func NewDDRDNSSECQueryHandler ¶
func NewDDRDNSSECQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
func NewDDRQueryHandler ¶
func NewDDRQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
func NewEDSRQueryHandler ¶
func NewEDSRQueryHandler(config *QueryConfig) *ConventionalDNSQueryHandler
func NewPTRQueryHandler ¶
func NewPTRQueryHandler(config *QueryConfig) (qh *ConventionalDNSQueryHandler)
func (*ConventionalDNSQueryHandler) Query ¶
func (dq *ConventionalDNSQueryHandler) Query(query *ConventionalDNSQuery) (*ConventionalDNSResponse, custom_errors.DoEErrors)
type ConventionalDNSQueryHandlerI ¶
type ConventionalDNSQueryHandlerI interface {
Query(query *ConventionalDNSQuery) (res *ConventionalDNSResponse, err custom_errors.DoEErrors)
}
type ConventionalDNSResponse ¶
type ConventionalDNSResponse struct { Response *DNSResponse `json:"response"` WasTruncated bool `json:"was_truncated"` UDPAttempts int `json:"udp_attempts"` TCPAttempts int `json:"tcp_attempts"` AttemptErrors []string `json:"attempt_errors"` }
type DNSQuery ¶
type DNSQuery struct { // Host is the nameserver to query Host string `json:"host"` // QueryMsg is the DNS message to send QueryMsg *dns.Msg `json:"query_msg"` // Port is the port number (default: 443) Port int `json:"port"` // Timeout is the timeout in ms (default: 5000) Timeout time.Duration `json:"timeout"` // DNSSEC DNSSEC bool `json:"dnssec"` }
type DNSResponse ¶
type DefaultCertQueryHandler ¶
type DefaultCertQueryHandler struct {
// contains filtered or unexported fields
}
type DefaultDoTQueryHandler ¶
type DefaultDoTQueryHandler struct {
QueryHandler DoTQueryHandler
}
func NewDefaultDoTHandler ¶
func NewDefaultDoTHandler(config *QueryConfig) *DefaultDoTQueryHandler
func (*DefaultDoTQueryHandler) Query ¶
func (qh *DefaultDoTQueryHandler) Query(query *DoTQuery) (*DoTResponse, custom_errors.DoEErrors)
type DefaultQueryHandlerDNS ¶
func NewDefaultQueryHandler ¶
func NewDefaultQueryHandler(config *QueryConfig) *DefaultQueryHandlerDNS
type DefaultQuicQueryHandler ¶
type DefaultQuicQueryHandler struct {
Conn net.PacketConn
}
type DoEResponse ¶
type DoEResponse struct { DNSResponse TLSVersion string `json:"tls_version"` TLSCipherSuite string `json:"tls_cipher_suite"` CertificateVerified bool `json:"certificate_verified"` CertificateValid bool `json:"certificate_valid"` }
type DoHQuery ¶
type DoHQuery struct { DoEQuery // the URI path for the DoH query, usually /dns-query{?dns} URI string `json:"uri"` // HTTP method, either GET or POST Method string `json:"method"` // fallback to POST request if GET request is too long for URI (default: true) POSTFallback bool `json:"post_fallback"` // HTTP1, HTTP2 or HTTP3 support (default:HTTP2) HTTPVersion string `json:"http_version"` }
func NewDoHQuery ¶
func NewDoHQuery() (q *DoHQuery)
type DoHQueryHandler ¶
type DoHQueryHandler struct { // QueryHandler is an interface to execute HTTP requests QueryHandler HttpQueryHandler }
func NewDoHQueryHandler ¶
func NewDoHQueryHandler(config *QueryConfig) (*DoHQueryHandler, error)
func (*DoHQueryHandler) Query ¶
func (qh *DoHQueryHandler) Query(query *DoHQuery) (*DoHResponse, custom_errors.DoEErrors)
type DoHResponse ¶
type DoHResponse struct {
DoEResponse
}
type DoQQuery ¶
type DoQQuery struct {
DoEQuery
}
func NewDoQQuery ¶
func NewDoQQuery() (q *DoQQuery)
type DoQQueryHandler ¶
type DoQQueryHandler struct { // QueryHandler is the QUIC dial handler (defaults to quic.DialAddr) QueryHandler QuicQueryHandler }
func NewDoQQueryHandler ¶
func NewDoQQueryHandler(config *QueryConfig) (*DoQQueryHandler, error)
func (*DoQQueryHandler) Query ¶
func (qh *DoQQueryHandler) Query(query *DoQQuery) (*DoQResponse, custom_errors.DoEErrors)
This DoQ implementation is inspired by the q library, see https://github.com/natesales/q/blob/main/transport/quic.go
type DoQResponse ¶
type DoQResponse struct {
DoEResponse
}
type DoTQuery ¶
type DoTQuery struct {
DoEQuery
}
func NewDoTQuery ¶
func NewDoTQuery() (q *DoTQuery)
type DoTQueryHandler ¶
type DoTResponse ¶
type DoTResponse struct {
DoEResponse
}
type HttpQueryHandler ¶
type PTRQuery ¶
type PTRQuery struct {
ConventionalDNSQuery
}
func NewPTRQuery ¶
func NewPTRQuery() *PTRQuery
func (*PTRQuery) SetQueryMsg ¶
func (p *PTRQuery) SetQueryMsg(resolveIp string) custom_errors.DoEErrors
type QueryConfig ¶
type QueryHandler ¶
type QueryHandler interface {
Query(query *DNSQuery) (res *QueryResponse, err error)
}
type QueryHandlerDNS ¶
type QueryResponse ¶
type QueryResponse struct {
DNSResponse
}
type QuicQueryHandler ¶
type SSHDialWrapper ¶
type SSHDialWrapper struct{}
func (*SSHDialWrapper) NewClientConn ¶
func (sc *SSHDialWrapper) NewClientConn(c net.Conn, addr string, config *ssh.ClientConfig) (ssh.Conn, <-chan ssh.NewChannel, <-chan *ssh.Request, error)
type SSHQuery ¶
type SSHQuery struct { Host string `json:"host"` Port int `json:"port"` Timeout time.Duration Username string `json:"username"` }
func NewSSHQuery ¶
type SSHQueryHandler ¶
func NewSSHQueryHandler ¶
func NewSSHQueryHandler(config *QueryConfig) *SSHQueryHandler
func (*SSHQueryHandler) Query ¶
func (qh *SSHQueryHandler) Query(query *SSHQuery) (*SSHResponse, custom_errors.DoEErrors)
type SSHResponse ¶
Click to show internal directories.
Click to hide internal directories.