id: vault-panel

info:
  name: Vault Login Panel - Detect
  author: DhiyaneshDK,righettod
  severity: info
  description: Vault login panel was detected.
  reference:
    - https://developer.hashicorp.com/vault
    - https://developer.hashicorp.com/vault/api-docs
    - https://developer.hashicorp.com/vault/api-docs#help
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
    cwe-id: CWE-200
    cpe: cpe:2.3:a:hashicorp:vault:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 4
    vendor: hashicorp
    product: vault
    shodan-query: http.favicon.hash:-919788577
    fofa-query: icon_hash=-919788577
  tags: panel,vault,detect,hashicorp,discovery

http:
  - method: GET
    path:
      - "{{BaseURL}}/v1/sys/health"
      - "{{BaseURL}}/ui/vault/auth"
      - "{{BaseURL}}/ui/auth"
      - "{{BaseURL}}/v1/sys/health?help=1"

    stop-at-first-match: true
    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200 || status_code == 429'
          - 'contains_any(to_lower(body), "vault-cluster", "vault/config/environment", "<title>vault</title>", "hashicorp vault api")'
        condition: and

    extractors:
      - type: json
        part: body_1
        name: version
        json:
          - ".version"
# digest: 4b0a0048304602210087cad9677916779403e39bba43b085025c0da82c49321bd3839fafefea39120a022100f5f5d305ef315efc17e651cc6988d0ae511b0a3500d3e3c5b87a6459dff110a8:922c64590222798bb761d5b6d8e72950