id: wordpress-force-regenerate-thumbnails

info:
  name: Force Regenerate Thumbnails Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/force-regenerate-thumbnails/
  metadata:
    plugin_namespace: force-regenerate-thumbnails
    wpscan: https://wpscan.com/plugin/force-regenerate-thumbnails
  tags: tech,wordpress,wp-plugin,top-200,discovery

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

    payloads:
      last_version: helpers/wordpress/plugins/force-regenerate-thumbnails.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: 490a0046304402205cf079d4766e0c4a08d9376e54d107d802aed16aa2d0ea1ca836f16835395f0c022002e5b174f1a0fe279120383fbf4e8efb625ff9be3a1be92cd97479d75f76b9fc:922c64590222798bb761d5b6d8e72950