OSCP 靶场
靶场介绍
bah |
easy |
qdpmcms利用、mysql利用、host碰撞、shellinaboxd使用、pspy分析隐藏进程提权 |
信息收集
主机发现
端口扫描
┌──(root㉿kali)-[~]
└─# nmap -sV -A -p- -T4 192.168.1.130
Starting Nmap 7.94 ( https://nmap.org ) at 2024-01-04 00:16 EST
Nmap scan report for 192.168.1.130
Host is up (0.00034s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE VERSION
80/tcp open http nginx 1.18.0
|_http-title: qdPM | Login
|_http-server-header: nginx/1.18.0
3306/tcp open mysql MySQL 5.5.5-10.5.11-MariaDB-1
| mysql-info:
| Protocol: 10
| Version: 5.5.5-10.5.11-MariaDB-1
| Thread ID: 32
| Capabilities flags: 63486
| Some Capabilities: Support41Auth, Speaks41ProtocolOld, DontAllowDatabaseTableColumn, SupportsTransactions, ConnectWithDatabase, IgnoreSpaceBeforeParenthesis, ODBCClient, IgnoreSigpipes, SupportsLoadDataLocal, Speaks41ProtocolNew, SupportsCompression, FoundRows, InteractiveClient, LongColumnFlag, SupportsMultipleStatments, SupportsAuthPlugins, SupportsMultipleResults
| Status: Autocommit
| Salt: oz8E5vs_bPHYdnx2--:y
|_ Auth Plugin Name: mysql_native_password
MAC Address: 08:00:27:B4:84:BC (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8
Network Distance: 1 hop
TRACEROUTE
HOP RTT ADDRESS
1 0.34 ms 192.168.1.130
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 11.79 seconds
目录扫描
gobuster dir -w /opt/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -u http://192.168.1.130 -x php,txt,html -e
权限获取
https://www.exploit-db.com/exploits/50176
http://<website>/core/config/databases.yml
本来想重置cms,然后进入后台上传文件的。后面发现重置后并不能进入后台,直接404。
进入数据库,发现hidden 库里面有user表和一个url表。
使用host碰撞工具获取访问域名
或者使用wfuzz 进行碰撞
使用上面的密码获取一个web 版的ssh(shellinabox:一款使用 AJAX 的基于 Web 的终端模拟器)
权限提升
使用之前的账号密码登录到qpmadmin账号(密码qpmpazzw)
上传pspy64查看root 运行进程
这里可以看到一个shellinaboxd的命令。 -s 是用于启动服务。程序中的/devel将由用户root调用目标机器的/tmp/dev。因此,我们可以在 /tmp 上创建一个名为“dev”的可执行脚本,这将为我们提供一个反向 shell。
End
“点赞、在看与分享都是莫大的支持”
原文始发于微信公众号(贝雷帽SEC):【OSCP】bah
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论