Release the RAVEN: First Contact
LevelBlue SpiderLabs released RAVEN, a Python-based offensive security tool for comprehensive Elasticsearch cluster reconnaissance and assessment. The tool automates fingerprinting, deep reconnaissance, anonymous access detection, index enumeration, secret hunting, credential brute-forcing, and privilege escalation analysis. The blog demonstrates RAVEN against lab environments running Elasticsearch 7.17.22, showing how an attacker can pivot from a single open port (9200) to full cluster compromise through unauthenticated API access, exposed credentials in indices, and default credential usage.
Detection / Hunteropenrouter
What Happened
A cybersecurity research team has published a new tool called RAVEN that helps security professionals test Elasticsearch databases for weaknesses. Elasticsearch is a popular search and data storage system used by many organizations. The tool automates the process of checking whether these databases are properly secured or left open to anyone who can reach them. It can detect if a database requires no password at all, find sensitive information like API keys and passwords stored inside, test for default passwords that were never changed, and map out what level of access a person has once they log in. Organizations running Elasticsearch should review their security settings, ensure authentication is enabled, change any default passwords, and audit what sensitive data may be stored in their clusters.
Key Takeaways
- RAVEN is a new offensive security tool for Elasticsearch cluster reconnaissance, fingerprinting, credential testing, and privilege escalation analysis
- Anonymous access to unsecured Elasticsearch clusters remains a critical exposure — RAVEN quantifies the full attack surface of unauthenticated API endpoints
- Default credentials (elastic:changeme) are still found in production Elasticsearch deployments and represent a trivial initial access vector
- Automated secret detection across Elasticsearch indices can expose AWS keys, database connection strings, JWT tokens, private keys, and API credentials stored by developers
- RAVEN maps privilege escalation paths including role enumeration, user listing, and role-mapping analysis to identify hidden privilege bridges
Affected Systems
- Elasticsearch 7.17.22 (and other versions)
- Kibana (various versions, port 5601)
- Elasticsearch clusters with X-Pack security disabled
- Elasticsearch clusters using default credentials
Vulnerabilities (CVEs)
| CVE | Product | Severity | Description |
|---|---|---|---|
| CVE-2015-5531 | Elasticsearch | Snapshot directory traversal vulnerability that becomes viable when path.repo is configured on the cluster. | |
| CVE-2019-7609 | Kibana Timelion | Prototype pollution attack against Kibana Timelion plugin requiring the plugin to be enabled. |
Attack Chain
- Initial Access: Attacker identifies open port 9200 (Elasticsearch) during network sweep and fingerprints cluster version, build type, and configuration
- Reconnaissance: Deep recon queries internal cluster APIs (_cat/, _cluster/) to map topology, filesystem paths, snapshot repositories, cross-cluster relationships, and installed plugins
- Anonymous Access Testing: Tool tests critical API endpoints without credentials to determine if authentication is disabled, quantifying exposure severity
- Discovery: Index enumeration reveals data-bearing indices; field mappings expose schema and identify credential-bearing fields for targeted search
- Credential Access: Automated secret detection scans all indices for AWS keys, private keys, JWT tokens, database connection strings, and API credentials stored in plaintext
- Initial Access (Credential Testing): Default credential list tests common username/password pairs; password spraying mode evades lockout policies
- Privilege Escalation: Valid credentials are analyzed for privilege profile, role memberships, API key creation ability, and role-mapping-based escalation paths
Detection Availability
- YARA Rules: No
- Sigma Rules: No
- Snort/Suricata Rules: No
- KQL Queries: No
- Splunk SPL Queries: No
- EQL Queries: No
- Other Detection Logic: No
No detection rules are provided in this article. It is a tool release and demonstration blog post focused on offensive reconnaissance techniques against Elasticsearch.
Detection Engineering Assessment
| Dimension | Rating | Rationale |
|---|---|---|
| EDR Visibility | Low | RAVEN operates entirely over HTTP API calls to Elasticsearch port 9200. EDR agents on Elasticsearch host nodes would see the Elasticsearch process receiving requests but would not inherently flag API queries as malicious since they appear as normal application traffic. |
| Network Visibility | Medium | Network monitoring could detect unusual HTTP traffic patterns to port 9200, especially high-volume API enumeration of _cat/* and _cluster/* endpoints. However, if the attacker is already network-adjacent, traffic may appear legitimate. TLS-terminated clusters would reduce visibility further. |
| Detection Difficulty | Moderate | Detection requires Elasticsearch-specific audit logging which is often not enabled by default. On unsecured clusters, there are no authentication events to alert on. Distinguishing RAVEN's enumeration patterns from legitimate administrative queries requires behavioral baselining of API endpoint access patterns. |
Required Log Sources
- Elasticsearch audit logs (xpack.security.audit.enabled)
- Elasticsearch slow log and access logs
- Network flow data for port 9200 and 5601
- Reverse proxy or load balancer logs fronting Elasticsearch
- Authentication failure logs from Elasticsearch X-Pack security
Hunting Hypotheses
| Hypothesis | Telemetry | ATT&CK Stage | FP Risk |
|---|---|---|---|
| Consider hunting for rapid sequential access to multiple Elasticsearch _cat/* and _cluster/* API endpoints from a single source IP in a short time window, which would indicate automated reconnaissance activity consistent with T1580 and T1592. | Elasticsearch access logs, reverse proxy logs, network flow data for port 9200 | Reconnaissance | Medium — legitimate monitoring tools and administrative scripts may also query multiple _cat/* endpoints sequentially |
| Consider hunting for unauthenticated HTTP requests to Elasticsearch API endpoints on clusters where X-Pack security is enabled, which would indicate either anonymous access attempts or misconfigured authentication. | Elasticsearch audit logs, HTTP access logs, network flow data | Initial Access | Low — unauthenticated requests to a secured cluster should not occur under normal operations |
| Consider hunting for repeated authentication failures followed by a successful login from the same source IP, which would indicate credential brute-force activity consistent with T1110. | Elasticsearch X-Pack authentication logs, audit logs with authentication events | Initial Access | Low — while legitimate users may mistype passwords, a pattern of many failures followed by success is suspicious |
| Consider hunting for search queries containing credential-related terms (password, api_key, secret, token, aws_access_key) across Elasticsearch indices, which would indicate credential hunting activity consistent with T1552. | Elasticsearch slow logs, search request logs, audit logs with query body logging | Credential Access | Medium — legitimate application searches may include these terms in normal query contexts |
| Consider hunting for access to the .security-7 index or _security/role and _security/user API endpoints by non-administrative accounts, which would indicate privilege escalation reconnaissance consistent with T1068 and T1087. | Elasticsearch audit logs with index-level access logging, X-Pack security audit trail | Privilege Escalation | Low — only administrative users should access security configuration indices and APIs |
Control Gaps
- Network-level controls cannot distinguish between legitimate and malicious Elasticsearch API queries without application-layer inspection
- Clusters with X-Pack security disabled produce no authentication events to alert on
- Standard SIEM rulesets typically lack Elasticsearch-specific API access pattern detection
- Credential material stored in Elasticsearch indices is not covered by traditional DLP or secrets scanning solutions
- Role mapping misconfigurations creating hidden privilege paths are not detected by standard access reviews
Key Behavioral Indicators
- Sequential HTTP GET requests to _cat/indices, _cat/nodes, _cat/shards, _cat/plugins, _cluster/health, _cluster/settings, _cluster/state, _nodes/stats from a single source in rapid succession
- HTTP requests to Elasticsearch port 9200 with no Authorization header on clusters where X-Pack security is enabled
- Search queries containing terms like 'password', 'api_key', 'secret', 'token', 'aws_access_key', 'private_key' across multiple or all indices
- Authentication attempts using username 'elastic' with password 'changeme' — the Elasticsearch factory default credential pair
- Access to .security-7 system index or _security/role, _security/user, _security/role_mapping API endpoints by non-superuser accounts
- High volume of HTTP 401 responses followed by a 200 OK from the same source IP indicating successful brute-force or password spraying
False Positive Assessment
Medium — Many of the behavioral indicators described (API endpoint enumeration, search queries with credential-related terms, authentication failures) can occur during legitimate administrative activity, monitoring operations, or application development. Distinguishing malicious reconnaissance from normal operations requires baselining API access patterns and correlating multiple signals.
Recommendations
Immediate Mitigation
- Verify against your organization's incident response runbook and team escalation paths before acting. Consider auditing all Elasticsearch clusters in your environment for anonymous access by testing unauthenticated HTTP requests to port 9200 endpoints.
- If your Elasticsearch deployment uses X-Pack security, consider verifying that the default 'elastic' superuser password has been changed from 'changeme' to a strong, unique password.
- Consider enabling Elasticsearch audit logging (xpack.security.audit.enabled: true) if not already active, to capture authentication events and API access patterns for detection and forensics.
- Evaluate whether Elasticsearch port 9200 and Kibana port 5601 are exposed beyond trusted network segments; consider restricting access via network segmentation or firewall rules.
Infrastructure Hardening
- Consider enabling X-Pack security on all Elasticsearch clusters if not already configured, including TLS for transport and REST layers.
- Evaluate implementing a reverse proxy with authentication in front of Elasticsearch to add an additional access control layer and logging point.
- Consider reviewing role mappings in Elasticsearch for unintended privilege grants based on user metadata or realm membership attributes.
- If applicable to your deployment, consider configuring path.repo carefully — its presence enables CVE-2015-5531 snapshot directory traversal exploitation.
- Consider implementing network-level rate limiting on Elasticsearch API endpoints to slow down brute-force and password spraying attempts.
User Protection
- Consider auditing Elasticsearch indices for stored credentials, API keys, database connection strings, and other secrets using automated scanning tools or regex-based searches.
- Evaluate whether developers are storing sensitive configuration data in Elasticsearch indices as a convenience and consider implementing policies to prevent this practice.
- If your organization uses Elasticsearch for application logging, consider reviewing log indices for inadvertently captured credentials or sensitive data in log messages.
Security Awareness
- Consider incorporating Elasticsearch security configuration into existing infrastructure security training programs, emphasizing that default credentials must be changed on initial deployment.
- Consider raising awareness among development teams that storing secrets in Elasticsearch indices creates a credential exposure risk if the cluster is compromised or misconfigured.
- If applicable to your team structure, consider training infrastructure and DevOps teams on enabling and configuring X-Pack security during initial Elasticsearch deployment rather than as a post-deployment afterthought.
MITRE ATT&CK Mapping
Reconnaissance
Privilege Escalation
Credential Access
Discovery
Collection
Additional IOCs
- File Paths:
/usr/share/elasticsearch/repo- Snapshot repository path observed in lab environment; if configured on production clusters, CVE-2015-5531 directory traversal becomes viable/tmp- Secondary snapshot repository path observed in lab environment; presence enables certain file-read exploitation techniques
- Command Lines:
- Purpose: Fingerprint Elasticsearch cluster version, build type, node roles, OS, and JVM version from root endpoint | Tools:
raven-es| Stage: Reconnaissance |raven-es --quiet -t <target> fingerprint - Purpose: Perform full deep reconnaissance of cluster internals including topology, settings, shard allocation, and filesystem paths | Tools:
raven-es| Stage: Reconnaissance |raven-es --quiet -t <target> recon --full - Purpose: Test for anonymous/unauthenticated access to critical Elasticsearch API endpoints | Tools:
raven-es| Stage: Initial Access |raven-es --quiet -t <target> anonymous - Purpose: Enumerate all non-system indices with health status and optional field mappings | Tools:
raven-es| Stage: Discovery |raven-es --quiet -t <target> indices --mappings - Purpose: Automated secret detection across all indices using curated regex patterns for AWS keys, private keys, bearer tokens, and other credential formats | Tools:
raven-es| Stage: Credential Access |raven-es --quiet -t <target> search --grep-secrets - Purpose: Brute force Elasticsearch authentication using a default credentials list with stop-on-success to minimize log noise | Tools:
raven-es| Stage: Initial Access - Purpose: Password spraying mode testing one password against many user accounts with configurable delay to evade rate limiting | Tools:
raven-es| Stage: Initial Access - Purpose: Privilege escalation analysis mapping current user permissions, roles, API key creation ability, and escalation paths | Tools:
raven-es| Stage: Privilege Escalation |raven-es --quiet -t <target> privesc --analyze -u <user> -P <pass> - Purpose: Enumerate role mappings to identify hidden privilege escalation paths through metadata-based or realm-based role assignment rules | Tools:
raven-es| Stage: Privilege Escalation |raven-es --quiet -t <target> privesc --role-mappings -u <user> -P <pass> - Purpose: Run all RAVEN modules in a single chained scan covering fingerprinting, recon, indices, search, anonymous access, and credential testing | Tools:
raven-es| Stage: Full Assessment |raven-es --quiet -t <target> all -u <user> -P <pass>
- Purpose: Fingerprint Elasticsearch cluster version, build type, node roles, OS, and JVM version from root endpoint | Tools: