id: wordpress-post-types-order

info:
  name: Post Types Order Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/post-types-order/
  metadata:
    plugin_namespace: post-types-order
    wpscan: https://wpscan.com/plugin/post-types-order
  tags: tech,wordpress,wp-plugin,top-100,top-200,discovery

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

    payloads:
      last_version: helpers/wordpress/plugins/post-types-order.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: 490a0046304402204a31b6f97113271dead955d350b02a2d371c536c75173dedc5135a8ab612ec0e022035baadc30030d00cb659f50e4a2661e6a0ca9533658828af654836f95176a85a:922c64590222798bb761d5b6d8e72950