id: wordpress-inpost-for-woocommerce

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

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

    payloads:
      last_version: helpers/wordpress/plugins/inpost-for-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: 4b0a00483046022100e1b156553abcc2bf623a537d1d8b7b6d66f38f8220996b97b204f26bd2a6e5e1022100eae070a68f1e5aed49a727143369f7ee36bafa7d7377458ceb5337b40ec77de0:922c64590222798bb761d5b6d8e72950