Post Exploitation

Post Exploitation in Active Directory

GPOs

Identify the OU containing the VICTIM-PC object:

PS > Add-WindowsFeature -Name "RSAT-AD-PowerShell"
PS > Import-Module ActiveDirectory
PS > Get-ADComputer -Identity VICTIM-PC | select DistinguishedName

Create a GPO using GPMC:

  1. Run > gpmc.msc.

  2. Create a new GPO in the OU in which VICTIM-PC resides.

  3. Remove Authenticated Users from Security Filtering and add VICTIM-PC there.

  4. Link it to the OU and edit it.

Usually, it takes between 90 and 120 minutes for a new GPO to be applied. Force it with:

Cmd > gpudate.exe /force
<POLICY_NAME>
  Computer Configuration
    Policies
      Administrative Templates
        Windows Components
          Remote Desktop Services
            Remote Desktop Session Host
              Connections
                Allow users to connect remotely using Remote Desktop Services
                  Enabled, OK

Reach a Locked-down Domain Computer

If you find yourself in a situation when you're already a domain admin and you need to access a locked-down domain computer (no RDP/WinRM, no SMB shares, no owned local admins, etc.), creating an evil GPO may help.

Create a GPO using PowerShell (will trigger a command when the victim user logs in):

Enable ADMIN shares manually by restoring AutoShareServer:

Shadow RDP

Enable Shadow RDP via group policies or by manually setting the registry and connect to an active session on the target machine.

Enable:

Shadow the RDP:

Cleanup:

RpcShadow2

Run on Domain Computers

An example PowerShell script to execute commands as a local admin on all domain computers pulling LAPS passwords automatically:

Locate DFS Targets

Locate a root target:

Locate a root folder:

One-liner:

House Cleaning

Remove the last tunnel while operating from it:

Last updated