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