0x00-前文
有技術交流或滲透測試培訓需求的朋友歡迎聯系QQ/VX-547006660,需要代碼審計、滲透測試、紅藍對抗網絡安全相關業務可以看置頂博文
2000人網絡安全交流群,歡迎大佬們來玩
群號820783253
Cobaltstrike系列教程(一)簡介與安裝
https://bbs.ichunqiu.com/thread-52937-1-1.html
Cobaltstrike系列教程(二)Listner與Payload生成
https://bbs.ichunqiu.com/thread-52982-1-1.html
Cobaltstrike系列教程(三)beacon詳解
https://bbs.ichunqiu.com/thread-52994-1-1.html
Cobaltstrike系列教程(四)菜單欄與視圖
https://bbs.ichunqiu.com/thread-52997-1-1.html
Cobaltstrike系列教程(五)憑據導出
https://bbs.ichunqiu.com/thread-53001-1-1.html
Cobaltstrike系列教程(六)文件/進程管理與鍵盤記錄
https://bbs.ichunqiu.com/thread-53003-1-1.html
Cobaltstrike系列教程(七)端口掃描與Net View
https://bbs.ichunqiu.com/thread-53012-1-1.html
Cobaltstrike系列教程(八)截圖與瀏覽器代理
https://bbs.ichunqiu.com/thread-53013-1-1.html
Cobaltstrike系列教程(九)內置Socks與神器EW
https://bbs.ichunqiu.com/thread-53014-1-1.html
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橫向移動
在執行端口掃描后
目標視圖中,選擇一個目標,右鍵-->登錄--p**ec,即可選擇憑證進行橫向移動
如果該機使用了和之前的目標機一樣的憑證,則會成功返回一個system beacon
2.竊取令牌
在進程列表中,尋找以域管理員身份運行的進程,並選定進行steal token,如果成功,則會返回域管權限的beacon,但是一般情況下絕不會那么簡單的...在此就不演示了。
3.其他手段橫向移動
①使用各種系統漏洞:比如說用ms17-010,ms08-067批量檢測一下內網~
我之前的帖子發過cobaltstrike中ms17-10的利用腳本,貌似是從Empire框架上拔下來的。如圖,該腳本集成了掃描與漏洞利用,可謂是非常方便
PS:等到cve2019-0708一出,又是一場腥風血雨
②弱口令檢測
內網中ssh弱口令,各種數據庫的弱口令可謂是層出不窮。Mysql可以mof提權,sqlserver可以xp_cmdshell,redis寫shell,oracle也有方法執行系統命令。
③中間件漏洞
這個就非常常見了,比如weblogic各種rce漏洞等等
④Web端漏洞
挖掘web端漏洞,大家都懂
⑤其他
大家自行總結~