269 words
1 minutes
Server Message Block (SMB)

Server Message Block (SMB)#

🔹 Overview#

  • SMB (Server Message Block) is a client-server protocol for accessing:
    • Files and directories
    • Printers and other shared network resources
  • Enables inter-process communication over a network.
  • Initially popularized via OS/2 LAN Manager and later widely used in Microsoft Windows.
  • Backward compatibility in Windows allows newer systems to communicate with older ones.

🔹 Key Features#

Enables file/service access over the network between SMB-enabled systems.

Uses TCP/IP for transport (typically over port 445).

Access is managed using Access Control Lists (ACLs) with permissions like:

read, write, execute, full control

🐧 Samba (SMB on Unix/Linux)#

Samba is an open-source SMB server for Linux/Unix.

Implements CIFS (Common Internet File System), a dialect of SMB.

Enables cross-platform communication with Windows systems.

Provides:

SMB file/print sharing

Active Directory integration

🔹 Samba Daemons#

DaemonRole
smbdHandles SMB protocol and file sharing
nmbdHandles NetBIOS name resolution
winbinddManages user/group info from AD
sambaManages AD DC (in Samba 4)

📶 SMB Versions#

SMB VersionOS SupportKey Features
CIFSWindows NT 4.0Uses NetBIOS
SMB 1.0Windows 2000TCP-based
SMB 2.0Vista / Server 2008Performance, caching
SMB 2.1Win 7 / Server 2008 R2Locking
SMB 3.0Win 8 / Server 2012Multichannel, encryption
SMB 3.1.1Win 10 / Server 2016AES-128, integrity check

🔐 Important Configuration Options#

OptionDescription
workgroupName of SMB workgroup/domain
pathDirectory to share
browseableWhether share is visible in network
guest okAllow unauthenticated access
read onlyPrevent modification of files
create maskFile permission mask
directory maskDirectory permission mask
map to guestMaps unknown users to guest account

⚠️ Dangerous Settings to Monitor#

SettingRisk
browseable = yesAttackers can enumerate visible shares
read only = no or writable = yesAllows file creation/modification
guest ok = yesAllows anonymous access
create mask = 0777 / directory mask = 0777Full permission to all users
enable privileges = yesMay allow elevated privileges
magic script / logon scriptRisk of executing unauthorized scripts

🌐 NetBIOS and WINS#

  • NetBIOS: API for communication over LAN.
  • Name Registration: Each host registers a unique name.
  • NBNS / WINS: Servers that resolve NetBIOS names to IPs.