id: opencart-detect

info:
  name: OpenCart Detection
  author: Chirag Mistry
  severity: info
  description: |
    An instance running OpenCart is detected by looking for specific HTTP headers, HTML tags, and known endpoints.
  metadata:
    max-request: 8
    shodan-query: http.component:"OpenCart"
  tags: opencart,detect,tech

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/robots.txt"
      - "{{BaseURL}}/sitemap.xml"
      - "{{BaseURL}}/favicon.ico"
      - "{{BaseURL}}/admin"
      - "{{BaseURL}}/catalog/view/javascript/opencart.js"
      - "{{BaseURL}}/index.php?route=common/home"
      - "{{BaseURL}}/oc-admin"

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        part: response
        words:
          - "Powered by OpenCart"
          - "X-Powered-By-OpenCart"
          - "OpenCart Store"
        condition: or
        case-insensitive: true

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        part: body
        name: version
        regex:
          - 'OpenCart ([0-9.]+)'
          - 'Powered by OpenCart ([0-9.]+)'

      - type: regex
        part: body
        name: opencart_id
        regex:
          - 'opencart-store-id=([a-z0-9]+)'
          - 'oc-admin/([^/]+)'
# digest: 4a0a00473045022100ae874ddf820f61f97dcc974a8572c93d784c7bb98517b64312740bc484460ddc0220535353fd658c591f7814433866fedb2b32d4f6cfd53170f00e70311f2b7789e1:922c64590222798bb761d5b6d8e72950