Server Message Block

Footprinting The Service

Nmap

sudo nmap 10.129.14.128 -sV -sC -p139,445

RPCclient

-U'%': Explicitly sends an empty username and no password. -N: Does not send any username or password, attempting to establish a null session.
Query
Description

srvinfo

Server information.

enumdomains

Enumerate all domains that are deployed in the network.

querydominfo

Provides domain, server, and user information of deployed domains.

netshareenumall

Enumerates all available shares.

netsharegetinfo <share>

Provides information about a specific share.

enumdomusers

Enumerates all domain users.

queryuser <RID>

Provides information about a specific user.

Search For Known SMB Version Vulnerabilities

Check For Shares Using Null Sessions

Brute Forcing

If the target

URL File attacks

Test for URL File attacks by creating a file called "@somename.url" with the following contents, upload, spin up smbserver to capture hash

Run Responder to capture hashes

Read / Upload access

Attempt to download and view share contents using valid credential / anonymous login / null session

Using smbmap with the -r or -R (recursive) option, one can browse the directories
Downloading
Uploading

Cpassword discovery

Search "Groups.xml" for cpassword decryption

lsass.zip lsass.dmp

search lsass.zip or lsass.dmp to use to dump credentials / keys / tickets

Alternate Data Streams (ADS)

test for alternate data streams after discovering 0 byte files

Check Password Policy

User Discovery

Check For users using valid credential / anonymous login / null session

Group discovery

check for groups using valid credential / anonymous login / null session

Smbclient

Interactively access the smb shares using smbclient

Smbmap

Dangerous Settings

Setting
Description

browseable = yes

Allow listing available shares in the current share?

read only = no

Forbid the creation and modification of files?

writable = yes

Allow users to create and modify files?

guest ok = yes

Allow connecting to the service without using a password?

enable privileges = yes

Honor privileges assigned to specific SID?

create mask = 0777

What permissions must be assigned to the newly created files?

directory mask = 0777

What permissions must be assigned to the newly created directories?

logon script = script.sh

What script needs to be executed on the user's login?

magic script = script.sh

Which script should be executed when the script gets closed?

magic output = script.out

Where the output of the magic script needs to be stored?

Last updated