SMB (139-445)
Server Message Block.
Port
445 TCP
Newer versions of SMB (after Windows 2000)
139 TCP
NBSession
Config File
/etc/samba/smb.conf
Interact
If anonymous access is enabled, it's possible log in with username “” and password “”.
Or try with guest and "".
net use n: \\<IP>\<SHARE>
net use n: \\<IP>\<SHARE> /user:<USER> <PASSWORD>sudo apt install cifs-utilssudo mkdir <MyDir>
sudo mount -t cifs -o username=<USERNAME>,password=<PASSWORD>[,domain=.] //<IP>/<SHARE> <MyDir>For enumeration
smbmap [-u <USER> -p <PASS> -d <DOMAIN>] -H <IP>
For enumeration
enum4linux [-u <USER> -p <PASS> -w <DOMAIN>] -A <IP>
smbclient
Accessing and interacting
smbclient [-N or -U <USER>] -L <IP>
smbclient [-N or -U <USER>] //<IP>/<SHARE>
impacket-smbclient -k <DOMAIN>/<USER>:<PASS>@<IP/HOSTNAME> (kerberos auth)
Searching in shares
nxc smb <IP> -u <USER> -p <PASS> --shares
nxc smb <IP> -u <USER> -p <PASS> --spider '<SHARE>' --regex '<REGEX>'
nxc smb <IP> -u <USER> -p <PASS> -M spider_plus (try again if there are errors)
Attacks
CVE-2017-0144
EternalBlue exploits a flaw in the SMBv1 protocol. By exploiting this flaw, an attacker can send malicious data to the victim system via an SMBv1 connection, causing a condition that allows them to take control of the target system, executing malicious code without any need for authentication and with system privileges.
Last updated
Was this helpful?