sudoapt-getupdatesudoapt-getinstallnfs-common# Check the share nameshowmount-e<IP># Mount the sharemkdir/mnt/fssudomount [FILESTORE_IP]:/[FILE_SHARE_NAME] /mnt/fs
要查找 filestore 实例的 IP 地址,请检查页面的枚举部分:
移除限制并获取额外权限
如果攻击者不在具有共享访问权限的 IP 地址上,但您有足够的权限进行修改,则可以移除对其的限制或访问权限。还可以授予您的 IP 地址更多权限,以便对共享拥有管理员访问权限:
gcloudfilestoreinstancesupdatenfstest \--zone=<exact-zone> \--flags-file=nfs.json# Contents of nfs.json{"--file-share":{"capacity":"1024","name":"<share-name>","nfs-export-options": [{"access-mode":"READ_WRITE","ip-ranges": ["<your-ip-private-address>/32"],"squash-mode":"NO_ROOT_SQUASH","anon_uid":1003,"anon_gid":1003}]}}
恢复备份
如果有备份,可以在现有实例或新实例中恢复它,以便其信息变得可访问:
# Create a new filestore if you don't want to modify the old onegcloudfilestoreinstancescreate<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 instancegcloudfilestoreinstancesrestore<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
创建备份并恢复
如果您无法访问共享并且不想修改它,可以创建备份并如前所述恢复它:
# Create share backupgcloudfilestorebackupscreate<back-name> \--region=<region> \--instance=<instance-name> \--instance-zone=<instance-zone> \--file-share=<share-name># Follow the previous section commands to restore it and mount it