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