Table of Contents
Summery
netexec in the successor of crackmapexec. You can check logins with credentials, hashes, enumerate shares, bruteforce and much more.
Tips
- SMB signing cryptographically verifies SMB messages to prevent tampering. If disabled, a pentester may be able to perform SMB relay / NTLM relay attacks, intercepting and relaying authentication to another system. When enumerating smb
netexecshow if SMB signing is enabled or not! netexecworks well withproxychains.
Commands
Password spraying
netexec smb <IP> -u 'username' -p 'password' - Check if you can authenticate as a given user
netexec smb ips.txt -u user.txt -p pass.txt - You can also use files to bruteforce given or all parameters of the above command
User enumeration
netexec smb <IP> -u 'guest' -p 'password' --rid-brute - Perform a rid-brute attack to enumerate domain users
netexec ldap BABYDC.baby.vl -u '' -p '' --query "(objectClass=*)" "" | grep "Response for object:" - Shortly enumerate all objects in a domain. This is the best, and the widest user enumeration I think possible
netexec ldap BABYDC.baby.vl -u '' -p '' --query "(objectClass=*)" "" - Enumerate all objects in the domain with all of their details
Shares
netexec smb <IP> --shares - Enumerate SMB shares and your rights to them
netexec nfs <IP> --enum-shares - Enumerate NFS shares and your rights to them
netexec smb <TARGET> -u <USER> -p '<PASSWORD>' -M spider_plus - Recursively enumerate files and folders in SMB shares that your supplied account can read
cat spider_plus.json | jq 'with_entries({key, value: (.value | keys)})' - Read the list of the files
netexec smb <TARGET> -u <USER> -p '<PASSWORD>' -M spider_plus -o DOWNLOAD_FLAG=True - Recursively enumerate and download all accessible files
Passwords
netexec smb <IP> -u Caroline.Robinson -p 'BabyStart123!' -M change-password -o NEWPASS=zaq1@WSX - Change user’s password
netexec smb <IP> -u 'username' -p 'password' --pass-pol - Get domain’s password policy
Bloodhound
netexec ldap DC.sendai.vl -u 'Thomas.Powell' -p '0xdf0xdf' --bloodhound --dns-server 10.129.234.66 -c All - Enumerate bloodhound
Flags
- You can add
--local-authto check for local accounts. Useful if you want to check for local administrators or MSSQL accounts which won’t show up with the default domain based check. Doesn’t work with SSH tho. - You can add
--pass-polto get the password policy of a domain. - You can add
--no-bruteforceto use one username with one password, line by line.
Statuses
(name:XYZ) - Computer name of the target host
(domain:XYZ) - Domain name of the target host
(signing:True/False) - Declares if SMB/LDAP signing is enabled or not. If it isn’t the host can be susceptible to Relay attacks
(SMBv1:None) - Checks if SMBv1 is present. If it is, it’s very possible to be highly vulnerable to a number of public exploits
(Null Auth:True/False) - Checks if a null sessions is possible
(nla:True/False) - Check’s if Network Level Authentication is enabled. If it’s disabled - in theory - you should be able to RDP without authentication. There still can be a Windows auth behind RDP
(channel binding:No TLS cert) - If enabled, it ties authentication to a specific TLS connection, helping prevent authentication Relay attacks
Errors
This error means that anonymous authentication doesn’t work
# search result
search: 2
result: 1 Operations error
text: 000004DC: LdapErr: DSID-0C090D10, comment: In order to perform this opera
tion a successful bind must be completed on the connection., data 0, v4f7c