
Amsi Bypass payload that works on Windwos 11
技术细节可在文章中查看:https://medium.com/@gustavshen/bypass-amsi-on-windows-11-75d231b2cac6
HRESULT AmsiOpenSession(
[in] HAMSICONTEXT amsiContext,
[out] HAMSISESSION *amsiSession
);
此 PowerShell 脚本可用于通过修补 AmsiOpenSession 来绕过 AMSI。根据汇编代码,如果满足以下任意条件,函数将以 E_INVALIDARG 错误退出。

此脚本通过将 RCX 设置为 0 来修补 AmsiOpenSession。

修补 AmsiOpenSession 无法为 Assembly.Load() 绕过 AMSI
HRESULT AmsiScanBuffer(
[in] HAMSICONTEXT amsiContext,
[in] PVOID buffer,
[in] ULONG length,
[in] LPCWSTR contentName,
[in, optional] HAMSISESSION amsiSession,
[out] AMSI_RESULT *result
);
此 PowerShell 脚本可用于通过修补 AmsiScanBuffer 来绕过 AMSI。该脚本通过将 RAX 设置为错误 E_INVALIDARG 的值并立即返回来修补 AmsiScanBuffer。

修补 AmsiScanBuffer 可以为 Assembly.Load() 绕过 AMSI

此文件包含可在当前 PowerShell 会话中使用并立即绕过 AMSI 的单行 payload。但是,它无法为 Assembly.Load() 绕过 AMSI。
详细信息可在此文件中查看。