445 - SMB

Theory

The SMB protocol operates on TCP port 445, and once enabled, you will see the NetBIOS TCP port 139 is opened as well. The enumeration process of an SMB protocol should be targeting the following items:

  • Share names

  • List of users

  • List of groups

  • Domain name

  • Accounts bruteโ€force

  • List of SMB vulnerable versions


Practical

Nmap Scan

nmap โ€sV โ€T5 โ€p 445 โ€sC <IP>

Nmap Script Scan

nmap โ€sV โ€p 445 โ€โ€script=smbโ€vuln* <IP>

nmap -sV -p 445 --script=smb-enum <IP>

Enum4Linux Tool

enum4linux -a [IP address]

Brute Force

Metasploit

msfconsole -q

use auxiliary/scanner/smb/smb_login

set BLANK_PASSWORDS true

set PASS_FILE /usr/share/wordlists/rockyou.txt

set RHOSTS <Target IP>

set SMBUser admin

set STOP_ON_SUCCESS true

set THREADS 100

set USER_AS_PASS true

set VERBOSE false

run


REFERENCES

Last updated