Cobaltstrike系列教程(十一)提權與橫向移動

0x000-前文

有技術交流或滲透測試培訓需求的朋友歡迎聯繫QQ547006660
2000人網絡安全交流羣,歡迎大佬們來玩
羣號820783253

0x001-提權

1.右鍵菜單提權:

選擇beacon,右鍵,執行–>提權
在這裏插入圖片描述
我由於加載了插件,所以比官方多了幾種提權方式
插件下載請看我之前的帖子
在這裏插入圖片描述

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

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

UAC-DLL

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

uac-token-duplication

這是另一種繞過UAC的攻擊,將其從低權限提升到高權限(作爲本地管理員)。這種攻擊使用一個UAC漏洞,允許非提升進程使用從提升進程中竊取的令牌啓動任意進程。此漏洞要求攻擊刪除分配給提升令牌的多個權限。此攻擊適用於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

EXP的下載鏈接爲:https://github.com/k8gege/K8tools/raw/master/CVE-2019-0803.exe
用法: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

0x002-橫向移動

橫向滲透概念:

橫向滲透攻擊技術是複雜網絡攻擊中廣泛使用的一種技術,特別是在高級持續威脅(Advanced Persistent Threats,APT)中更加熱衷於使用這種攻擊方法。攻擊者可以利用這些技術,以被攻陷的系統爲跳板,訪問其他主機,獲取包括郵箱、共享文件夾或者憑證信息在內的敏感資源。攻擊者可以利用這些敏感信息,進一步控制其他系統、提升權限或竊取更多有價值的憑證。藉助此類攻擊,攻擊者最終可能獲取域控的訪問權限,完全控制基於Windows系統的基礎設施或與業務相關的關鍵賬戶。
在提權後,我們可以用mimikatz dump目標機的憑證,並進行內網橫向移動

1.Psexec橫向移動

在執行端口掃描後
目標視圖中,選擇一個目標,右鍵–>登錄–psexec,即可選擇憑證進行橫向移動
在這裏插入圖片描述
在這裏插入圖片描述
如果該機使用了和之前的目標機一樣的憑證,則會成功返回一個system beacon
在這裏插入圖片描述

2.竊取令牌

在進程列表中,尋找以域管理員身份運行的進程,並選定進行steal token,如果成功,則會返回域管權限的beacon,但是一般情況下絕不會那麼簡單的…在此就不演示了。
在這裏插入圖片描述

3.其他手段橫向移動

①使用各種系統漏洞:比如說用ms17-010,ms08-067批量檢測一下內網~
我之前的帖子發過cobaltstrike中ms17-10的利用腳本,貌似是從Empire框架上扒下來的。如圖,該腳本集成了掃描與漏洞利用,可謂是非常方便
在這裏插入圖片描述
②弱口令檢測
內網中ssh弱口令,各種數據庫的弱口令可謂是層出不窮。Mysql可以mof提權,sqlserver可以xp_cmdshell,redis寫shell,oracle也有方法執行系統命令。
③中間件漏洞
這個就非常常見了,比如weblogic各種rce漏洞等等
④Web端漏洞
挖掘web端漏洞,大家都懂
⑤其他
大家自行總結~

0x003-小福利

本次分享的是圈子社區,之前在公衆號中發的“便攜滲透瀏覽器”,該瀏覽器插件豐富,無需安裝,走到哪,用到哪,可謂是滲透必備瀏覽器
在這裏插入圖片描述
鏈接:https://pan.baidu.com/s/1UzaJ-J_kHySf5l9Ha5vAeA
提取碼:3rid

發佈了21 篇原創文章 · 獲贊 28 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章