GCP - Filestore Post Exploitation

Tip

Jifunze na ufanye mazoezi ya AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Jifunze na ufanye mazoezi ya GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Jifunze na ufanye mazoezi ya Az Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

Saidia HackTricks

Filestore

Kwa maelezo zaidi kuhusu Filestore angalia:

GCP - Filestore Enum

Mount Filestore

Filesystem iliyoshirikiwa inaweza kuwa na taarifa nyeti zinazovutia kwa mtazamo wa mshambuliaji. Kwa kupata ufikiaji wa Filestore, inawezekana mount it:

Mount Filestore filesystem ```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 ```

Ili kupata anwani ya IP ya filestore instance angalia sehemu ya enumeration ya ukurasa:

GCP - Filestore Enum

Ondoa Vikwazo na upate ruhusa za ziada

Ikiwa mshambuliaji hayupo kwenye anwani ya IP yenye ufikiaji kwenye share, lakini una ruhusa za kutosha za kuibadilisha, inawezekana kuondoa vikwazo au kuongeza ufikiaji. Pia inawezekana kumpa anwani yako ya IP ruhusa za ziada ili kupata ufikiaji wa admin kwenye share:

Sasisha Filestore instance ili kuruhusu ufikiaji ```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>

### Rejesha chelezo

Ikiwa kuna chelezo, inawezekana **kurejesha** kwenye instance iliyopo au kwenye instance mpya ili taarifa zake ziweze kupatikana:

<details>

<summary>Unda instance mpya na rejesha chelezo</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

Tengeneza nakala ya chelezo na uirejeshe

Ikiwa hauna ufikiaji kwa share na hutaki kuibadilisha, inawezekana kutengeneza nakala ya chelezo yake na kuirejesha kama ilivyotajwa hapo awali:

Tengeneza nakala ya chelezo na uirejeshe katika instance mpya ```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]
> Jifunze na ufanye mazoezi ya 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;">\
> Jifunze na ufanye mazoezi ya 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;">\
> Jifunze na ufanye mazoezi ya 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>Saidia HackTricks</summary>
>
> - Angalia the [**subscription plans**](https://github.com/sponsors/carlospolop)!
> - **Jiunge na** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) au the [**telegram group**](https://t.me/peass) au **utufuate** kwenye **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.**
> - **Shiriki hacking tricks kwa kutuma PRs kwa** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
>
> </details>