Labs · Cyber Security
Lab: Reduce What Your Lab Machines Share: Turn Off SMBv1, NetBIOS and Default SNMP, Then Verify from Inside and from the Lab Network
Course: Cyber Security · Chapter 37: Enumeration: NetBIOS, SMB, SNMP, LDAP, SMTP, NFS and DNS
Chapter 37 explains enumeration of NetBIOS, SMB, SNMP and more; this lab removes what those techniques would find on your own machines.
Chala mitrano! Enumeration works because computers are chatty: old file-sharing (SMBv1), name broadcasts (NetBIOS), and device-management services (SNMP) with the default password "public". Today we make our own machines quiet: switch off what we don't use and prove it from both sides. Kami bolka computer, surakshit computer!
चला मित्रांनो! Enumeration चालतं कारण computers खूप बोलके असतात: जुनं file-sharing (SMBv1), नावांचे broadcasts (NetBIOS), आणि default password "public" असलेल्या device-management services (SNMP). आज आपण आपल्या machines शांत करणार: न वापरलेलं बंद करणार आणि दोन्ही बाजूंनी सिद्ध करणार. कमी बोलका computer, सुरक्षित computer!
चलो दोस्तों! Enumeration इसलिए चलता है क्योंकि computers बहुत बातूनी होते हैं: पुराना file-sharing (SMBv1), नामों के broadcasts (NetBIOS), और default password "public" वाली device-management services (SNMP)। आज हम अपनी machines को शांत करेंगे: जो इस्तेमाल नहीं होता उसे बंद करेंगे और दोनों तरफ से साबित करेंगे। कम बातूनी computer, सुरक्षित computer!
Suppose we are…
Suppose we are on the desktop security team at Larsen & Toubro (L&T). After WannaCry spread through SMBv1, the company rule is: no SMBv1 anywhere, NetBIOS off where not needed, no SNMP with default community strings, and no open shares except what is approved. We apply the same rule to our own laptop and lab VM, then verify.
Goal of this lab
By the end you will have:
- SMBv1 confirmed off on Windows, and a list of your shares.
- NetBIOS over TCP/IP disabled on your lab (host-only) adapter.
- SNMP confirmed absent or removed on Windows and Ubuntu, verified with nmap from Kali.
What you need (all free)
- Your own Windows 10/11 laptop with admin rights.
- Your isolated lab from Lab 18 with Kali and your Ubuntu VM. About 40 minutes.
Safety and ethics
Scan only your own laptop's lab address (192.168.56.1) and your own lab VMs, as in your scope file. Change network settings only on your own devices; at work, follow your IT team's process.
Part 1: Windows (PowerShell as Administrator)
- Right-click Start → Terminal (Admin) or Windows PowerShell (Admin).
-
Check SMBv1:
Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol | Select-Object FeatureName, State Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol, EnableSMB2ProtocolWhat you should see:
State : DisabledandEnableSMB1Protocol : False,EnableSMB2Protocol : True. If SMB1 is enabled, runDisable-WindowsOptionalFeature -Online -FeatureName SMB1Protocoland restart. -
List your shares:
Get-SmbShareWhat you should see: only the built-in admin shares
ADMIN$,C$andIPC$. Any other share (for example an oldMoviesfolder) should be removed if not needed:Remove-SmbShare -Name Movies. -
Disable NetBIOS on the lab adapter: Control Panel → Network and Sharing Center → Change adapter settings → right-click VirtualBox Host-Only Network → Properties → Internet Protocol Version 4 → Properties → Advanced → WINS tab → Disable NetBIOS over TCP/IP → OK. (Repeat for Wi-Fi if you never use old Windows file sharing at home.)
-
Verify:
ipconfig /all | Select-String "NetBIOS over Tcpip" Get-Service SNMP -ErrorAction SilentlyContinueWhat you should see:
NetBIOS over Tcpip. . . . . . . . : Disabledfor the lab adapter, and no output for SNMP (the service is not installed, which is what we want).
Part 2: Ubuntu VM
-
Check for SNMP and Samba services:
sudo ss -tulpn | grep -E ":161|:139|:445" || echo "nothing listening"What you should see:
nothing listening. Ifsnmpdis listed, remove it withsudo apt purge -y snmpdunless you really need it (and then never with communitypublic).
Part 3: verify from the lab network (Kali)
-
From Kali, check your laptop's lab address for SMB dialects and NetBIOS:
sudo nmap -p 445 --script smb-protocols 192.168.56.1 sudo nmap -sU -p 137,161 192.168.56.1 192.168.56.10xWhat you should see: for 445 either
filtered(Windows Firewall already hides it, good) or a dialect list withoutNT LM 0.12 (SMBv1). UDP 137 and 161 showclosedoropen|filteredwith no NetBIOS names or SNMP answers. -
Write a short "before/after" note: setting, before, after, how verified.
Ravindra Bagale's Tip
SMBv2/v3 is fine and needed for normal Windows file sharing. The danger is SMBv1, which is about 30 years old. Don't disable everything blindly: switch off the old and unused, keep the modern and needed, and write down why. Juna band, navin chalu!
Ravindra Bagale's Tip – मराठी
SMBv2/v3 ठीक आहे आणि साध्या Windows file sharing साठी गरजेचं आहे. धोका SMBv1 चा, जो सुमारे 30 वर्षं जुना आहे. आंधळेपणाने सगळं बंद करू नका: जुनं आणि न वापरलेलं बंद करा, आधुनिक आणि गरजेचं ठेवा, आणि का ते लिहून ठेवा. जुनं बंद, नवीन चालू!
Ravindra Bagale's Tip – हिंदी
SMBv2/v3 ठीक है और सामान्य Windows file sharing के लिए ज़रूरी है। ख़तरा SMBv1 का है, जो करीब 30 साल पुराना है। आँख मूँदकर सब बंद मत करो: पुराना और बिना इस्तेमाल वाला बंद करो, आधुनिक और ज़रूरी रखो, और क्यों, ये लिखकर रखो। पुराना बंद, नया चालू!
Common mistakes
| Mistake | What happens | Fix |
|---|---|---|
| Disabling SMBv2/v3 as well | Normal file sharing and some apps break | Disable only SMBv1 |
| Running PowerShell without admin | Get-SmbServerConfiguration or Disable fails |
Open Terminal (Admin) |
| Disabling NetBIOS on an office network adapter | Old printers or shares may stop working | Change your own lab/home adapters; ask IT at work |
Keeping SNMP with community public |
Anyone can read device details | Remove SNMP or use SNMPv3 with a strong secret |
| Scanning the office or college network to "verify" | Unauthorised scanning | Scan only your own lab IPs |
Self-check checklist
0 of 5 done
Try-at-home challenge
Check your home router's admin page (Lab 25) for SNMP and UPnP settings. What would you set, and why?
Check your answer
Set SNMP: Off (home users do not need remote device management, and many routers ship with community public). Set UPnP: Off unless a game console or app truly needs it, because UPnP lets devices open ports on your router automatically. Note both in your router card.
Samjla ka? Old protocols off, shares reviewed, verified from inside and outside. Aata pudhe jaauya: Chapter 38 looks at accounts and logons on Windows.