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