Pentest - SMB p 139,445
Port 139 NetBIOS
NetBIOS is Network Basic Input Output System
, which is a software protocol that allows applications, PCs, and Desktops on a local area network (LAN) to communicate with network hardware and to transmit data across the network.
Port 445 SMB - Server Message Block
While Port 139 is known technically as ‘NBT over IP’, Port 445 is ‘SMB over IP’. SMB stands for ‘Server Message Blocks’.
SMB
Server Message Block (SMB) is a client-server protocol that regulates access to files and entire directories and other network resources such as printers, routers, or interfaces released for the network.
Server Enumeration
Search for hosts:
|
|
SMB information
|
|
smbclient //10.10.10.10/Public -U 'anonymous' -N
See also impacket: samrdump, rpcdump
Users, Groups
|
|
Anonymous logon
crackmapexec smb <host> -u 'a' -p '' --shares
List files
crackmapexec smb <host> -u 'a' -p '' -M spider_plus
Download files
crackmapexec smb <host> -u 'a' -p '' -M spider_plus -o DOWNLOAD_FLAG=TRUE EXCLUDE_DIR=IPC$
IPC$ Share
With an anonymous null session you can access the IPC$ share and interact with services exposed via named pipes. The enum4linux utility within Kali Linux is particularly useful; with it, you can obtain the following:
- Operating system information
- Details of the parent domain
- A list of local users and groups
- Details of available SMB shares
- The effective system security policy
RID cycling with crackmapexec
|
|
then, eg, check for UF_DONT_REQUIRE_PREAUTH and AS-REP Roasting. Then attempt crackmapexec
with smb and username password combinations. Passwords from list (eg rockyou), customized list, usernames as passwords (backwards and forwards, case change, etc).
SMB Command Execution
|
|
Dump sam hashes
|
|
wmiexec
|
|