id: oscommerce-detect

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

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/robots.txt"
      - "{{BaseURL}}/sitemap.xml"
      - "{{BaseURL}}/favicon.ico"
      - "{{BaseURL}}/admin"
      - "{{BaseURL}}/includes/modules/"
      - "{{BaseURL}}/catalog/includes/javascript/oscommerce.js"
      - "{{BaseURL}}/checkout_payment.php"

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        part: response
        words:
          - "Powered by osCommerce"
          - "oscommerce.com"
          - "X-Powered-By-osCommerce"
        condition: or
        case-insensitive: true

      - type: status
        status:
          - 200

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

      - type: regex
        part: body
        name: oscommerce_id
        regex:
          - 'oscommerce-site-id=([a-z0-9]+)'
          - 'oscommerce\.com/([^/]+)'
# digest: 4a0a00473045022100fd94d3a99de88c3573a4aaf3d5625ec7bd74692ac425e3a0cb061b2b311e719b022000ce088a67f95982f0a0ac11038d7579616324e457a0783d72fa6b5f0b783ac3:922c64590222798bb761d5b6d8e72950