Puredns Agent Setup for Subdomain Enum

Puredns Command

Using {{rootDomain}} ReconNess replace {{rootDomain}} to the root domain, for example, if we define that as a root domain adding the Target
If we have massdns in the folder /app/massdns/bin/massdns
puredns bruteforce subdomains.txt {{rootDomain}} --resolvers resolvers.txt --bin /app/massdns/bin/massdns -q

Puredns Script

using ReconNess.Core.Models;
var match = System.Text.RegularExpressions.Regex.Match(lineInput, @"([^\.\/]+)(\.[^\.\/]+)+(?:\/|$)");
if (match.Success)
return new ScriptOutput { Subdomain = match.Groups[0].Value };
return new ScriptOutput();
Check the Readme on GitHub to know more about the Script.

Puredns Dockerfile Entry

# -------- Agents dependencies --------
# To allow run Puredns inside the docker
RUN apt-get update && apt-get install -y git build-essential wget
RUN wget
RUN tar -C /usr/local -xzf go1.14.6.linux-amd64.tar.gz
RUN git clone && cd massdns && make
RUN GO111MODULE=on /usr/local/go/bin/go get
# -------- End Agents dependencies --------

Puredns Command for Docker

/root/go/bin/puredns bruteforce /app/Content/wordlists/subdomain_enum/default.txt {{rootDomain}} --resolvers /app/Content/wordlists/dns_resolver_enum/default.txt --bin /app/massdns/bin/massdns -q