id: putty-private-key-disclosure

info:
  name: Putty Private Key Disclosure
  author: DhiyaneshDk,geeknik
  severity: medium
  description: Putty internal user key file is exposed.
  reference:
    - https://github.com/detectify/ugly-duckling/blob/master/modules/crowdsourced/putty-private-key-disclosure.json
  classification:
    cpe: cpe:2.3:a:putty:putty:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 8
    vendor: putty
    product: putty
    github-query: filename:putty.ppk
  tags: exposure,files

http:
  - method: GET
    path:
      - "{{BaseURL}}/my.ppk"
      - "{{BaseURL}}/putty.ppk"
      - "{{BaseURL}}/{{Hostname}}.ppk"
      - "{{BaseURL}}/.ssh/putty.ppk"
      - "{{BaseURL}}/.ssh/{{Hostname}}.ppk"
      - "{{BaseURL}}/.putty/my.ppk"
      - "{{BaseURL}}/.putty/putty.ppk"
      - "{{BaseURL}}/.putty/{{Hostname}}.ppk"

    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "PuTTY-User-Key-File"
          - "Encryption:"
        condition: and

      - type: status
        status:
          - 200
# digest: 490a0046304402200ceca9f6fb051ea56c74cf6b8f12a156ae1910b38eacbdb65b20ca00f3e6033d0220220b7eb47f6d58b4f9a381e36402ca60e52950fa94def31ba25658a2a11b5a7b:922c64590222798bb761d5b6d8e72950