SMB Enumeration (Port 139, 445)

Quick Intro

  • SMB stand for Server Message Block

  • SMB allows you to share your resources to other computers over the network,

  • There is 3 version of SMB,

    1. SMB1 version susceptible to known attacks (Eternal blue , wanna cry), Disabled by default in newer Windows version

    2. SMB2 reduced "chattiness" of SMB1. Guest access disabled by default

    3. SMB3 guest access disabled, uses encryption. Most secure.

  • TCP port 139 is SMB over NetBios.

  • TCP port 445 is SMB over Ip. This is newer version of SMB

List of SMB versions and corresponding Windows versions:

  1. SMB1 – Windows 2000, XP and Windows 2003.

  2. SMB2 – Windows Vista SP1 and Windows 2008

  3. SMB2.1 – Windows 7 and Windows 2008 R2

  4. SMB3 – Windows 8 and Windows 2012.

Nmap Scanning

List Available Shares

smbclient

smbmap

Nmap

Connecting To Shares

Downloading multi files

Enum4Linux

Null session with rpcclient

Rpcclient is a Linux tool used for executing client-side MS-RPC functions. A null session is a connection with a samba or SMB server that does not require authentication with a password. Null sessions were enabled by default on legacy systems but have been disabled from Windows XP SP2 and Windows Server 2003. Nowadays it is not very common to encounter hosts that have null sessions enabled, but it is worth a try if you do stumble across one. The connection uses port 445.

Some important commands

Enumerating users with IPC$

if IPC$ share is enabled , and have anonymous access we can enumerate users through lookupsid.py

Google to see if version is vulnerable

smbver.sh

good script to use if none of scanner giving version for smb

You can also fire up wireshark and list target shares with smbclient , you can use anonymous listing to explained above and after that find , Session Setup Andx Response and there you will find smb version :)

smbenum.sh

Brute Force SMB

Last updated