id: wordpress-limit-login-attempts

info:
  name: Limit Login Attempts Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/limit-login-attempts/
  metadata:
    plugin_namespace: limit-login-attempts
    wpscan: https://wpscan.com/plugin/limit-login-attempts
  tags: tech,wordpress,wp-plugin,top-200

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

    payloads:
      last_version: helpers/wordpress/plugins/limit-login-attempts.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: 4a0a004730450220613e3ef9de80f3fb3e5995e1545f7bf6e02d53cd9d8043af53e4aff94781d15f022100c56e2df208dd49fb8d87e133bae3f58a2d8e7315022213affafe66713b9b28fd:922c64590222798bb761d5b6d8e72950