๐ฌ๏ธWindows Local Enumeration
Enumerating System Information
After gaining initial access to a target system, it is always important to learn more about the system like, what OS is running as well as the OS version. This information is very useful as it gives us an idea of what we can do and what type of exploits we can run.
What are we looking for?
Hostname
OS Name (Windows 7, 8 etc)
OS Build & Service Pack (Windows 7 SP1 7600)
OS Architecture (x64/x86)
Installed updates/Hotfixes
Meterpreter Commands for System Information:
getuidโ Retrieve the user ID and privilege level of the current session.sysinfoโ Display information about the target system, such as operating system details and hardware configuration.
Windows Command Line Commands for System Information:
hostnameโ Display the name of the host (computer) on which the command is executed.systeminfoโ Provide detailed information about the operating system and system hardware.wmic qfe get Caption, Description, HotFixID, InstalledOnโ List installed Windows updates along with their details.type eula.txtโ Display the content of the "eula.txt" file.
Enumerating Users & Groups
After gaining initial access to a target system, it is always important to learn more about the system like, what user account you have access to and other user accounts on the system.
What are we looking for?
Current user & privileges
Additional user information
Other users on the system
Groups
Members of the built-in administrator group
Meterpreter Commands for Users & Groups:
getuidโ Display the current user's ID and privilege level.getprivsโ Show the privileges held by the current session.post/windows/gather/enum_logged_on_usersโ Use Metasploit's post-exploitation module to enumerate users logged on to the target system.
Windows Command Line Commands for Users & Groups:
whoamiโ Display the name of the currently logged-in user.whoami /privโ List privileges held by the current user.query userโ Show information about currently logged-in users.net usersโ List all user accounts on the system.net user <user_name>โ Display information about a specific user account.net localgroupโ List local user groups on the system.net localgroup <group_name>โ Display information about a specific local user group.
Enumerating Network Information
What are we looking for?
Current IP address & network adapter
Internal networks
TCP/UDP services running and their respective ports
Other hosts on the network
Routing table
Windows Firewall state
Windows Command Line Commands for Network Information:
ipconfigโ Display IP configuration information for all active network interfaces.ipconfig /allโ Show detailed IP configuration information for all active network interfaces.route printโ Display the routing table, showing network routes and gateway addresses.atp -aโ List scheduled tasks on the system.netstat -anoโ Show active network connections along with associated processes and port numbers.netsh firewall show stateโ Display the state of the Windows Firewall.netsh advfirewall firewall dumpโ Dump the configuration of the Advanced Firewall settings.
Enumerating Processes & Services
After gaining initial access to a target system, it is always important to learn more about the system like, what processes, services and scheduled tasks are currently running.
What are we looking for?
Running processes & services
Scheduled tasks
A process is an instance of a running executable (.exe) or program.
A service is a process which runs in the background and does not interact with the desktop.
Meterpreter Commands for Processes & Services:
psโ List running processes on the target system.pgrep explorer.exeโ Find the Process ID (PID) of theexplorer.exeprocess.migrate <proc_id>โ Migrate the Meterpreter session to the specified process.
Windows Command Line Commands for Processes & Services:
net startโ Display a list of started services.wmic service list briefโ List installed services with brief details using Windows Management Instrumentation (WMI).tasklist /SVCโ List running processes and associated services.schtasks /query /fo LIST /Vโ Query scheduled tasks and provide detailed information.
Automating Windows Local Enumeration
In addition to performing local enumeration manually, we can also automate the process with the help of a few scripts and MSF modules.
While local enumeration techniques/commands are important to know, as a penetration tester, you will need to be time efficient. As a result, you will need to learn how to utilize various automated enumeration scripts.
In addition to automating the process of enumerating information like system information, users & groups etc, these automated enumeration scripts will also provide you with additional information regarding the target system like; privilege escalation vulnerabilities, locally stored passwords etc.
Windows Local Enum Scripts
JAWS- Just Another Windows (Enum) Script - JAWS is PowerShell script designed to help penetration testers (and CTFers) quickly identify potential privilege escalation vectors on Windows systems. It is written using PowerShell 2.0 so 'should' run on every Windows version since Windows 7.
MSFconsole Post-exploitation Modules for Windows:
post/windows/gather/win_privsโ Gather information about privileges on a Windows system.post/windows/gather/enum_logged_on_usersโ Enumerate users currently logged on to a Windows system.post/windows/gather/checkvmโ Check if the target is a virtual machine.post/windows/gather/enum_applicationsโ Enumerate installed applications on the target Windows system.post/windows/gather/enum_computersโ Enumerate domain computers using Windows Management Instrumentation (WMI).post/windows/gather/enum_patchesโ Enumerate installed patches on the target system.post/windows/gather/enum_sharesโ Enumerate shared folders on the target Windows system.
Meterpreter Command:
show_mountโ Display the mounted drives on the target system.
Getting Jaws-Enum Script on Target System:
Visit the GitHub repository of Jaws-Enum and copy the script from the RAW tab.
Paste the copied script on the attacking machine.
Use a Meterpreter shell to upload the script to the victim's temporary folder using the "upload <file_path>" command.
On the victim's machine, run Jaws-Enum using the following command:
powershell.exe -ExecutionPolicy Bypass -File .\\jaws-enum.ps1 -OutputFilename JAWS-Enum.txt
Hacker's Mantra:Hackers see the invisible and do the impossible.
Last updated
Was this helpful?