Vulnhub靶机Funbox:1 writeup

下载地址:https://www.vulnhub.com/entry/funbox-1,518/
在这里插入图片描述
信息搜集
获取IP地址
在这里插入图片描述
扫描端口
在这里插入图片描述
这里看到一共开放了四个端口21:ftp,22:ssh,88:http,3306:mysql
21端口
登录ftp的时候需要用户名密码,先放着
在这里插入图片描述
80端口
访问80端口发现会跳转到funbox.fritz.box
在这里插入图片描述
修改hosts为:
在这里插入图片描述
再次访问80端口
在这里插入图片描述
这里看到使用了wordpress管理系统
在这里插入图片描述
可以使用wpscan尝试枚举下用户和插件:
wpscan --url http://funbox.fritz.box/ --enumerate u
在这里插入图片描述
这里看到有两个用户admin和joe
接着尝试爆破密码
wpscan --url http://funbox.fritz.box/ -P /usr/share/wordlists/rockyou.txt --max-threads 100
在这里插入图片描述
成功爆出密码joe:12345 admin:iubire
接着登录WordPress后台,直接admin登录,看看能不能模板插入shell
注意修改插件前需要先停用该插件
在这里插入图片描述
反弹shell
code1
使用weevely生成一个php木马
在这里插入图片描述
将木马上传到插件里面
在这里插入图片描述
使用weevely连接
weevely http://192.168.1.152/wp-content/plugins/akismet/index.php x
在这里插入图片描述
code2
将php-reverse-shell.php里面的内容直接上传到插件里面
在这里插入图片描述
kali开启监听
在这里插入图片描述
访问:http://192.168.1.152/wp-content/plugins/akismet/index.php
在这里插入图片描述
成功拿到shell
在这里插入图片描述
code3
也可以直接写入一句话使用菜刀或者蚁剑连接
这里就不作演示了
提权
这里看到家目录一共有两个用户
在这里插入图片描述
之前在登录wordpress看到过joe的用户密码是12345,这里也有joe用户,尝试使用ssh连接
在这里插入图片描述
连接成功
查看joe用户文件的时候发现rbash,shell被限制了
在这里插入图片描述
绕过方法其实很多,直接bash -I 切换shell
在这里插入图片描述
查看用户文件没有任何发现,joe的用户家目录里面有一份邮件,奈何英语水平不高看不懂
看一下另一个用户的家目录里面有啥东西
在这里插入图片描述
经一番查看,这个.backup.sh脚本会持续性间隔时间执行。重点是告诉我们,每隔一段时间,backup.sh都会以管理员权限运行一次。这里也看到了.backup.sh权限也是777
在这里插入图片描述
更改.backup.sh里面的内容
在这里插入图片描述
kali开启监听,等待一会
在这里插入图片描述
监听成功
在这里插入图片描述
这一步有时会弹出funny的shell,后来发现,funny和root个用户都是用了定时任务,funny用户每两分钟执行一次 .backup.sh,root用户每五分钟执行一次。所以就会导致这一步有时弹出funny的shell,有时弹出root的shell。
看一下定时任务

funny的定时任务,每隔两分钟执行一下/home/funny/.backup.sh
root@funbox:/var/spool/cron/crontabs# cat funny 
cat funny
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.n8Fr20/crontab installed on Fri Jun 19 14:33:06 2020)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# Edit this file to introduce tasks to be run by cron.
# 
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# 
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
# 
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# 
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# 
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# 
# For more information see the manual pages of crontab(5) and cron(8)
# 
# m h  dom mon dow   command
*/2 * * * * /home/funny/.backup.sh

root的定时任务,每隔五分钟执行一下/home/funny/.backup.sh
root@funbox:/var/spool/cron/crontabs# cat root
cat root
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.gcHh7z/crontab installed on Fri Jun 19 13:57:00 2020)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# Edit this file to introduce tasks to be run by cron.
# 
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# 
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
# 
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# 
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# 
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# 
# For more information see the manual pages of crontab(5) and cron(8)
# 
# m h  dom mon dow   command
*/5 * * * * /home/funny/.backup.sh

成功拿到flag
在这里插入图片描述
本文所有用到的工具都可以关注微信公众号“网络安全学习爱好者”联系公众客服免费领取!
在这里插入图片描述

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Sword-豪

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

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

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

打赏作者

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

抵扣说明:

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

余额充值