id: wordpress-all-404-redirect-to-homepage

info:
  name: All 404 Redirect to Homepage Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/all-404-redirect-to-homepage/
  metadata:
    max-request: 1
    plugin_namespace: all-404-redirect-to-homepage
    wpscan: https://wpscan.com/plugin/all-404-redirect-to-homepage
  tags: tech,wordpress,wp-plugin,top-200,discovery

http:
  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/all-404-redirect-to-homepage/readme.txt"

    payloads:
      last_version: helpers/wordpress/plugins/all-404-redirect-to-homepage.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: 4a0a00473045022100daa23a9d3313f3b06aa545bbd349f903af866aabed1c17fbaf4f470503d69d840220447580fdc88202ff8fae542072c139b1c76698e7745edbddb2f886a20201910e:922c64590222798bb761d5b6d8e72950