36.2 Amass: Subdomain Discovery
Company cha ek domain asel (example.com), pan tyache subdomains (mail., dev., staging.) attackers la naye entry points detat. Amass (OWASP) subdomain discovery sathi standard tool aahe.
Passive vs active:
| Mode | Kay karto | Detection |
|---|---|---|
| Passive | Public sources (Certificate Transparency, DNS databases) – target la direct traffic nahi | Khup kami |
| Active | DNS queries, brute force wordlist – target DNS var load | Log madhe disto |
sudo apt install -y amass
# Passive only – preferred first step
amass enum -passive -d lab.local -o amass-passive.txt
# Active (lab domain you own / private lab ONLY)
amass enum -active -d lab.local -brute -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -o amass-active.txt
Placeholder: lab.local kiwa tumcha swatahcha domain. Strangers chya domains var brute force – gunha. Chapter 19 madhe whois/dig/theHarvester shiklo; Amass tyala motha picture deto.
Defence: Certificate Transparency logs monitor kara (crt.sh, your CA alerts), unused subdomains decommission kara, wildcard DNS careful theva, ani external attack-surface inventory (kay public aahe) nehmi update theva. Ghabru naka – he defender cha rozcha kaam aahe.
Ravindra Bagale's Tip
Students run Amass active brute force directly against a public domain "for practice" – that is illegal. Passive first; active only with written permission or in your own lab. Say the same in interviews: "I start passive, then active only in scope."
Ravindra Bagale's Tip – मराठी
Students Amass active brute force थेट public domain वर चालवतात "practice" म्हणून – हे illegal आहे. Passive आधी, active फक्त written permission किंवा स्वतःच्या lab मध्ये. Interview मध्ये पण हेच सांगा: "I start passive, then active only in scope."
Ravindra Bagale's Tip – हिंदी
Students Amass active brute force सीधे public domain पर चलाते हैं "practice" के नाम पर – यह illegal है. Passive पहले, active सिर्फ़ written permission या अपनी lab में. Interview में भी यही बताओ: "I start passive, then active only in scope."
Lab
Aaplya private lab domain (lab.local kiwa host-only DNS) var amass enum -passive -d lab.local chalaa. Output file save kara. Active brute fakt lab domain var try kara – bahercha konatahi domain nako. Note: kitne subdomains passive madhun mile, kitne active madhun.
Extended teaching notes
Why this lesson matters
Kali tools are dual-use. In this course every run ends with a defensive note: what config would have blocked or detected the activity on a system you own.
Rule
Host-only lab, written scope, no bridging onto real LANs.
Mini case study
Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.
Defender's worksheet (do this today)
- Write the lesson title, date and the exact lab target you are allowed to use.
- List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
- Run one safe check from the lesson on a lab system only. Paste the command and output.
- Write a two-sentence fix you would give a teammate.
- Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.
Indian workplace (sample data)
Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).
Global practice
Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.
Everyday analogy
Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.
Key terms
- Control: a safeguard (patch, config, process, detection).
- Finding: a weakness backed by evidence.
- Remediation: the fix plus how you verified it.
- Scope: systems you have written permission to touch.
- Least privilege: only the access the task needs.
- Defence in depth: several layers so one failure does not end the story.
Common mistakes
- Skipping written permission "just for a quick scan".
- Practising on hostel, office or public targets without authorisation.
- Collecting tool output without writing the fix.
- Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
- Publishing screenshots that contain secrets, cookies or internal hostnames.
Recap
- Evidence, fix, owner, date.
- Own lab only.
- Fix > spectacle.