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

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