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,discovery

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