Skip to main content

DNS records

Manage DNS records

Usage:
/dns [command]

Available Commands:
/new Create new DNS records
/del Delete DNS record
/list List DNS records
/clr Delete multiple DNS records

Flags:
-h, --help help for dns

Use "/dns [command] --help" for more information about a command.
  • You can manage DNS records for subdomains of your payload domains.
  • There are several record types supported: "A", "АААА", "МХ", "ТХТ", "CNAME", "NS", "CAA".
  • You can set TTL for records.
  • Wildcard records are supported.
  • Multiple records are supported with different strategies:
    • all — All values for the record are returned at once.
    • round-robin - Values for the record are rotated (first returned, then second, then third, etc.)
    • rebind - Value for the record depends on time between requests. If time > 3s, the first value is returned, otherwise the second value.

Create new DNS record

Create new DNS records

Usage:
/dns new VALUES... [flags]

Flags:
-h, --help help for new
-n, --name string Subdomain
-p, --payload string Payload name
-s, --strategy string Strategy for multiple records (one of "all", "round-robin", "rebind") (default "all")
-l, --ttl int Record TTL (in seconds) (default 60)
-t, --type string Record type (one of "A", "AAAA", "MX", "TXT", "CNAME", "NS", "CAA") (default "A")

Create A-record with IP 127.0.0.1 for payload

/dns new --payload <NAME> --name <SUBDOMAIN> --type A 127.0.0.1

Create new DNS recordCreate new DNS record

Now abc.d14a68e4.sonar.test will respond with IP-address 127.0.0.1 for A-query:

Test DNSTest DNS

And you will also receive an alert:

DNS test alertDNS test alert

Create multiple A-records for payload

/dns new -p <NAME> -n <SUBDOMAIN> -t A 1.1.1.1 2.2.2.2 3.3.3.3

Create new DNS record with multiple IPsCreate new DNS record with multiple IPs

Now multiple.d14a68e4.sonar.test will return all 3 IPs for A record:

Test DNS multiple recordsTest DNS multiple records

And you will also receive an alert:

DNS test alert multipleDNS test alert multiple

Create wildcard AAAA-record for payload

/dns new -p <NAME> -n "*" -t AAAA 2606:2800:220:1:248:1893:25c8:1946

Create new DNS wildcard recordCreate new DNS wildcard record

Now any query for AAAA record on *.d14a68e4.sonar.test will return an IP 2606:2800:220:1:248:1893:25c8:1946:

Test DNS wildcard recordsTest DNS wildcard records

And you will also receive an alert:

DNS test alert wildcardDNS test alert wildcard

Create rebinding record for payload

/dns new -p <NAME> -n <SUBDOMAIN> -l 0 -t A -s rebind 1.1.1.1 127.0.0.1
  • ⚠️ In this case you must set TTL to 0 (-l 0 or --ttl 0) otherwise it won't work.
  • -s is shorthand for --strategy, the default value is all, which means "return all values for this query at once". In this case we use rebind, which means "return the first value (1.1.1.1) if the record hasn't been requested in the last 3 seconds, otherwise return the next value (127.0.0.1)".
  • This can be used to bypass SSRF checks using TOCTOU issues.

Create new DNS rebind recordCreate new DNS rebind record

Here is the result of requesting rebind.d14a68e4.sonar.test with delay < 3 seconds between requests:

Test DNS rebind recordsTest DNS rebind records

And you will also receive an alert:

DNS test alert rebindDNS test alert rebind

List records

List DNS records

Usage:
/dns list [flags]

Flags:
-h, --help help for list
-p, --payload string Payload name

List DNS records for payload

/dns list -p <NAME>
  • Every DNS record has an index, which can be used in /del command to remove the record.

List DNS records for payloadList DNS records for payload

Delete

Delete DNS record identified by INDEX

Usage:
/dns del INDEX [flags]

Flags:
-h, --help help for del
-p, --payload string Payload name

Delete DNS record for payload by index

/del -p <NAME> <INDEX>

Delete DNS record for payload by indexDelete DNS record for payload by index

Clear DNS records for payload

/dns clr -p <NAME>

Delete all DNS records for payloadDelete all DNS records for payload