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

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: 490a0046304402203c6e1da4dd83966bb07b2c6a47600b894bbf62441e962619a46df81e7f9e8c6a0220690d46908a00d405ffc2afe052e919a69a328741b4185edd58874f219b34ea08:922c64590222798bb761d5b6d8e72950