Documentation
¶
Overview ¶
Package dnsx leverages the dnsx utility and other opensource dns projects to run dns queries for varies records including dmarc, dkim, and other technology oriented analysis related to domains
Index ¶
- func PrintDNSRecordsReportTable(report DNSRecordsReport)
- type DNSRecord
- type DNSRecords
- type DNSRecordsReport
- type DNSSubenumReport
- type DNSSubenumType
- type DNSX
- type DomainTakeover
- type DomainTakeoverReport
- type Fingerprint
- type IPAddress
- type Option
- func WithBaseResolvers(resolvers []string) Option
- func WithHostsfile(hostsfile bool) Option
- func WithMaxRetries(retries int) Option
- func WithOutputCDN(outputCDN bool) Option
- func WithQueryAll(queryAll bool) Option
- func WithQuestionTypes(types []uint16) Option
- func WithTrace(trace bool) Option
- func WithTraceMaxRecursion(m int) Option
- type Options
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintDNSRecordsReportTable ¶
func PrintDNSRecordsReportTable(report DNSRecordsReport)
PrintDNSRecordsReportTable prints the DNS records report in a table format with colorized output and fixed-width columns
Types ¶
type DNSRecord ¶
type DNSRecord struct {
Name string `json:"name"`
TTL int `json:"ttl"`
Type string `json:"type"`
Value string `json:"value"`
IP *IPAddress `json:"ip,omitempty"`
CDN string `json:"cdn,omitempty"`
}
DNSRecord represents a DNS record with its associated properties
type DNSRecords ¶
type DNSRecords struct {
A []*DNSRecord `json:"a,omitempty"`
AAAA []*DNSRecord `json:"aaaa,omitempty"`
MX []*DNSRecord `json:"mx,omitempty"`
Txt []*DNSRecord `json:"txt,omitempty"`
NS []*DNSRecord `json:"ns,omitempty"`
CNAME []*DNSRecord `json:"cname,omitempty"`
SPF []*DNSRecord `json:"spf,omitempty"`
DMARC []*DNSRecord `json:"dmarc,omitempty"`
CAA []*DNSRecord `json:"caa,omitempty"`
SSHFP []*DNSRecord `json:"sshfp,omitempty"`
DS []*DNSRecord `json:"ds,omitempty"`
URI []*DNSRecord `json:"uri,omitempty"`
HTTPS []*DNSRecord `json:"https,omitempty"`
SMIME []*DNSRecord `json:"smime,omitempty"`
SPKI []*DNSRecord `json:"spki,omitempty"`
ALIAS []*DNSRecord `json:"alias,omitempty"`
PTR []*DNSRecord `json:"ptr,omitempty"`
}
DNSRecords represents a collection of DNS records of various types
type DNSRecordsReport ¶
type DNSRecordsReport struct {
Domain string `json:"domain"`
DNSRecords *DNSRecords `json:"dnsRecords,omitempty"`
DMARCDomain *string `json:"dmarcDomain,omitempty"`
DMARCDNSRecords *DNSRecords `json:"dmarcDNSRecords,omitempty"`
DKIMDomain *string `json:"dkimDomain,omitempty"`
DKIMDNSRecords *DNSRecords `json:"dkimDNSRecords,omitempty"`
CDNName *string `json:"cdnName,omitempty"`
Errors []string `json:"errors,omitempty"`
}
DNSRecordsReport represents a report of DNS records for a specific domain
type DNSSubenumReport ¶
type DNSSubenumReport struct {
Domain string `json:"domain"`
EnumerationType DNSSubenumType `json:"enumerationType"`
Subdomains []string `json:"subdomains,omitempty"`
Errors []string `json:"errors,omitempty"`
}
DNSSubenumReport represents a report of DNS subdomain enumeration for a specific domain
type DNSSubenumType ¶
type DNSSubenumType string
DNSSubenumType represents the type of DNS subdomain enumeration
const ( DNSSubenumTypeBrute DNSSubenumType = "BRUTE" DNSSubenumTypePassive DNSSubenumType = "PASSIVE" )
type DNSX ¶
type DNSX struct {
// Client is the dnsx client
Client *pddnsx.DNSX
// Options are the dnsx options
Options *Options
// Records are the DNS records
Records DNSRecordsReport
// CDNCheck is the CDN check client
CDNCheck *cdncheck.Client
}
DNSX is a wrapper around the dnsx library for client initialization and functional options settings
func (*DNSX) GetDomainDNSRecords ¶
func (d *DNSX) GetDomainDNSRecords(domain string) (DNSRecordsReport, error)
GetDomainDNSRecords queries DNS for all records for a given domain
type DomainTakeover ¶
type DomainTakeover struct {
Target string `json:"target"`
StatusCode int `json:"statusCode"`
ResponseBody string `json:"responseBody"`
Domain string `json:"domain"`
CNAME string `json:"cname"`
Services []*Service `json:"services,omitempty"`
}
DomainTakeover represents a potential domain takeover vulnerability
type DomainTakeoverReport ¶
type DomainTakeoverReport struct {
DomainTakeovers []*DomainTakeover `json:"domainTakeovers,omitempty"`
Errors []string `json:"errors,omitempty"`
}
DomainTakeoverReport represents a report of potential domain takeover vulnerabilities
type Fingerprint ¶
type Fingerprint struct {
CICDPass bool `json:"cicdPass"`
CNAME []string `json:"cname,omitempty"`
Discussion string `json:"discussion"`
Documentation string `json:"documentation"`
Fingerprint string `json:"fingerprint"`
HTTPStatus *int `json:"httpStatus,omitempty"`
NXDomain bool `json:"nxDomain"`
Service string `json:"service"`
Status string `json:"status"`
Vulnerable bool `json:"vulnerable"`
}
Fingerprint represents a system fingerprint to detect domain takeovers
type IPAddress ¶
type IPAddress struct {
IP string `json:"ip"`
RDNS string `json:"rdns"`
Dedicated bool `json:"dedicated"`
}
IPAddress represents an IP address with its associated properties
type Option ¶
type Option func(*Options)
Option is a functional option for the DNSX client
func WithBaseResolvers ¶
WithBaseResolvers sets the base resolvers for the DNSX client
func WithHostsfile ¶
WithHostsfile sets the hostsfile option for the DNSX client
func WithMaxRetries ¶
WithMaxRetries sets the max retries for the DNSX client
func WithOutputCDN ¶
WithOutputCDN sets the output CDN option for the DNSX client
func WithQueryAll ¶
WithQueryAll sets the query all option for the DNSX client
func WithQuestionTypes ¶
WithQuestionTypes sets the question types for the DNSX client
func WithTraceMaxRecursion ¶
WithTraceMaxRecursion sets the max recursion for the trace option
type Options ¶
type Options struct {
// BaseResolvers are the base resolvers to use
BaseResolvers []string
// MaxRetries is the max number of retries to use
MaxRetries int
// QuestionTypes are the question types to use
QuestionTypes []uint16
// Trace is the trace option
Trace bool
// TraceMaxRecursion is the max recursion for the trace option
TraceMaxRecursion int
// Hostsfile is the hostsfile option
Hostsfile bool
// OutputCDN is the output CDN option
OutputCDN bool
// QueryAll is the query all option
QueryAll bool
// Proxy is the proxy option
Proxy string
}
Options are the options for the DNSX client
func NewOptions ¶
NewOptions creates a new Options struct with default values and allows overrides