2024-02-08 22:20:49 +00:00
# 9042/9160 - Cassandra渗透测试
2022-04-28 16:01:33 +00:00
< details >
2024-02-09 12:48:25 +00:00
< summary > < strong > 从零开始学习AWS黑客技术, 成为专家< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE( HackTricks AWS Red Team Expert) < / strong > < / a > < strong > ! < / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-01-05 23:28:30 +00:00
支持HackTricks的其他方式:
2022-04-28 16:01:33 +00:00
2024-02-08 22:20:49 +00:00
* 如果您想看到您的**公司在HackTricks中做广告**或**下载PDF格式的HackTricks**,请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)
2024-02-09 12:48:25 +00:00
* **加入** 💬 [**Discord群** ](https://discord.gg/hRep4RUj7f ) 或 [**电报群** ](https://t.me/peass ) 或 **关注**我们的**Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/hacktricks_live )**。**
2024-02-08 22:20:49 +00:00
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。
2022-04-28 16:01:33 +00:00
< / details >
2023-08-03 19:12:22 +00:00
## 基本信息
2020-07-15 15:43:14 +00:00
2024-02-08 22:20:49 +00:00
**Apache Cassandra**是一种**高度可扩展**、**高性能**的分布式数据库,旨在处理跨许多**普通服务器**的**大量数据**,提供**高可用性**,没有**单点故障**。它是一种**NoSQL数据库**。
在一些情况下, 您可能会发现Cassandra接受**任何凭据**(因为没有配置任何凭据),这可能会使攻击者能够**枚举**数据库。
2020-07-15 15:43:14 +00:00
2023-08-03 19:12:22 +00:00
**默认端口:** 9042,9160
2021-10-18 11:21:18 +00:00
```
2020-07-15 15:43:14 +00:00
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
```
2023-08-03 19:12:22 +00:00
## 枚举
2024-01-05 23:28:30 +00:00
### 手动
2020-07-15 15:43:14 +00:00
```bash
pip install cqlsh
cqlsh < IP >
#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 < Keyspace_name > #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";
```
2023-08-03 19:12:22 +00:00
### 自动化
2020-07-15 15:43:14 +00:00
2024-02-08 22:20:49 +00:00
这里并没有太多选项, nmap 无法获取太多信息。
2020-07-15 15:43:14 +00:00
```bash
nmap -sV --script cassandra-info -p < PORT > < IP >
```
2023-08-03 19:12:22 +00:00
### [**暴力破解**](../generic-methodologies-and-resources/brute-force.md#cassandra)
2020-07-15 15:43:14 +00:00
2022-05-01 13:25:53 +00:00
### **Shodan**
2020-07-15 15:43:14 +00:00
2021-10-18 11:21:18 +00:00
`port:9160 Cluster` \
2022-04-05 22:24:52 +00:00
`port:9042 "Invalid or unsupported protocol version"`
2022-04-28 16:01:33 +00:00
< details >
2024-02-08 22:20:49 +00:00
< summary > < strong > 从零开始学习AWS黑客技术, 成为专家< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE( HackTricks AWS Red Team Expert) < / strong > < / a > < strong > ! < / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-02-08 22:20:49 +00:00
其他支持HackTricks的方式:
2022-04-28 16:01:33 +00:00
2024-02-08 22:20:49 +00:00
* 如果您想看到您的**公司在HackTricks中做广告**或**下载PDF格式的HackTricks**,请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
2024-02-09 12:48:25 +00:00
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)
* **加入** 💬 [**Discord群组** ](https://discord.gg/hRep4RUj7f ) 或 [**电报群组** ](https://t.me/peass ) 或 **关注**我们的**Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/hacktricks_live )**。**
2024-02-08 22:20:49 +00:00
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。
2022-04-28 16:01:33 +00:00
< / details >