Remember once vulnhub | penetration testing Five86-2

Five86-2


  • Main Point 0X01
    1. wpscan use
    2. tcpdump 's packet capture and traffic analysis
    3. WordPress plugin mention the right

  • 0X02 early detection and port sniffing
    arp-scan -l to get drone IP:
    Here Insert Picture Description
    nmap -sS -A -p- 172.20.10.3port scanning drones IP-open the case:
    Here Insert Picture Description
    the FTP anonymous login can not only start with 80 ports: wordpress framework; display is not clear;
    in/etc/hostsDNS resolution to the next:
    Here Insert Picture Description
    find wordpress 5.1.4 version (by Wappalyzer get)

searchsploit search found no loopholes can use version 5.1.4

wpscan --url "http://172.20.10.3" -e uFirst come blasting Username:
Here Insert Picture Description
get more users, because there is no other information is given, and high wordpress version , no exploitable vulnerabilities, you may need to enumerate the user name and password, so the password blasting user name:

wpscan --url "http://172.20.10.3" -U user.txt -P rockyou.txt

这里使用kali自带的rockyou.txt,这是一个密码字典:
Here Insert Picture Description
得到两个用户barney、stephen,可以考虑使用metasploit来直接自动化进行攻击,只需配置攻击负载即可。
Here Insert Picture Description
两个用户都以失败告终,那就先登录后台http://five86-2/wp-login.php?看看,后台是wordpress默认的后台,也可扫描目录得到:
Here Insert Picture Description
只有barney用户可以加载插件,而利用wordpress插件提权是比较常规的姿势,我们依次搜索这三个插件的版本有无可用漏洞,发现第三个插件有对应版本的漏洞:Insert or Embed Articulate Content into WordPress Trial 漏洞

这里不再赘述,大致就是构造一个压缩包,包含html文件和php一句话的php文件,然后上传再在相应目录打开即可得到shell,我们使用蚁剑进行连接:

Here Insert Picture Description
构造一个PHP一句话反弹shell,在虚拟终端打开这个PHP,kali监听相应端口即可连接:
Here Insert Picture Description
利用python得到交互式shell:
Here Insert Picture Description
逛了一圈没有发现任何www-data用户可以用来提权的东西,内核版本很高,同样无法通过内核提权,但是发现之前的ftp端口没有派上用场,我们ps -auxwww查看一下进程:
Here Insert Picture Description
发现之前的FTP原来是paul用户创建的,我们知道一般的FTP是明文,而且FTP基于TCP,并且可以进行FTP协议抓包分析
Here Insert Picture Description

  • tcpdump的使用方法和参数:
-c:指定要抓取的包数量。

-i interface:指定tcpdump需要监听的接口。默认会抓取第一个网络接口

-n:对地址以数字方式显式,否则显式为主机名,也就是说-n选项不做主机名解析。

-nn:除了-n的作用外,还把端口显示为数值,否则显示端口服务名。

-P:指定要抓取的包是流入还是流出的包。可以给定的值为"in""out""inout",默认
为"inout"。

-D:列出可用于抓包的接口。将会列出接口的数值编号和接口名,它们都可以用
于"-i"后。

-F:从文件中读取抓包的表达式。若使用该选项,则命令行中给定的其他表达式都将失效。

-w:将抓包数据输出到文件中而不是标准输出。可以同时配合"-G"

"time" 选项使得输出文件每time秒就自动切换到另一个文件。可通过"-r"选项载入这些
文件以进行分析和打印。

-r:从给定的数据包文件中读取数据。使用"-"表示从标准输入中读取。

Capture respectively, and reads the packet. (Note: less than www-data user rights , according to wordpress user and password can switch to stephen user , different barney user passwords and wordpress)
Here Insert Picture Description
Here Insert Picture Description
get user paul password, su paul ls -lahidden files do not have any content, sudo -lfound that you can run to Peter identity / usr / sbin / serviceprogram.
Here Insert Picture Description
Then direct service ../../bin/bashto mention the right, so sudo -u peter service ../../bin/bash
Here Insert Picture Description
we found a highly privileged user peter:
Here Insert Picture Description
Direct can perform /usr/bin/passwd, sudo passwd rootmodify the root password to obtain root privileges, end up flag!
Here Insert Picture Description
Here Insert Picture Description

Published 17 original articles · won praise 3 · Views 1073

Guess you like

Origin blog.csdn.net/crisprx/article/details/104106794