.. / AMSI-Bypass-amsiInitFailed
Star

One-liner to bypass the AMSI in a Powershell. Manipulating a result variable set by AmsiInitialize can also lead to another AMSI bypass through the amsiInitFailed field. The additional code is Rasta Mouse’s memory patch to bypass AMSI, run the one-liner and the additional code to disable AMSI in powershell.

Command Reference:

loop the GetTypes method, searching for all types containing the string “iUtils” in its name

GetFields accepts filtering modifiers, we’ll apply the NonPublic and Static filters to help narrow the results

loop through all the fields, searching for a name containing “nitFailed”, as this does not be marked as malicious looking for the amsiContext

set the value to True as this bypasses the AMSI
Command: Copy Extra code: Copy References:

https://gist.github.com/D3Ext/bf57673644ba08e729f65892e0dae6c4