id: wordpress-wpcf7-redirect

info:
  name: Redirection for Contact Form 7 Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/wpcf7-redirect/
  metadata:
    plugin_namespace: wpcf7-redirect
    wpscan: https://wpscan.com/plugin/wpcf7-redirect
  tags: tech,wordpress,wp-plugin,top-200,discovery

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

    payloads:
      last_version: helpers/wordpress/plugins/wpcf7-redirect.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: 4a0a0047304502200ac9aea9d7510a07fed8527a43769e90050c8ab32c59892930a82994dbd58197022100ae50c17c9b992c15efd247f187ebfd7ab223ae2cd2f359ab4d5d421c648e258c:922c64590222798bb761d5b6d8e72950