Cobalt Strike下的快速横向扩展

admin 2024年2月26日22:06:36评论18 views字数 4047阅读13分29秒阅读模式
原文于:https://blog.csdn.net/weixin_44578334/article/details/108544562原文作者:Azjj98

C2下的横向移动

本来打算今天早点睡的,奈何小区内的施工也不知道脑子怎么想的,凌晨大半夜的各种发动机嗡嗡响,实在是睡不着,想了下,写个文章来记录一下自己最近实战中的一些经验吧。

1.前言

在红队人员拿到一台内网机器后,会进一步利用此权限进行内网的横向移动,从而进一步拿下内网更多的权限。本文只要是总结利用c2快速,简单有效的一个横向扩展。

2.提权

拿到一台内网服务器,如果权限不高的情况下,可能对我们后续的渗透比较局限,所以我们需要先提升到system权限

在C2中有直接提权的exp,官方给的exp可能不是很全,这个需要自己后续的扩展。

操作很简单,选中我们需要提权的机器,右键直接选择提权(我这里是用的汉化版,位置是相同的)

Cobalt Strike下的快速横向扩展

下一步选择一个监听的会话,然后选择一个此主机适用的一个Exp即可,一会就会上线一台System权限的机器

Cobalt Strike下的快速横向扩展

Cobalt Strike下的快速横向扩展

提权的方法很多,因环境而异

3.凭证

在提权后,我们可以利用mimikatz dump目标机的凭证,并进行内网横向移动

C2也提供了mimikatz 插件,实现一键抓取密码

Cobalt Strike下的快速横向扩展

Cobalt Strike下的快速横向扩展

利用我们抓取的明文密码,可以利用此密码对内网的主机进行爆破,其实这个方法在运维人员不是很注意安全防护的情况下真的是屡试不爽,很多情况下都是一个密码直接通杀内网多台主机

在没有获取到明文密码的情况下,我们可以利用Psexec横向移动,也就是所谓的Hash传递攻击,攻击者可以直接通过LM Hash和NTLM Hash访问远程主机或服务windows使用系统API(LsaLogonUser)生成hash进行认证,而不是用明文,所以利用hash即可模拟用户登录进行操作。还有的是如果密码长度大于15就不存在LM Hash,从windows2008开始微软默认禁用LM hash。

如果内网某台主机的hash与我们拿下的主机一样,那我们就要可以利用这个进行攻击

不过在这里要注意几点

哈希传递攻击适用情况:

在工作组环境中:

Windows Vista 之前的机器,可以使用本地管理员组内用户进行攻击。

Windows Vista 之后的机器,只能是administrator用户的哈希值才能进行哈希传递攻击,其他用户(包括管理员用户但是非administrator)也不能使用哈希传递攻击,会提示拒绝访问。

在域环境中:

只能是域管理员组内用户(可以是域管理员组内非administrator用户)的哈希值才能进行哈希传递攻击,攻击成功后,可以访问域内任何一台机器。

被攻击的机器需要开放445端口,而且用户名没有更改过,之前就碰到比较聪明的运维,虽然hash是一样的,但是他把每台主机的用户名都改掉了。

Cobalt Strike下的快速横向扩展

Cobalt Strike下的快速横向扩展

Cobalt Strike下的快速横向扩展

成功上线

Cobalt Strike下的快速横向扩展

Cobalt Strike下的快速横向扩展

当然还有一些其他的通过凭证等进行的横向移动,这里就不一一讲了

4.利用C2 EXP插件进行快速横向扩展

我们也可以利用C2来进行MS-17010,C2的扩展插件其实很全的,好多大佬都写的挺好,这里推荐几个我常用的C2的扩展插件。

https://github.com/phink-team/Cobaltstrike-MS17-010 C2一键打ms17-010

傻瓜式操作,指哪打哪,妈妈在也不用担心我的17010

Cobalt Strike下的快速横向扩展

Cobalt Strike下的快速横向扩展

并且此插件也有scan模块

Cobalt Strike下的快速横向扩展

Cobalt Strike下的快速横向扩展

还有一个就是集成的一个插件,功能挺全。

https://github.com/pandasec888/taowu-cobalt-strike

Cobalt Strike下的快速横向扩展

这个功能太多了,具体什么功能就自己去看介绍吧

Cobalt Strike下的快速横向扩展

还有一个就是K8大佬的

https://github.com/k8gege/Aggressor

Cobalt Strike下的快速横向扩展

5.总结

其实内网中就是层层叠戴的进行的,此文主要讲解了怎么用的快的速度,最简单的方式扩大内网中的成果,当然每个内网环境都不一样,而且硬防软防各不相同,还是要学习一下免杀才能更有效的进行渗透。

下面都是C2的扩展插件,有兴趣的可以自己挨个尝试

https://github.com/harleyQu1nn/AggressorScripts
https://github.com/bluscreenofjeff/AggressorScripts
https://github.com/michalkoczwara/aggressor_scripts_collection
https://github.com/vysecurity/Aggressor-VYSEC
https://github.com/killswitch-GUI/CobaltStrike-ToolKit
https://github.com/ramen0x3f/AggressorScripts
https://github.com/FortyNorthSecurity/AggressorAssessor
https://github.com/threatexpress/persistence-aggressor-script
https://github.com/threatexpress/aggressor-scripts
https://github.com/branthale/CobaltStrikeCNA
https://github.com/gaudard/scripts/tree/master/red-team/aggressor
https://github.com/001SPARTaN/aggressor_scripts
https://github.com/Und3rf10w/Aggressor-scripts
https://github.com/rasta-mouse/Aggressor-Script
https://github.com/vysec/Aggressor-VYSEC
https://github.com/threatexpress/aggressor-scripts
https://github.com/threatexpress/red-team-scripts
https://github.com/rsmudge/ElevateKit
https://github.com/vysec/CVE-2018-4878
https://github.com/harleyQu1nn/AggressorScripts
https://github.com/bluscreenofjeff/AggressorScripts
https://github.com/360-A-Team/CobaltStrike-Toolset
https://github.com/ars3n11/Aggressor-Scripts
https://github.com/michalkoczwara/aggressor_scripts_collection
https://github.com/killswitch-GUI/CobaltStrike-ToolKit
https://github.com/ZonkSec/persistence-aggressor-script
https://github.com/rasta-mouse/Aggressor-Script
https://github.com/RhinoSecurityLabs/Aggressor-Scripts
https://github.com/Kevin-Robertson/Inveigh
https://github.com/Genetic-Malware/Ebowla
https://github.com/001SPARTaN/aggressor_scripts
https://github.com/gaudard/scripts/tree/master/red-team/aggressor
https://github.com/branthale/CobaltStrikeCNA
https://github.com/oldb00t/AggressorScripts
https://github.com/p292/Phant0m_cobaltstrike
https://github.com/p292/DDEAutoCS
https://github.com/secgroundzero/CS-Aggressor-Scripts
https://github.com/skyleronken/Aggressor-Scripts
https://github.com/tevora-threat/aggressor-powerview
https://github.com/tevora-threat/PowerView3-Aggressor
https://github.com/threatexpress/persistence-aggressor-script
https://github.com/FortyNorthSecurity/AggressorAssessor
https://github.com/mdsecactivebreach/CACTUSTORCH
https://github.com/C0axx/AggressorScripts
https://github.com/offsecginger/AggressorScripts
https://github.com/tomsteele/cs-magik
https://github.com/bitsadmin/nopowershell
https://github.com/SpiderLabs/SharpCompile
https://github.com/realoriginal/reflectivepotato

原文始发于微信公众号(猪猪谈安全):Cobalt Strike下的快速横向扩展

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年2月26日22:06:36
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Cobalt Strike下的快速横向扩展http://cn-sec.com/archives/2528080.html

发表评论

匿名网友 填写信息