vulnhub靶场之JOY

一.环境搭建

1.靶场描述

Does penetration testing spark joy? If it does, this machine is for you.
This machine is full of services, full of fun, but how many ways are there to align the stars? Perhaps, just like the child in all of us, we may find joy in a playground such as this.
This is somewhat OSCP-like for learning value, but is nowhere as easy to complete with an OSCP exam timeframe. But if you found this box because of preparation for the OSCP, you might as well try harder. :-)
If you MUST have hints for this machine (even though they will probably not help you very much until you root the box!): Joy is (#1): https://www.youtube.com/watch?v=9AvWs2X-bEA, (#2): something that should be replicated, (#3): what happens when you clean out seemingly "hidden" closets.
Note: There are at least two reliable ways of obtaining user privileges and rooting this machine. Have fun. :-)
Feel free to contact the author at https://donavan.sg/blog if you would like to drop a comment.

2.靶场下载

https://download.vulnhub.com/digitalworld/JOY.7z

3.靶场启动

二.信息收集

1.寻找靶场真实的ip地址

nmap -sP 192.168.239.0/24

arp-scan -l

靶场IP地址为192.168.239.132

2.探测端口及服务

nmap -p- -sV http://192.168.239.132

我们看到开启的端口:21,22,80等等

三.渗透测试

1.访问web服务

http://192.168.239.132

我们看到cms:ossec

2.扫描web服务

这里IP地址变为192.168.239.133

dirb http://192.168.239.133

sudo dirsearch -u   http://192.168.239.133

什么也没有

3.渗透测试

1)ossec框架

我们可以看到cms是ossec,版本号是0.8,我们进行漏洞查看

searchsploit ossec 0.8

我们没有找到合适的脚本

我们使用msfconsole进行漏洞查找,还是没有漏洞

也没有

2)ftp服务

我们看到21端口开放,我们进行查看,用户名是anonymous,密码为空

ftp 192.168.239.133

我们看到2个文件,我们进行查看

我们在/upload/,可以看到2个文件,我们进行查看

这个文件没有什么用

我们可以看到一个版本号的文件,但是它存在于patrick路径中,我们是没有权限去获取的,所以尝试将其转移到/upload路径中

我们使用telnet进行复制

telnet和ftp命令的区别:
telnet连接后,用户主机实际成为远程TELNET服务器的一个虚拟终端(或称是哑终端),一切服务完全在远程服务器上执行,但用户决不能从远程服务器中下载或上传文件,或拷贝文件到用户主机中来。
ftp则不同,它是采用客户机/服务器模式,用户能够操作FTP服务器中的目录,上传或下载文件,但用户不能请求服务器执行某个文件。

我们可以看到版本号在/upload/目录下,我们进行查看

我们可以看到ftp版本号是1.3.5,我们使用msf进行漏洞利用

3)msfconsole

我们使用msfconsole,可以看到攻击成功

4)提权

我们查看目录文件

可以看到patricksecretsofjoy,里面是patrick的密码,我们进行登录

patrick:apollo098765

我们查看提权方式

我们使用telnet进行复制,我们可以看到复制成功

echo "awk 'BEGIN {system(\"/bin/bash\")}'" > test

写入脚本到文件中,可以获取root权限

我们可以看到写入成功,我们把文件复制到/home/patrick/script/里面,然后执行

5)查看flag

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

MS02423

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值