Consul Enumeration
HashiCorp Consul is a service mesh and key-value store that runs on port 8500 (HTTP API) and 8600 (DNS). Consul is used for service discovery, health checking, and configuration storage. By default, Consul has no authentication enabled, exposing the full API including the key-value store, registered services, and agent configuration. In many environments, Consul stores secrets, API keys, and database credentials.
Version and Leader Info
Version: 1.16.2 Datacenter: dc1 Server: true Node: consul-server-01
The /agent/self endpoint returns full agent configuration. If ACLs are enabled but no token is required for this endpoint, the instance may have a permissive default policy.
Service Discovery
List all registered services across the cluster.
{
"consul": [],
"mysql": ["primary", "db"],
"redis": ["cache"],
"web-api": ["production"]
}
Service names and tags reveal the application architecture. Query individual services for IP addresses and ports.
Returns node name, internal IP (Address), service port (ServicePort), and health check status for each service instance.
Key-Value Store
The KV store often contains application configuration, database credentials, API keys, and TLS certificates.
["config/database/password","config/database/host","config/api/secret-key","certs/tls-key"]
S3cur3P@ssw0rd!
Consul KV values are base64-encoded in the API response. Decode them to get the plaintext value.
Cluster Node Enumeration
Returns all cluster nodes with their internal IPs. Use these IPs to pivot through the internal network.
ACL Token Check
If ACLs are enabled, check whether the anonymous token (no auth) has any permissions, or try to enumerate tokens.
If ACLs are enabled, 403 means the anonymous policy has no ACL management permissions. If it returns token data, the anonymous policy is overly permissive.
If the API is accessible without tokens, continue to Consul RCE for command execution via service registration and exec API.
References
-
Consul: HTTP API ReferenceLINK: Consul: HTTP API Reference, developer.hashicorp.com/consul/api-docs (opens in new tab)
Official API documentation for all Consul endpoints.
-
HackTricks: 8500 Pentesting ConsulTOOL: HackTricks: 8500 Pentesting Consul, hacktricks.wiki/en/network-services-pentesting/8500-pentesting-consul.html (opens in new tab)
Consul enumeration and exploitation reference.