windowsRough Draft

UNSORTED: Draft 1

PowerShell Execution Policy Bypass

First thing we need to do is this

powershell.exe -nop -exec bypass
powershell.exe  -nop -ep bypass
powershell -ep bypass

Enable Alternate Methods for Lateral-Movement

Enable RDP

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

Enable PS-Remoting

Enable-PSRemoting -Force

Add New user or Add Machine user to Administrators (Local)

# New User
net localgroup [username] [password] /add
# Macine user to Administrators group
net localgroup administrators [username] /add

Enumeration

chevron-rightManual Checkshashtag

chevron-rightAdd User to Administrators Grouphashtag

chevron-rightCheck Outdated OS Version / Name || Check Kernal Exploithashtag
chevron-rightPowershell History filehashtag

Winpeas can give the result for this , but to check manually, navigate to directory :-

chevron-rightLAPS readerhashtag

Local Administrator Password Solution (LAPS)

check if user has *LAPS_Readers enabled

extract passwords :-

  • using linux

  • using windows

getting rev-shell


chevron-rightAlways-Install-Elevatedhashtag

Check winpeas result first to confirm whether Always_Install_Elevated is enabled or not

Exploitation

  • Create reverse shell in .msi format

  • Transfer it to victim machine and setup the listener on attacker and run below command


chevron-rightLateral-Movementhashtag
  • use Ps-exec to get shell as nt authority\system

  • use WMI or evil-winrm to get shell as Administrator

  • use evil-winrm


chevron-rightSeBackupPrivilegehashtag

From window (evil-winrm) session

From linux session

chevron-rightSeRestorePrivilegehashtag

From window (evil-winrm) session

  1. Rename utilman.exe to utilman.old and cmd.exe to utilman.exe

From Linux session

This will open a new rdp window to target system

  1. On system press the below key shortcut

We get the shell as root

chevron-rightSeImpersonatePrivilegehashtag

Download GodPotato

https://github.com/BeichenDream/GodPotato/releases/tag/V1.20arrow-up-right

check .NET version before uploading the binary {Not Compulsory}

Exploit


chevron-rightAbusing Full Permission on Binary .exe File hashtag

Recon

Confirm File permissions

Generate malicious .exe file as reverse shell

Transfer and replace it with original binary

If Possible [Restart service]

If Not Possible [Shutdown]


AD recycle bin enumeration

https://www.scriptinghouse.com/2017/04/active-directory-recycle-bin-restore-deleted-objects-or-wipe-off-your-bin.html


Generic All on user / Force-Change-Password

Linux

Windows

Generic Write on user

Linux


Generic All on DC

Add machine account

Retrieve SID of it


Server Operator group

The member of this group can start/stop any service.


UNSORTED : Draft 2


Generic All

chevron-rightGeneric All on Userhashtag

Force-Change-Password

Linux

Windows

chevron-rightGeneric All on Grouphashtag

Add Member

  • Linux

Generic Write on user

Linux


Generic All on Computer / DC-computer

RBCD

Link :

chevron-rightLinux Exploitationhashtag
  1. Add computer

  1. Set 'msDS-AllowedToActOnBehalfOfOtherIdentity' to target computer

  1. Obtain Service Ticket

  1. Map the ip with domain/local (for computer) & DC.domain.local (for DC-computer)

  1. Export Administrator.ccahe file in current environment

  1. Perform PTT (pass the ticket) and drop the shell

DC-Sync

chevron-rightExploitationhashtag

Linux

Win-exe

Win-ps1

GPO abuse

chevron-rightGeneric-Write | WriteDACL | Write-Ownerhashtag

Add Local Admin


Server Operator group

The member of this group can start/stop any service.


GMSAPasswordReader

chevron-rightExploitationhashtag

From windows (evil-winrm)

From Linux (Not recommended from OSCP)

Last updated