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: 4b0a00483046022100c9ffbc58555c2e2d0f748ae10d654ef75d97cf9bf038d40da9044174fd88d9bf022100c4359f9a105ba9842d2ce6f62971f1f8f5fa1c592dc70059adaa744c491dafa5:922c64590222798bb761d5b6d8e72950