Documentation
¶
Overview ¶
Package sqarol generates domain typosquatting variations for a given domain name. It produces look-alike domains annotated with the generation technique, Levenshtein edit distance, and a visual deceptiveness score.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckOption ¶ added in v0.1.3
type CheckOption func(*checkConfig)
CheckOption configures which checks to perform during a domain check.
func WithParking ¶ added in v0.1.3
func WithParking() CheckOption
WithParking enables parking detection.
func WithRegistration ¶ added in v0.1.3
func WithRegistration() CheckOption
WithRegistration enables NS-based registration check.
type DomainCheck ¶
type DomainCheck struct {
// Domain is the queried domain name.
Domain string `json:"domain"`
// IsRegistered indicates whether the domain is registered.
// Determined by the presence of NS records for the domain.
IsRegistered bool `json:"is_registered"`
// Owner is the registrant organization or name extracted from WHOIS,
// if available.
Owner string `json:"owner,omitempty"`
// HasARecords indicates whether the domain has IPv4 address records.
HasARecords bool `json:"has_a_records"`
// HasMXRecords indicates whether the domain has mail exchange records.
HasMXRecords bool `json:"has_mx_records"`
// ARecords contains the resolved IPv4 addresses for the domain.
ARecords []string `json:"a_records,omitempty"`
// MXRecords contains the resolved mail exchange records with their IPs.
MXRecords []MXRecord `json:"mx_records,omitempty"`
// IsParked indicates whether the domain appears to be parked,
// based on known parking nameservers and IP addresses.
IsParked bool `json:"is_parked"`
}
DomainCheck holds the results of checking a domain's registration and DNS status.
func Check ¶
func Check(ctx context.Context, domain string, opts ...CheckOption) (*DomainCheck, error)
Check queries DNS and WHOIS to determine whether a domain is registered, who owns it, and what A and MX records it has.
Registration is determined by the presence of NS records, which is the most reliable signal — a domain has NS records if and only if it has been delegated by the registry. WHOIS is queried separately to extract the registrant owner, with automatic referral following for richer results.
By default, all checks are performed. Use the variadic options to selectively enable specific checks (e.g., Check(ctx, domain, sqarol.WithDNS())) to only check DNS records.
It uses the provided context for cancellation and timeouts.
type MXRecord ¶ added in v0.1.1
type MXRecord struct {
// Host is the MX hostname (without trailing dot).
Host string `json:"host"`
// Pref is the MX preference value (lower = higher priority).
Pref uint16 `json:"pref"`
// IPs contains the resolved IPv4 addresses of the MX host.
IPs []string `json:"ips,omitempty"`
}
MXRecord holds a resolved mail exchange record.
type Variation ¶
type Variation struct {
// Original is the normalized input domain.
Original string `json:"original"`
// Variant is the generated typo-squatted domain.
Variant string `json:"variant"`
// Kind identifies the algorithm that produced this variation.
Kind string `json:"kind"`
// Distance is the Levenshtein distance between Original and Variant.
Distance int `json:"distance"`
// Effectiveness is a score from 0.0 to 1.0 representing how hard
// it is for a human to visually detect the difference. Higher values
// mean the variation is more deceptive.
Effectiveness float64 `json:"effectiveness"`
}
Variation represents a single domain variation produced by one of the fuzzing algorithms.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
sqarol
command
sqarol is a command-line tool for domain typosquatting analysis.
|
sqarol is a command-line tool for domain typosquatting analysis. |
|
Package generators provides domain typosquatting variation algorithms.
|
Package generators provides domain typosquatting variation algorithms. |
