37. Enumeration: NetBIOS, SMB, SNMP, LDAP, SMTP, NFS and DNS
Chala mitrano, Nmap ne ports ani services dakhavle – pan te fakt surface aahe. Enumeration (गणन / सूचीकरण) madhe aapan service madhun deeper details kadhto: usernames, shares, community strings, zone files, mounts. He CEH module cha mahatvacha bhag aahe – pan nehmi lab only. Pratyek protocol sathi attack idea ani tyacha bachav donhi shiku. Ghabru naka – step by step jaauya!
What you will learn in this chapter
- Recon vs scanning vs enumeration – kay fark aahe
- NetBIOS / SMB enumeration (nmblookup, smbclient, enum4linux, NetExec)
- SNMP enumeration (snmpwalk, snmp-check) ani community string risk
- LDAP basics (ldapsearch) – anonymous bind risk; AD detail pudhchya chapter madhe
- SMTP user enum (VRFY / EXPN / RCPT) with telnet/nc
- NFS enumeration (showmount, mount risks) ani root_squash defence
- DNS enumeration (AXFR, dig/nslookup, dnsenum/fierce concepts)
- Defence checklist – Raja/Rani Pune shop sathi
Lab scope
Run every command only against your host-only lab (Kali 192.168.56.10, Metasploitable 192.168.56.20, Chapter 18) or systems you own / have written permission for. Enumerating strangers' SMB, SNMP, LDAP, SMTP, NFS or DNS is illegal under the IT Act.
Concepts in this chapter
- 37.1What Is Enumeration and Why It Matters
- 37.2NetBIOS and SMB Enumeration
- 37.3SNMP Enumeration
- 37.4LDAP Enumeration
- 37.5SMTP Enumeration
- 37.6NFS Enumeration
- 37.7DNS Enumeration
- 37.8Putting It Together + Defence Checklist
- 37.9Red vs Blue, Project and Real Incidents
The chapter recap is at the end of the last concept page.
Chapter 37: Enumeration (SMB, SNMP, LDAP…) — practice tasks
Open chapter lessons · Full guided lab: turn off smbv1 netbios snmp verify (not repeated here)
37.1 Enumerate SMB on a lab VM
MediumITWhy: Open shares leak files.
What: List shares on Metasploitable or your Windows lab VM.
How:
- smbclient -L //192.168.56.101 -N
- Try smbclient //IP/tmp -N if listed.
Expected output: Share list printed.
Hint
Only your lab IPs.
Answer / how to check
- You noted guest/anonymous access Yes/No.
37.2 SNMP community string check
MediumBankingWhy: Default public leaks host data.
What: Query your lab SNMP if enabled.
How:
- snmpwalk -v2c -c public 127.0.0.1 system
- If it works with public → finding.
Expected output: Either data returned (finding) or timeout (good).
Hint
Change community strings; prefer SNMPv3.
Answer / how to check
- Document result.
37.3 Turn off SMBv1 on Windows lab
EasyRetailWhy: SMBv1 enables wormable bugs.
What: Disable SMBv1 on your Windows lab PC.
How:
- PowerShell Admin: Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
- Or use Optional Features GUI.
- Reboot and verify.
Expected output: SMBv1 feature Disabled.
Hint
See linked SMBv1 lab.
Answer / how to check
- Get-WindowsOptionalFeature shows Disabled.
Extended teaching notes
Why this lesson matters
Enumeration maps what a network exposes. Defenders use the same ideas to close shares, fix SNMP community strings, restrict LDAP binds and stop zone transfers.
Hardening related services
[('SSH', 'Key auth, no root login, Fail2ban or equivalent, SG limited to your IP/VPN.', '', ''), ('SMB / NFS / LDAP / SNMP', 'Do not expose to the internet; patch; strong auth; disable unused versions (e.g. SMBv1).', '', ''), ('SMTP', 'Authenticated relay only; SPF/DKIM/DMARC for your domains.', '', ''), ('DNS', 'Restrict zone transfers; monitor for unexpected records (crt.sh for certs).', '', ''), ('Firewalls', 'Host firewall + cloud SG/NSG; default deny; document every allow.', '', '')]
Lab rule
Run enumeration only against host-only lab VMs you own. Then write the defensive fix for each open service you found.
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.