SMB hands out a user list. FTP lets anyone in. SNMP lists every running process. And NFS shares the whole disk with everyone. In this episode you enumerate four classic services the way an auditor does: smbclient, smbmap, enum4linux-ng and netexec for SMB, anonymous FTP, snmpwalk with community strings, and showmount for NFS. Then you look at the same traffic from the defender's side with Zeek and auditd, harden every service, and prove the fix by running the exact same commands again.
⚠️ For education only. Every demo runs in an isolated lab (Metasploitable 10.10.10.20, Ubuntu server 10.10.10.60). Only test systems you own or have written permission to test. The NFS demo mounts read-only and only lists the directory: in a real audit you stop there, unmount, and report it.
In this episode:
✔ Enumeration vs exploitation: what's in scope
✔ MITRE ATT&CK T1135 Network Share Discovery, T1087 Account Discovery, T1602.001 SNMP (MIB Dump), T1039 Data from Network Shared Drive
✔ SMB shares and permissions: smbclient and smbmap
✔ SMB users, password policy, signing and SMBv1: enum4linux-ng and netexec
✔ FTP: anonymous login and plaintext credentials
✔ SNMP: snmpwalk, the "public" community string and process lists
✔ NFS: showmount and the "/ to everyone" export
✔ Detect: Zeek snmp, smb_mapping and ftp logs, auditd watches on config files
✔ Fix SMB: SMB2+ only, mandatory signing, no null sessions, no guest
✔ Fix SNMP with v3 authPriv, NFS with root_squash and a subnet, FTP off or SFTP
✔ Re-test with the same commands
⏱ Chapters
0:00 What your services give away
0:21 Welcome
0:30 Legal: enumeration is in scope
0:44 Enumeration vs exploitation & ATT&CK
1:07 SMB shares: smbclient & smbmap
1:27 SMB users, policy & signing: enum4linux-ng, netexec
1:52 FTP: anonymous login & plaintext
2:16 SNMP: snmpwalk & community strings
2:41 NFS: showmount & the '/' export
3:09 Detect: Zeek logs & auditd
3:36 Fix SMB: signing, no SMBv1, no null sessions
3:59 Fix SNMP (v3), NFS & FTP
4:24 Re-test with the same commands
4:47 Common mistakes
5:05 Cheat sheet
5:30 Like & subscribe
5:41 Homework & up next
💻 Commands from this video
Kali (10.10.10.5), audit:
smbclient -L //10.10.10.20 -N
smbmap -H 10.10.10.20
enum4linux-ng -A 10.10.10.20 -oY ms2-smb
netexec smb 10.10.10.20
ftp -n 10.10.10.20 (then: user anonymous anonymous)
snmpwalk -v2c -c public 10.10.10.60 system
snmpwalk -v2c -c public 10.10.10.60 HOST-RESOURCES-MIB::hrSWRunName
showmount -e 10.10.10.20
sudo mount -t nfs -o ro,nolock 10.10.10.20:/ /mnt/ms2 && ls /mnt/ms2
sudo umount /mnt/ms2
Defender (server):
sudo auditctl -w /etc/exports -p wa -k nfs_exports
sudo auditctl -w /etc/samba/smb.conf -p wa -k smb_conf
sudo ausearch -k nfs_exports -i | tail -1
Zeek: snmp.log, smb_mapping.log, ftp.log
Fix SMB (/etc/samba/smb.conf):
[global]
server min protocol = SMB2_10
server signing = mandatory
restrict anonymous = 2
map to guest = never
[share]
valid users = @finance
read only = yes
testparm -s && sudo systemctl restart smbd
Fix SNMP (v3 only):
sudo systemctl stop snmpd
sudo net-snmp-create-v3-user -ro -a SHA -x AES monitor
snmpd.conf: remove "rocommunity public", set agentaddress 10.10.10.60
Fix NFS (/etc/exports):
/srv/share 10.10.10.0/24(ro,root_squash,sync,no_subtree_check)
sudo exportfs -ra
Fix FTP: anonymous_enable=NO in vsftpd.conf, ssl_enable=YES for FTPS, or remove vsftpd and use SFTP
Re-test:
netexec smb 10.10.10.60
smbclient -L //10.10.10.60 -N
snmpwalk -v2c -c public 10.10.10.60 system
snmpwalk -v3 -l authPriv -u monitor -a SHA -A 'AUTH_PASS' -x AES -X 'PRIV_PASS' 10.10.10.60 sysName
showmount -e 10.10.10.60
🛡 Defender's checklist
• No null sessions and no guest access on SMB
• SMB signing mandatory, SMBv1 off
• SNMPv3 with authPriv only; remove "public" and "private"
• NFS: export only what's needed, to a subnet, with root_squash
• FTP: no anonymous login; prefer SFTP
• Watch config files (exports, smb.conf) with auditd
• Re-test with the same commands after every fix
📺 Full course playlist:
⏮ Previous episode – #5 Vulnerability Assessment: [EP5 LINK]
⏭ Next episode – #7 Crypto & Config Audits: TLS, SSH, headers: [EP7 LINK]
📝 Homework: enumerate your lab's SMB, SNMP and NFS. Harden one service, then prove it with the same commands.
👍 If this helped, like & subscribe, it keeps the course free.
© netacademy.ge
#KaliLinux #CyberSecurity #SMB #SNMP #EthicalHacking