MCPcopy Index your code
hub / github.com/owasp-amass/resolve

github.com/owasp-amass/resolve @v0.10.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.0 ↗ · + Follow
219 symbols 866 edges 39 files 35 documented · 16% 115 cross-repo links updated 4mo ago★ 521 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GitHub Test Status GoDoc License Go Report CodeFactor Maintainability codecov

Leverage Many Recursive DNS Servers

Designed to support DNS brute-forcing with minimal system resources:

  • Easy to send a large number of queries concurrently
  • Hundreds of DNS nameservers can easily be leveraged
  • A minimal number of goroutines are employed by the package
  • Provides features like DNS wildcard detection and NSEC traversal

Installation Go Version

go get -v -u github.com/owasp-amass/resolve@master

Usage

qps := 15
var nameservers = []string{
    "8.8.8.8",        // Google
    "1.1.1.1",        // Cloudflare
    "9.9.9.9",        // Quad9
    "208.67.222.222", // Cisco OpenDNS
    "84.200.69.80",   // DNS.WATCH
    "64.6.64.6",      // Neustar DNS
    "8.26.56.26",     // Comodo Secure DNS
    "205.171.3.65",   // Level3
    "134.195.4.2",    // OpenNIC
    "185.228.168.9",  // CleanBrowsing
    "76.76.19.19",    // Alternate DNS
    "37.235.1.177",   // FreeDNS
    "77.88.8.1",      // Yandex.DNS
    "94.140.14.140",  // AdGuard
    "38.132.106.139", // CyberGhost
    "74.82.42.42",    // Hurricane Electric
    "76.76.2.0",      // ControlD
}
r := resolve.NewResolvers()
_ = r.AddResolvers(qps, nameservers...)
defer r.Stop()

ctx, cancel := context.WithTimeout(context.Background(), 30 * time.Second)
defer cancel()

ch := make(chan *dns.Msg, 100)
go func() {
    for _, name := range names {
        r.Query(ctx, resolve.QueryMsg(name, 1), ch)
    }
}()

for {
    select {
    case <-ctx.Done():
        return
    case resp := <-ch:
        if resp.Rcode == dns.RcodeSuccess && len(resp.Answer) > 0 {
            ans := ExtractAnswers(resp)
            domain, err := publicsuffix.EffectiveTLDPlusOne(ans[0].Name)

            if err == nil && !r.WildcardDetected(ctx, resp, domain) {
                fmt.Printf("%s resolved to %s\n", ans[0].Name, ans[0].Data)
            }
        }
    }
}

Licensing License

This program is free software: you can redistribute it and/or modify it under the terms of the Apache license.

Extension points exported contracts — how you extend this code

XchgManager (Interface)
XchgManager handles DNS message IDs and identifying messages that have timed out. [1 implementers]
types/servers.go
Selector (Interface)
(no doc) [3 implementers]
types/selectors.go
Conn (Interface)
(no doc) [1 implementers]
types/conn.go
Request (Interface)
(no doc) [1 implementers]
types/request.go
NewServer (FuncType)
(no doc)
selectors/auth.go
Nameserver (Interface)
(no doc) [1 implementers]
types/servers.go
RateTrack (Interface)
(no doc) [1 implementers]
types/servers.go

Core symbols most depended-on inside this repo

Close
called by 50
types/conn.go
String
called by 34
cmd/resolve/io.go
QueryMsg
called by 24
utils/msgs.go
Stop
called by 19
pool/pool.go
RemoveLastDot
called by 13
utils/msgs.go
Add
called by 12
types/servers.go
Address
called by 11
types/servers.go
Exchange
called by 11
pool/pool.go

Shape

Method 99
Function 97
Struct 15
Interface 6
FuncType 1
TypeAlias 1

Languages

Go100%

Modules by API surface

types/request.go19 symbols
types/servers.go18 symbols
selectors/auth.go16 symbols
pool/pool_test.go13 symbols
wildcards/wildcards.go10 symbols
servers/nameserver_test.go10 symbols
cmd/resolve/main.go10 symbols
servers/xchg.go8 symbols
servers/nameserver.go8 symbols
conn/connection.go8 symbols
cmd/resolve/io.go8 symbols
selectors/round.go7 symbols

For agents

$ claude mcp add resolve \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact