id: wordpress-woocommerce-gateway-paypal-express-checkout

info:
  name: WooCommerce PayPal Checkout Payment Gateway Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/
  metadata:
    max-request: 1
    plugin_namespace: woocommerce-gateway-paypal-express-checkout
    wpscan: https://wpscan.com/plugin/woocommerce-gateway-paypal-express-checkout
  tags: tech,wordpress,wp-plugin,top-200

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

    payloads:
      last_version: helpers/wordpress/plugins/woocommerce-gateway-paypal-express-checkout.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: 4b0a004830460221008f6f1309ab90f27a780ceb447a3faa41e4c948e5b6438b0546e91a5617bcc090022100f6b0c577a256d1944cdca39eb95500e3b72c8c1c8563f0097f9607baa284850f:922c64590222798bb761d5b6d8e72950
