天天看點

Cobalt Strike系列教程第七章:提權與橫向移動

橫向滲透攻擊技術是複雜網絡攻擊中廣泛使用的一種技術,特别是在進階持續威脅(Advanced Persistent Threats,APT)中更加熱衷于使用這種攻擊方法。

Cobalt Strike系列教程分享如約而至,新關注的小夥伴可以先回顧一下前面的内容:

Cobalt Strike系列教程第一章:簡介與安裝

Cobalt Strike系列教程第二章:Beacon詳解

Cobalt Strike系列教程第三章:菜單欄與視圖

Cobalt Strike系列教程第四章:檔案/程序管理與鍵盤記錄

Cobalt Strike系列教程第五章:截圖與浏覽器代理

Cobalt Strike系列教程第六章:安裝擴充

今天我們将繼續分享Cobalt Strike系列教程的其他章節内容,希望對大家的學習有所幫助,快速提升實用技能。

提權

1、右鍵菜單提權

選擇beacon,右鍵,執行-->提權。

筆者由于加載了插件,是以比官方多了幾種提權方式。

ms14-058/ms15-051/ms16-016/ms16-032

這些都是大家耳熟能詳的Windows本地提權漏洞,在此插件中都已經內建。

UAC-DLL

這是一種繞過UAC的攻擊,它試圖将本地管理者運作的有效負載從低權限提升到高權限。此攻擊使用UAC漏洞将ArtifactKit生成的DLL複制到特權位置。此攻擊适用于Windows7和Windows8及更高版本的未修補版本。

uac-token-duplication

這是另一種繞過UAC的攻擊,将其從低權限提升到高權限(作為本地管理者)。這種攻擊使用一個UAC漏洞,允許非提升程序使用從提升程序中竊取的token啟動任意程序。此漏洞要求攻擊删除配置設定給提升token的多個權限。此攻擊适用于Windows7及更高版本。如果AlwaysNotify處于其最高設定,則此攻擊要求提升的程序已在目前桌面會話中運作(作為同一使用者),此漏洞使用PowerShell生成會話。

Uac-eventvwr

這種提權方法是利用時間檢視器eventvwr,通過系統資料庫之後,執行Eventvwr.exe會自動加載我們的A.exe(exp),這個時候它的權限就是高了,成功繞過UAV。

Uac-wscript

這種繞過uac提權的方法最初是在Empire架構中現身的,該方法隻針對Windows7有效。

2、自用EXP提權

這種方式就是比較正常的方法,自己上傳最新的EXP進行提權,至于檔案上傳和執行的方法,之前已經講過,請檢視公衆号相關文章。

最近測試CVE-2019-0803的提權效果不錯,影響版本非常廣。

Microsoft Windows Server 2019 0
Microsoft Windows Server 2016 0
Microsoft Windows Server 2012 R2 0
Microsoft Windows Server 2012 0
Microsoft Windows Server 2008 R2 for x64-based Systems SP1
Microsoft Windows Server 2008 R2 for Itanium-based Systems SP1
Microsoft Windows Server 2008 for x64-based Systems SP2
Microsoft Windows Server 2008 for Itanium-based Systems SP2
Microsoft Windows Server 2008 for 32-bit Systems SP2
Microsoft Windows Server 1803 0
Microsoft Windows Server 1709 0
Microsoft Windows RT 8.1
Microsoft Windows 8.1 for x64-based Systems 0
Microsoft Windows 8.1 for 32-bit Systems 0
Microsoft Windows 7 for x64-based Systems SP1
Microsoft Windows 7 for 32-bit Systems SP1
Microsoft Windows 10 Version 1809 for x64-based Systems 0
Microsoft Windows 10 Version 1809 for ARM64-based Systems 0
Microsoft Windows 10 Version 1809 for 32-bit Systems 0
Microsoft Windows 10 Version 1803 for x64-based Systems 0
Microsoft Windows 10 Version 1803 for ARM64-based Systems 0
Microsoft Windows 10 Version 1803 for 32-bit Systems 0
Microsoft Windows 10 version 1709 for x64-based Systems 0
Microsoft Windows 10 Version 1709 for ARM64-based Systems 0
Microsoft Windows 10 version 1709 for 32-bit Systems 0
Microsoft Windows 10 version 1703 for x64-based Systems 0
Microsoft Windows 10 version 1703 for 32-bit Systems 0
Microsoft Windows 10 Version 1607 for x64-based Systems 0
Microsoft Windows 10 Version 1607 for 32-bit Systems 0
Microsoft Windows 10 for x64-based Systems 0
Microsoft Windows 10 for 32-bit Systems 0           

用法:CVE-2019-0803.exe cmd cmdline,可能需要多執行幾次才可以成功。

3、Powershell提權

在此需要使用beacon中的指令-powershell-import。

beacon> help powershell-import
Use: powershell-import [/path/to/local/script.ps1]

Import a powershell script which is combined with future
calls to the powershell command. You may only use one
imported script at a time.           

使用 powershell-import 本地導入我們的腳本。

powershell執行,PowerUp.ps1 這個子產品是個提權輔助子產品。

下載下傳連結:https://github.com/HarmJ0y/PowerUp

橫向移動

1、橫向滲透概念

橫向滲透攻擊技術是複雜網絡攻擊中廣泛使用的一種技術,特别是在進階持續威脅(Advanced Persistent Threats,APT)中更加熱衷于使用這種攻擊方法。攻擊者可以利用這些技術,以被攻陷的系統為跳闆,通路其他主機,擷取包括郵箱、共享檔案夾或者憑證資訊在内的敏感資源。

攻擊者可以利用這些敏感資訊,進一步控制其他系統、提升權限或竊取更多有價值的憑證。借助此類攻擊,攻擊者最終可能擷取域控的通路權限,完全控制基于Windows系統的基礎設施或與業務相關的關鍵賬戶。

在提權後,我們可以用mimikatz dump目标機的憑證,并進行内網橫向移動。

2、P**ec橫向移動

在執行端口掃描後,目标視圖中,選擇一個目标,右鍵-->登入--p**ec,即可選擇憑證進行橫向移動。

如果該機使用了和之前的目标機一樣的憑證,則會成功傳回一個system beacon。

3、竊取token

在程序清單中,尋找以域管理者身份運作的程序,并標明進行steal token,如果成功,則會傳回域管權限的beacon。

4、其他手段橫向移動

①使用各種系統漏洞:比如說用ms17-010,ms08-067批量檢測一下内網。

之前發過cobaltstrike中ms17-10的利用腳本,貌似是從Empire架構上拔下來的。如圖,該腳本內建了掃描與漏洞利用,可謂是非常友善。

②弱密碼檢測

内網中ssh弱密碼,各種資料庫的弱密碼可謂是層出不窮。Mysql可以mof提權,sqlserver可以xp_cmdshell,redis寫shell,oracle也有方法執行系統指令。

③中間件漏洞

這個就非常常見了,比如weblogic各種rce漏洞等等。

④Web端漏洞

挖掘Web端漏洞。

以上是今天的内容,大家看懂了嗎?後面我們将持續更新Cobalt Strike系列的知識點,希望大家及時關注。

繼續閱讀