Common attacks and weaknesses
- Default cassandra/cassandra superuser.
Apache Cassandra native protocol.
The application sends a SQL query to the Cassandra server on port 9042, which returns rows from its tables. Encryption is optional: traffic is only protected if TLS is enabled on the server and the client.
Unofficial use. The IANA assignment below differs from what is usually found on this port in practice.
No entry. The port is free for any application, so check what uses it on your hosts.
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :9042' # process listening on 9042
sudo lsof -nP -i :9042macOS
sudo lsof -nP -i :9042
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 9042 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 9042 netstat -ano | findstr :9042
From another machine
nmap -p 9042 -sV <host> nc -zv <host> 9042
Block it in the firewall
sudo ufw deny 9042/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 9042" -Direction Inbound -LocalPort 9042 -Protocol TCP -Action Block # Windows
Apache Cassandra native protocol.
Port 9042 is registered for TCP.
It is rated 7/10 (high) when exposed to the Internet. Default cassandra/cassandra superuser. Enable authentication, change the default superuser, use client TLS.
On Linux run "ss -ltnup 'sport = :9042'", on macOS "lsof -nP -i :9042", and on Windows "netstat -ano | findstr :9042" to see the local process. From another machine, "nmap -p 9042 <host>" shows whether it is reachable.