dns

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package dns checks a target domain's DNS posture: email anti-spoofing records (SPF, DKIM, DMARC), certificate-issuance control (CAA), and dangling / takeover-prone CNAMEs. Every check is passive — it performs DNS lookups only, never HTTP, and sends no attack traffic. Lookups honor ctx and are memoized for the scan.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithResolver

func WithResolver(ctx context.Context, r Resolver) context.Context

WithResolver attaches a Resolver to ctx (used by tests).

Types

type CAA

type CAA struct{}

CAA flags a domain with no CAA record (any CA may issue certs for it).

func (CAA) Category

func (CAA) Category() core.Category

func (CAA) Description

func (CAA) Description() string

func (CAA) ID

func (CAA) ID() string

func (CAA) Mode

func (CAA) Mode() core.Mode

func (CAA) OWASP

func (CAA) OWASP() []string

func (CAA) Run

func (CAA) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type DKIM

type DKIM struct{}

DKIM checks a handful of common selectors and reports when none publish a key. DKIM selectors are app-specific, so a miss is "possible", not confirmed.

func (DKIM) Category

func (DKIM) Category() core.Category

func (DKIM) Description

func (DKIM) Description() string

func (DKIM) ID

func (DKIM) ID() string

func (DKIM) Mode

func (DKIM) Mode() core.Mode

func (DKIM) OWASP

func (DKIM) OWASP() []string

func (DKIM) Run

func (DKIM) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type DMARC

type DMARC struct{}

DMARC flags a missing or monitor-only DMARC policy.

func (DMARC) Category

func (DMARC) Category() core.Category

func (DMARC) Description

func (DMARC) Description() string

func (DMARC) ID

func (DMARC) ID() string

func (DMARC) Mode

func (DMARC) Mode() core.Mode

func (DMARC) OWASP

func (DMARC) OWASP() []string

func (DMARC) Run

func (DMARC) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type DanglingCNAME

type DanglingCNAME struct{}

DanglingCNAME flags a CNAME that points to a name which does not resolve to any address — a classic dangling record.

func (DanglingCNAME) Category

func (DanglingCNAME) Category() core.Category

func (DanglingCNAME) Description

func (DanglingCNAME) Description() string

func (DanglingCNAME) ID

func (DanglingCNAME) ID() string

func (DanglingCNAME) Mode

func (DanglingCNAME) Mode() core.Mode

func (DanglingCNAME) OWASP

func (DanglingCNAME) OWASP() []string

func (DanglingCNAME) Run

type Resolver

type Resolver interface {
	LookupTXT(ctx context.Context, name string) ([]string, error)
	LookupCNAME(ctx context.Context, host string) (string, error)
	LookupHost(ctx context.Context, host string) ([]string, error)
	LookupCAA(ctx context.Context, name string) ([]string, error)
}

Resolver is the DNS surface the checks use. net.Resolver satisfies it; tests inject a fake. The engine does not provide one, so checks fall back to the system resolver via resolverFrom.

type SPF

type SPF struct{}

SPF flags a domain with no SPF record (or a dangerously permissive one).

func (SPF) Category

func (SPF) Category() core.Category

func (SPF) Description

func (SPF) Description() string

func (SPF) ID

func (SPF) ID() string

func (SPF) Mode

func (SPF) Mode() core.Mode

func (SPF) OWASP

func (SPF) OWASP() []string

func (SPF) Run

func (SPF) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type SubdomainTakeover

type SubdomainTakeover struct{}

SubdomainTakeover flags a CNAME to a takeover-prone provider whose backing resource appears unclaimed (target does not resolve).

func (SubdomainTakeover) Category

func (SubdomainTakeover) Category() core.Category

func (SubdomainTakeover) Description

func (SubdomainTakeover) Description() string

func (SubdomainTakeover) ID

func (SubdomainTakeover) Mode

func (SubdomainTakeover) Mode() core.Mode

func (SubdomainTakeover) OWASP

func (SubdomainTakeover) OWASP() []string

func (SubdomainTakeover) Run

Jump to

Keyboard shortcuts

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