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