# 9042/9160 - Pentesting Cassandra {% hint style="success" %} Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks * Check the [**subscription plans**](https://github.com/sponsors/carlospolop)! * **Join the** ๐Ÿ’ฌ [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** ๐Ÿฆ [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.** * **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
{% endhint %} ## Basic Information **Apache Cassandra**๋Š” **๊ณ ๋„๋กœ ํ™•์žฅ ๊ฐ€๋Šฅ**ํ•˜๊ณ , **๊ณ ์„ฑ๋Šฅ**์˜ ๋ถ„์‚ฐ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋กœ, ๋งŽ์€ **์ƒ์šฉ ์„œ๋ฒ„**์— ๊ฑธ์ณ **๋Œ€๋Ÿ‰์˜ ๋ฐ์ดํ„ฐ**๋ฅผ ์ฒ˜๋ฆฌํ•˜๋„๋ก ์„ค๊ณ„๋˜์—ˆ์œผ๋ฉฐ, **๋‹จ์ผ ์‹คํŒจ ์ง€์ ** ์—†์ด **๋†’์€ ๊ฐ€์šฉ์„ฑ**์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” **NoSQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค**์˜ ์ผ์ข…์ž…๋‹ˆ๋‹ค. ์—ฌ๋Ÿฌ ๊ฒฝ์šฐ์— Cassandra๊ฐ€ **๊ตฌ์„ฑ๋œ ์ž๊ฒฉ ์ฆ๋ช…**์ด ์—†๊ธฐ ๋•Œ๋ฌธ์— **๋ชจ๋“  ์ž๊ฒฉ ์ฆ๋ช…**์„ ์ˆ˜์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ด๋Š” ๊ณต๊ฒฉ์ž๊ฐ€ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ **์—ด๊ฑฐ**ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. **๊ธฐ๋ณธ ํฌํŠธ:** 9042,9160 ``` PORT STATE SERVICE REASON 9042/tcp open cassandra-native Apache Cassandra 3.10 or later (native protocol versions 3/v3, 4/v4, 5/v5-beta) 9160/tcp open cassandra syn-ack ``` ## Enumeration ### Manual ```bash pip install cqlsh cqlsh #Basic info enumeration SELECT cluster_name, thrift_version, data_center, partitioner, native_protocol_version, rack, release_version from system.local; #Keyspace enumeration SELECT keyspace_name FROM system.schema_keyspaces; desc #Decribe that DB desc system_auth #Describe the DB called system_auth SELECT * from system_auth.roles; #Retreive that info, can contain credential hashes SELECT * from logdb.user_auth; #Can contain credential hashes SELECT * from logdb.user; SELECT * from configuration."config"; ``` ### ์ž๋™ํ™”๋œ ์—ฌ๊ธฐ์—๋Š” ๋งŽ์€ ์˜ต์…˜์ด ์—†์œผ๋ฉฐ nmap์€ ๋งŽ์€ ์ •๋ณด๋ฅผ ์–ป์ง€ ๋ชปํ•ฉ๋‹ˆ๋‹ค. ```bash nmap -sV --script cassandra-info -p ``` ### [**Brute force**](../generic-methodologies-and-resources/brute-force.md#cassandra) ### **Shodan** `port:9160 Cluster`\ `port:9042 "Invalid or unsupported protocol version"` {% hint style="success" %} AWS ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ GCP ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
HackTricks ์ง€์›ํ•˜๊ธฐ * [**๊ตฌ๋… ๊ณ„ํš**](https://github.com/sponsors/carlospolop) ํ™•์ธํ•˜๊ธฐ! * **๐Ÿ’ฌ [**Discord ๊ทธ๋ฃน**](https://discord.gg/hRep4RUj7f) ๋˜๋Š” [**ํ…”๋ ˆ๊ทธ๋žจ ๊ทธ๋ฃน**](https://t.me/peass)์— ์ฐธ์—ฌํ•˜๊ฑฐ๋‚˜ **Twitter** ๐Ÿฆ [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**๋ฅผ ํŒ”๋กœ์šฐํ•˜์„ธ์š”.** * **[**HackTricks**](https://github.com/carlospolop/hacktricks) ๋ฐ [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) ๊นƒํ—ˆ๋ธŒ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์— PR์„ ์ œ์ถœํ•˜์—ฌ ํ•ดํ‚น ํŒ์„ ๊ณต์œ ํ•˜์„ธ์š”.**
{% endhint %}