id: wordpress-loginpress

info:
  name: LoginPress | wp-login Custom Login Page Customizer Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/loginpress/
  metadata:
    max-request: 1
    plugin_namespace: loginpress
    wpscan: https://wpscan.com/plugin/loginpress
  tags: tech,wordpress,wp-plugin,top-200,discovery

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

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