Cobaltstrike系列教程(十一)提权与横向移动

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,右键,执行-->提权
e1wAFP.png
我由于加载了插件,所以比官方多了几种提权方式
插件下载请看我之前的帖子
e1dbZR.png

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
e1dLIx.png

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,可能需要多执行几次才可以成功
e1dqd1.png

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.

e1djJK.png
使用 powershell-import 本地导入我们的脚本,powershell执行,PowerUp.ps1 这个模块是个提权辅助模块
下载链接:https://github.com/HarmJ0y/PowerUp

0x002-横向移动

横向渗透概念:

横向渗透攻击技术是复杂网络攻击中广泛使用的一种技术,特别是在高级持续威胁(Advanced Persistent Threats,APT)中更加热衷于使用这种攻击方法。攻击者可以利用这些技术,以被攻陷的系统为跳板,访问其他主机,获取包括邮箱、共享文件夹或者凭证信息在内的敏感资源。攻击者可以利用这些敏感信息,进一步控制其他系统、提升权限或窃取更多有价值的凭证。借助此类攻击,攻击者最终可能获取域控的访问权限,完全控制基于Windows系统的基础设施或与业务相关的关键账户。
在提权后,我们可以用mimikatz dump目标机的凭证,并进行内网横向移动

1.Psexec横向移动

在执行端口扫描后
目标视图中,选择一个目标,右键-->登录--p**ec,即可选择凭证进行横向移动
e1dXi6.png
e1dvRO.png

如果该机使用了和之前的目标机一样的凭证,则会成功返回一个system beacon
e1wpsH.png

2.窃取令牌

在进程列表中,寻找以域管理员身份运行的进程,并选定进行steal token,如果成功,则会返回域管权限的beacon,但是一般情况下绝不会那么简单的...在此就不演示了。
e1dxzD.png

3.其他手段横向移动

①使用各种系统漏洞:比如说用ms17-010,ms08-067批量检测一下内网~
我之前的帖子发过cobaltstrike中ms17-10的利用脚本,貌似是从Empire框架上拔下来的。如图,该脚本集成了扫描与漏洞利用,可谓是非常方便
e1w9Ld.png
PS:等到cve2019-0708一出,又是一场腥风血雨
②弱口令检测
内网中ssh弱口令,各种数据库的弱口令可谓是层出不穷。Mysql可以mof提权,sqlserver可以xp_cmdshell,redis写shell,oracle也有方法执行系统命令。
③中间件漏洞
这个就非常常见了,比如weblogic各种rce漏洞等等
④Web端漏洞
挖掘web端漏洞,大家都懂
⑤其他
大家自行总结~

posted @ 2021-12-20 21:01  J0o1ey  阅读(755)  评论(0编辑  收藏  举报