id: wordpress-unyson

info:
  name: Unyson Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/unyson/
  metadata:
    max-request: 1
    plugin_namespace: unyson
    wpscan: https://wpscan.com/plugin/unyson
  tags: tech,wordpress,wp-plugin,top-200

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

    payloads:
      last_version: helpers/wordpress/plugins/unyson.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: 490a004630440220450d5e5abe70317f9743e53f1accce2293de5da01bd08d9fc1b8a8d045d2dc0e02202f3ee78d767f6910b6572cbfb0ea76183dad1cc7383437ab37da03999cb80e6e:922c64590222798bb761d5b6d8e72950