Persistence

Windows

Scheduled Tasks

Hidden Local User

Dollar Sign

Cmd > net1.exe user snovvcrash$ Passw0rd! /add

SpecialAccounts

PS > New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\" -Name SpecialAccounts
PS > New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\" -Name snovvcrash -PropertyType DWORD -Value 0 -Force

Suborner

COM Hijacking

Locate good targets to hijack with Procmon filters:

  • Operation is RegOpenKey

  • Result is NAME NOT FOUND

  • Path is InprocServer32 (in-process server allowing the specified DLL to be loaded into current process memory space)

Locate CLSIDs from scheduled tasks:

Check if a COM component exists under a relevant registry hive by its CLSID:

If it exists under HKLM but does not exists under HKCU hive, we can hijack this COM component by creating a new item in the latter path:

RID Hijacking

.LNK Shortcuts

VNC

TigerVNC (WinVNC)

TightVNC

Download and unpack MSI:

Create a password (8 chars):

Install Vinagre client:

Install TightVNC server:

Uninstall TightVNC server:

AnyDesk

Chrome Remote Desktop

Deploy MSI (if Chrome Remote Desktop is NOT already in use on client):

Backup current config (if Chrome Remote Desktop is already in use on client):

Register device (sometimes CurrentVersion path not working, explicit existing version provision may help):

Restore config (and lose access) if needed:

Keep Awake

Disable sleep when plugged in / on battery:

Disable hibernate when plugged in / on battery:

Disable sleep when closing laptop lid (plugged in / on battery):

Apply all settings:

Create a scheduled task to wake up:

SDDL Manipulation

Backup current SDDL for scmanager:

Change it to allow everyone to create a service:

Create a service that will auto run at next reboot:

Check if scmanager SDDL has been modified:

Tools

SharPersist

Linux

Cron

Quicky crontab without duplicating backdoor process if already running:

SSH

Add a temporary rule allowing connections from your IP:

SSH Tunnel in Crontab

Attacker's box:

Victim's box:

Global Socket

Install

Victim's box:

Connect

Attacker's box:

Clean Up

Victim's box:

Rootkits

Last updated