id: wordpress-custom-post-type-ui

info:
  name: Custom Post Type UI Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/custom-post-type-ui/
  metadata:
    plugin_namespace: custom-post-type-ui
    wpscan: https://wpscan.com/plugin/custom-post-type-ui
  tags: tech,wordpress,wp-plugin,top-100,top-200

http:
  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/custom-post-type-ui/readme.txt"

    payloads:
      last_version: helpers/wordpress/plugins/custom-post-type-ui.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: 490a0046304402202eb08fcb0cfea11ec73abc6fb3d6b411b1d81bf14dbe8e63d42b584a8a6945be02202b550db86522a1fbe07608ddc1b3eb830fe62927660caaf6931ed2741c8a635f:922c64590222798bb761d5b6d8e72950