hi@hectortoral.com

3 min read

WHOIS

CommandDescription
export TARGET="domain.tld"Assign target to an environment variable.
whois $TARGETWHOIS lookup for the target.

DNS Enumeration

CommandDescription
nslookup $TARGETIdentify the A record for the target domain.
nslookup -query=A $TARGETIdentify the A record for the target domain.
dig $TARGET @<nameserver/IP>Identify the A record for the target domain.
dig a $TARGET @<nameserver/IP>Identify the A record for the target domain.
nslookup -query=PTR <IP>Identify the PTR record for the target IP address.
dig -x <IP> @<nameserver/IP>Identify the PTR record for the target IP address.
nslookup -query=ANY $TARGETIdentify ANY records for the target domain.
dig any $TARGET @<nameserver/IP>Identify ANY records for the target domain.
nslookup -query=TXT $TARGETIdentify the TXT records for the target domain.
dig txt $TARGET @<nameserver/IP>Identify the TXT records for the target domain.
nslookup -query=MX $TARGETIdentify the MX records for the target domain.
dig mx $TARGET @<nameserver/IP>Identify the MX records for the target domain.

Passive Subdomain Enumeration

Resource/CommandDescription
VirusTotalhttps://www.virustotal.com/gui/home/url
Censyshttps://censys.io/
Crt.shhttps://crt.sh/
curl -s https://sonar.omnisint.io/subdomains/{domain} | jq -r '.[]' | sort -uAll subdomains for a given domain.
curl -s https://sonar.omnisint.io/tlds/{domain} | jq -r '.[]' | sort -uAll TLDs found for a given domain.
curl -s https://sonar.omnisint.io/all/{domain} | jq -r '.[]' | sort -uAll results across all TLDs for a given domain.
curl -s https://sonar.omnisint.io/reverse/{ip} | jq -r '.[]' | sort -uReverse DNS lookup on IP address.
curl -s https://sonar.omnisint.io/reverse/{ip}/{mask} | jq -r '.[]' | sort -uReverse DNS lookup of a CIDR range.
curl -s "https://crt.sh/?q=${TARGET}&output=json" | jq -r '.[] | "\(.name_value)\n\(.common_name)"' | sort -uCertificate Transparency.
cat sources.txt | while read source; do theHarvester -d "${TARGET}" -b $source -f "${source}-${TARGET}";doneSearching for subdomains and other information on the sources provided in the source.txt list.

Sources.txt

Code: txt

baidu
bufferoverun
crtsh
hackertarget
otx
projecdiscovery
rapiddns
sublist3r
threatcrowd
trello
urlscan
vhost
virustotal
zoomeye

Passive Infrastructure Identification

Resource/CommandDescription
Netcrafthttps://www.netcraft.com/
WayBackMachinehttp://web.archive.org/
WayBackURLshttps://github.com/tomnomnom/waybackurls
waybackurls -dates https://$TARGET > waybackurls.txtCrawling URLs from a domain with the date it was obtained.

Active Infrastructure Identification

Resource/CommandDescription
curl -I "http://${TARGET}"Display HTTP headers of the target webserver.
whatweb -a https://www.facebook.com -vTechnology identification.
Wappalyzerhttps://www.wappalyzer.com/
wafw00f -v https://$TARGETWAF Fingerprinting.
Aquatonehttps://github.com/michenriksen/aquatone
cat subdomain.list | aquatone -out ./aquatone -screenshot-timeout 1000Makes screenshots of all subdomains in the subdomain.list.

Active Subdomain Enumeration

Resource/CommandDescription
HackerTargethttps://hackertarget.com/zone-transfer/
SecListshttps://github.com/danielmiessler/SecLists
nslookup -type=any -query=AXFR $TARGET nameserver.target.domainZone Transfer using Nslookup against the target domain and its nameserver.
gobuster dns -q -r "${NS}" -d "${TARGET}" -w "${WORDLIST}" -p ./patterns.txt -o "gobuster_${TARGET}.txt"Bruteforcing subdomains.

Virtual Hosts

Resource/CommandDescription
curl -s http://192.168.10.10 -H "Host: randomtarget.com"Changing the HOST HTTP header to request a specific domain.
cat ./vhosts.list | while read vhost;do echo "\n********\nFUZZING: ${vhost}\n********";curl -s -I http://<IP address> -H "HOST: ${vhost}.target.domain" | grep "Content-Length: ";doneBruteforcing for possible virtual hosts on the target domain.
ffuf -w ./vhosts -u http://<IP address> -H "HOST: FUZZ.target.domain" -fs 612Bruteforcing for possible virtual hosts on the target domain using ffuf.

Crawling

Resource/CommandDescription
ZAPhttps://www.zaproxy.org/
ffuf -recursion -recursion-depth 1 -u http://192.168.10.10/FUZZ -w /opt/useful/SecLists/Discovery/Web-Content/raft-small-directories-lowercase.txtDiscovering files and folders that cannot be spotted by browsing the website.
ffuf -w ./folders.txt:FOLDERS,./wordlist.txt:WORDLIST,./extensions.txt:EXTENSIONS -u http://www.target.domain/FOLDERS/WORDLISTEXTENSIONSMutated bruteforcing against the target web server.