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,discovery

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: 490a0046304402202f2c4830ca2c48b2d4ff5260e3508a491bf76eb09c66e9fcdd64063002f94e58022019267482a447f184f0e12a49f290f9d82f0d5210660d4be864efd8c8ffe0e081:922c64590222798bb761d5b6d8e72950