id: wordpress-woo-inpost

info:
  name: InPost for WooCommerce Detection
  author: mailler
  severity: info
  reference:
    - https://wordpress.org/plugins/woo-inpost/
  metadata:
    plugin_namespace: woo-inpost
    wpscan: https://wpscan.com/plugin/woo-inpost
  tags: tech,wordpress,wp-plugin,top-200,discovery

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

    payloads:
      last_version: helpers/wordpress/plugins/woo-inpost.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: 4a0a00473045022059ed279ea4cef70f2c4ee68f6115e4782084f98f3ffe19ec8b160266fc160d6f022100aca943f0c1fca6e5e6cfca86670e1c1ddb99195abe0b00012cbf674453f6524a:922c64590222798bb761d5b6d8e72950