
NetExec
NetExec (nxc) is a network service exploitation tool that helps automate assessing the security of large networks. Check out its amazing and ever-evolving wiki page! You can view its usage in almost any of the AD-related boxes.
SMB
Enumeration
Enumerate domain/local users:
# List domain users
nxc smb <TARGET-IP> -u '<USER>' -p '<PASS>' --users
# List local users
nxc smb <TARGET-IP> -u '<USER>' -p '<PASS>' --users --local-auth
# Create a users list from nxc's output
$ nxc smb <target> -u <user> -p <pass> --users | awk '$1 == "SMB" && $5 != "[+]" && $5 != "-Username-" && $5 != "[*]" && $5 != "Guest" && $5 != "krbtgt" {print $5}' > domain_usersDomain users can be also be enumerated via a RID-bruteforcing attack:
# Brute-force RIDs (default up to 4000)
nxc smb <TARGET-IP> -u '<USER>' -p '<PASS>' --rid-brute <max-rid>
# Create a users list from nxc's output
nxc smb <TARGET-IP> -u '<USER>' -p '<PASS>' --rid-brute <max-rid> > nxc_users
cat nxc_users | awk '{print $6}' | awk -F'\' '{print $2}' > domain_usersEnumerate domain/local hosts:
# List domain hosts
nxc smb <TARGET-IP> -u '<USER>' -p '<PASS>' --computers
# List local hosts
nxc smb <TARGET-IP> -u '<USER>' -p '<PASS>' --computers --local-authPassword Spray
If the results include the domain , e.g. (seruca.yzx) → a domain account.
If it has (Pw3d!) at the end → Local Administrator account.
RCE
NetExec uses impacket-psexec to perform the Pass-the-Hash attack:
Spidering
List and dump all files all readable shares:
Upload/Download
If large files are failing/erroring, add --smb-timeout with a value than 2.
Modules
The hash format that starts with $DCC2$ (derived from --lsa) is stronger than NTLM and cannot be used for a PtH attack. For attempting to crack them, the domain and username needs to be removed; only the value starting with $DCC2$ is required.
Enumerate network interfaces:
Locate the configuration file:
Check for credentials:
Check /tmp/export.xml after.
Retrieve the plaintext password for accounts pushed through GPPs:
Search for registry.xml files for autologin information:
Enable RDP:
Python-based, uses impacket to read the LSASS dump and pypykatz to extract credentials:
Uses the Sysinternals procdump to create the LSASS dump and pypykatz to extract credentials:
Uses clone handles to create an obfuscated dump:
Opening a handle to LSASS can be detected, so it searches for existing handles, and if one is found, it copies it and creates a LSASS minidump:
Vulnerabilities
The most critical vulnerabilities: from no creds/low privileges straight to DA !
Check for all at once:
ZeroLogon (CVE-2020-1472) is a vulnerability in Microsoft’s Netlogon protocol that lets an attacker with network access spoof a DC, reset its password to blank, and gain full domain admin rights—without any credentials.
There is a PoC available:
noPAC is a vulnerability that lets an attacker with low-privileged domain access abuse misconfigured delegation and Kerberos to impersonate DCs and gain Domain Admin rights by forging a Privileged Attribute Certificate (PAC).
There is a PoC available:
PrintNightmare is a critical Windows Print Spooler vulnerability that allows an attacker with network or local access to execute code as SYSTEM on a DC or any Windows machine, enabling full takeover of the system and often the entire domain.
SMBGhost (CVE-2020-0796) is a critical vulnerability in the SMBv3 protocol that lets an attacker remotely execute code on vulnerable Windows systems by sending specially crafted packets, allowing full control without authentication. It targets any SMBv3-enabled host on the network, including DCs.
MS17-010 is a critical Windows SMB vulnerability, aka EternalBlue, that allows remote attackers to execute code on vulnerable systems without authentication by exploiting flaws in SMBv1. It targets any SMBv1-enabled Windows host, including DCs, enabling full system takeover.
Checks for coerce vulnerabilities. By default the LISTENER ip will be set to localhost, so no traffic will appear on the network.
The coerce_plus module includes:
PetitPotam: Coerces a DC to authenticate to an attacker via
MS-EFSRPC, enabling NTLM relay attacks for domain takeover.DFSCoerce: Tricks a DC into authenticating to the attacker via the Distributed File System service, enabling relay attacks.
PrinterBug: Exploits Windows Print Spooler to coerce authentication and enable NTLM relay attacks.
MSEven: Uses the Microsoft Exchange’s Web Services to force authentication, facilitating NTLM relay and privilege escalation.
ShadowCoerce: Coerces a domain host to authenticate by abusing the Shadow Copy service, enabling relay attacks.
If one or more are found, set the listener:
LDAP
Enumerate the description field of domain users (get-desc-users):
Execute the whoami command for any domain user:
Obtain the domain's SID:
SSH
MSSQL
Two methods can be used to authenticate to MSSQL: Windows (default) & local auth:
Ports can be also be specified:
From standard user to DBA:
FTP
Resources
Last updated
Was this helpful?