id: wordpress-woocommerce

info:
  name: WooCommerce Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/woocommerce/
  metadata:
    plugin_namespace: woocommerce
    wpscan: https://wpscan.com/plugin/woocommerce
  tags: tech,wordpress,wp-plugin,top-100,top-200

http:
  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/woocommerce/readme.txt"

    payloads:
      last_version: helpers/wordpress/plugins/woocommerce.txt

    extractors:
      - type: regex
        part: body
        internal: true
        name: internal_detected_version
        group: 1
        regex:
          - '(?i)Stable.tag:\s?([\w.]+)'

      - type: regex
        part: body
        name: detected_version
        group: 1
        regex:
          - '(?i)Stable.tag:\s?([\w.]+)'

    matchers-condition: or
    matchers:
      - type: dsl
        name: "outdated_version"
        dsl:
          - compare_versions(internal_detected_version, concat("< ", last_version))

      - type: regex
        part: body
        regex:
          - '(?i)Stable.tag:\s?([\w.]+)'
# digest: 490a0046304402201263e66d229f05eacbf1d3950d27b524345a391e0a5cf37a5a6b5d67ec72a84802201cdb6448e232789d9d9cbc47e44c8940ab68839b1f111bf7f104be5e5588f872:922c64590222798bb761d5b6d8e72950