id: wordpress-redirection

info:
  name: Redirection Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/redirection/
  metadata:
    plugin_namespace: redirection
    wpscan: https://wpscan.com/plugin/redirection
  tags: tech,wordpress,wp-plugin,top-100,top-200

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

    payloads:
      last_version: helpers/wordpress/plugins/redirection.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: 4a0a0047304502204f8e0d561c542d45d3730899600d19ec78a73a0cdedf1549f4ef2425e41951cd022100a5f74d8a25e52120b650d94d06a5d9ea5f8b75d7a8c2ca0bea7a619802b162ca:922c64590222798bb761d5b6d8e72950