GCP - Filestore Post Exploitation

Tip

AWS 해킹 배우기 및 연습하기:HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기: HackTricks Training GCP Red Team Expert (GRTE) Azure 해킹 배우기 및 연습하기: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks 지원하기

Filestore

Filestore에 대한 자세한 정보는 다음을 확인하세요:

GCP - Filestore Enum

Filestore 마운트

공유 파일시스템은 attackers의 관점에서 흥미로운 민감한 정보를 포함하고 있을 수 있습니다. Filestore에 접근할 수 있다면 이를 마운트할 수 있습니다:

Filestore 파일시스템 마운트 ```bash sudo apt-get update sudo apt-get install nfs-common # Check the share name showmount -e # Mount the share mkdir /mnt/fs sudo mount [FILESTORE_IP]:/[FILE_SHARE_NAME] /mnt/fs ```

Filestore 인스턴스의 IP 주소를 찾으려면 페이지의 enumeration 섹션을 확인하세요:

GCP - Filestore Enum

제한 제거 및 추가 권한 획득

공격자가 해당 공유에 접근 가능한 IP에 있지 않지만, 이를 수정할 충분한 권한이 있다면 제한을 제거하거나 접근을 허용할 수 있습니다. 또한 자신의 IP에 대해 더 많은 권한을 부여하여 공유에 대한 관리자 접근을 얻을 수도 있습니다:

Filestore 인스턴스를 업데이트하여 접근 허용 ```bash gcloud filestore instances update nfstest \ --zone= \ --flags-file=nfs.json

Contents of nfs.json

{ “–file-share”: { “capacity”: “1024”, “name”: “”, “nfs-export-options”: [ { “access-mode”: “READ_WRITE”, “ip-ranges”: [ “/32” ], “squash-mode”: “NO_ROOT_SQUASH”, “anon_uid”: 1003, “anon_gid”: 1003 } ] } }

</details>

### 백업 복원

백업이 있을 경우 기존 인스턴스나 새 인스턴스에 **복원**하여 해당 **정보에 접근할 수 있습니다:**

<details>

<summary>새 인스턴스 생성 및 백업 복원</summary>
```bash
# Create a new filestore if you don't want to modify the old one
gcloud filestore instances create <new-instance-name> \
--zone=<zone> \
--tier=STANDARD \
--file-share=name=vol1,capacity=1TB \
--network=name=default,reserved-ip-range=10.0.0.0/29

# Restore a backups in a new instance
gcloud filestore instances restore <new-instance-name> \
--zone=<zone> \
--file-share=<instance-file-share-name> \
--source-backup=<backup-name> \
--source-backup-region=<backup-region>

# Follow the previous section commands to mount it

backup을 생성하고 restore하세요

만약 share에 접근 권한이 없고 변경을 원하지 않는다면, 해당 share의 backup을 생성한 후 앞서 언급한 것처럼 restore할 수 있습니다:

새 instance에서 backup 생성 및 restore ```bash # Create share backup gcloud filestore backups create \ --region= \ --instance= \ --instance-zone= \ --file-share=

Follow the previous section commands to restore it and mount it

</details>

> [!TIP]
> AWS 해킹 배우기 및 연습하기:<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> GCP 해킹 배우기 및 연습하기: <img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)<img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">
> Azure 해킹 배우기 및 연습하기: <img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training Azure Red Team Expert (AzRTE)**](https://training.hacktricks.xyz/courses/azrte)<img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">
>
> <details>
>
> <summary>HackTricks 지원하기</summary>
>
> - [**구독 계획**](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을 제출하여 해킹 트릭을 공유하세요.**
>
> </details>