Amass Basics: Map Your Attack Surface Before Attackers Do
Before an attacker touches your website, they map it. They find your subdomains, your staging servers, your forgotten test environments and your cloud buckets — then they pick the weakest one. Amass is the open-source tool that does exactly that mapping for you, on your own domains, so you can find the exposed corners first.
What Amass Is
Amass is an attack surface mapping tool from OWASP, written in Go. You give it a domain, and it discovers subdomains using dozens of techniques at once: DNS brute-forcing, certificate transparency logs, search engines, web archives, API sources like Shodan and VirusTotal, and scraping. Then it resolves every name it finds, checks which ones are alive, and draws a graph of how your infrastructure connects together.
Think of it as the difference between checking your front door and walking around the whole building looking for open windows. Most organizations are surprised by what it finds.
Installing Amass
On Kali Linux it is usually one command:
sudo apt update && sudo apt install amass
On other systems, grab the release for your platform from the OWASP Amass GitHub releases page and put the binary in your PATH. Verify it works:
amass version
Amass works out of the box with its built-in sources, but it gets much better results when you add API keys for services like Shodan, VirusTotal, Censys or GitHub. Those keys go in a config file at ~/.config/amass/config.yaml. You do not need them to start — run it plain first, add keys later when you want deeper coverage.
Your First Scan
The basic enumeration command is:
amass enum -d example.com
Replace example.com with a domain you own or have written permission to test. Amass will run for a few minutes and print every subdomain it discovers, along with the source that found it. For a scan you can come back to later, save the results:
amass enum -d example.com -o results.txt
And to see the results as a graph you can explore visually:
amass enum -d example.com -dir ./amass-output
amass viz -d3 -dir ./amass-output
The viz command builds an interactive HTML graph you can open in your browser. It shows your domain in the center, subdomains branching out, and the IP addresses and services behind them. Forgotten staging servers and old test subdomains show up as nodes you did not expect — those are exactly the ones attackers love.
Reading the Results Like a Defender
A long list of subdomains is not the goal. The goal is finding the ones that should not exist anymore. Work through the output with these questions:
- Staging and dev subdomains:
staging.example.com,dev-api.example.com,test.example.com— are they still needed? Do they run old, unpatched software? - Cloud leftovers: subdomains pointing at S3 buckets, Azure blobs or Heroku apps you no longer control are prime takeover targets. Check every CNAME that points outside your infrastructure.
- Wildcard and forgotten DNS: entries pointing at IP addresses you no longer own mean someone else may be able to claim them.
- Services on odd ports: Amass resolves names to IPs — follow up with a port scan of your own network to see what is actually listening.
For each finding, either remove the DNS record, patch the service, or put it behind authentication. A subdomain you forgot about is an attack surface you are not defending.
Amass in Your Routine
Run Amass against your domains once a month, or after any infrastructure change. Save each run's output and compare it with the last one — new subdomains appearing without a change ticket are worth investigating immediately. Pair it with a certificate transparency monitor and you will catch most new exposures within days of them appearing.
Remember the golden rule: only test systems you own or have written permission to test. Amass is a reconnaissance tool — pointing it at someone else's domain without permission is not research, it is the first step of an attack. Use it on your own infrastructure, and close the gaps before someone else finds them.



Comments
Post a Comment