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

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