139, 445 - SMB

Enumeration

  • Identifique o SMB em execução em um host. Liste apenas as portas abertas.

sudo nmap -sT -sU -sV -p135,137,138,139,445 --open <IP>

Nmap Scripts

# Enumerate shares
nmap --script smb-enum-shares -p 445 <IP>
# OS Discovery
nmap --script smb-os-discovery -p 445 <IP>
# Enumerate Users
nmap --script=smb-enum-users -p 445 <IP>
# All
nmap --script=smb-enum-users,smb-enum-shares,smb-os-discovery -p 139,445 <IP>

NULL / Anonymous Login

# On some configuration omitting '-N' will grant access.
smbclient -U '' -L \\\\<IP> 

smbclient -U '' -N -L \\\\<IP> 
smbclient -U '%' -N -L \\\\<IP>
smbclient -U '%' -N \\\\<IP>\\<Folder>

# Enter a random username with no password and try for anonymous login.
crackmapexec smb <IP> -u 'anonymous' -p ''

crackmapexec smb <IP> -u '' -p ''
crackmapexec smb <IP> -u '' -p '' --shares

Authenticated

Download Files

Tools

Enum4Linux

NetExec

PsMapExec

  • Execução e enumeração de comandos no Windows

User Enumeration

Nmap

Exploits

Atualizado