GCP - Pub/Sub Enum
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
- Kyk na die subscription plans!
- Sluit aan by die 💬 Discord group of die telegram group of volg ons op Twitter 🐦 @hacktricks_live.
- Deel hacking tricks deur PRs in te dien by die HackTricks en HackTricks Cloud github repos.
Pub/Sub
Google Cloud Pub/Sub word beskryf as ’n diens wat boodskappe tussen onafhanklike toepassings fasiliteer. Die kernkomponente sluit onderwerpe in, waaraan toepassings kan subskrywe. Subskrywer-toepassings het die vermoë om boodskappe te stuur en te ontvang. Elke boodskap bestaan uit die werklike inhoud saam met geassosieerde metadata.
Die onderwerp is die tou waar boodskappe gestuur gaan word, terwyl die subskripsies die objekte is wat gebruikers gaan gebruik om boodskappe in die onderwerpe te verkry. Daar kan meer as 1 subskripsie per onderwerp wees en daar is 4 tipes subskripsies:
- Pull: Die gebruiker(s) van hierdie subskripsie moet boodskappe trek.
- Push: ’n URL-eindpunt word aangedui en boodskappe sal onmiddellik daarheen gestuur word.
- Big query table: Soos push, maar die boodskappe word binne ’n Big query tabel geplaas.
- Cloud Storage: Lewer boodskappe direk aan ’n bestaande emmer.
Deur default verval ’n subskripsie na 31 dae, alhoewel dit gestel kan word om nooit te verval nie.
Deur default word ’n boodskap vir 7 dae behou, maar hierdie tyd kan verhoog word tot 31 dae. Ook, as dit nie ACKed in 10s is nie, gaan dit terug na die tou. Dit kan ook gestel word dat ACKed boodskappe voortgaan om gestoor te word.
’n Onderwerp is standaard versleuteld met ’n Google bestuurde versleuteling sleutel. Maar ’n CMEK (Kliënt Bestuurde Versleuteling Sleutel) van KMS kan ook gekies word.
Dead letter: Subskripsies kan ’n maksimum aantal afleweringspogings konfigureer. Wanneer ’n boodskap nie afgelewer kan word nie, word dit heruitgegee na die gespesifiseerde dead letter onderwerp.
Snapshots & Schemas
’n Snapshot is ’n kenmerk wat die toestand van ’n subskripsie op ’n spesifieke tydstip vasvang. Dit is essensieel ’n konsekwente rugsteun van die nie-erkende boodskappe in ’n subskripsie. Deur ’n snapshot te skep, bewaar jy die boodskap erkenningstoestand van die subskripsie, wat jou toelaat om boodskapverbruik voort te sit vanaf die punt waar die snapshot geneem is, selfs nadat die oorspronklike boodskappe andersins sou gewees het.
As jy baie gelukkig is, kan ’n snapshot ou sensitiewe inligting bevat van toe die snapshot geneem is.
Wanneer jy ’n onderwerp skep, kan jy aandui dat die onderwerp boodskappe ’n skema moet volg.
Enumeration
# Get a list of topics in the project
gcloud pubsub topics list
gcloud pubsub topics describe <topic>
gcloud pubsub topics list-subscriptions <topic>
gcloud pubsub topics get-iam-policy <topic>
# Get a list of subscriptions across all topics
gcloud pubsub subscriptions list
gcloud pubsub subscriptions describe <subscription>
gcloud pubsub subscriptions get-iam-policy <subscription>
# Get list of schemas
gcloud pubsub schemas list
gcloud pubsub schemas describe <schema>
gcloud pubsub schemas list-revisions <schema>
# Get list of snapshots
gcloud pubsub snapshots list
gcloud pubsub snapshots describe <snapshot>
However, you may have better results om ’n groter stel data te vra, including older messages. This has some prerequisites and could impact applications, so make sure you really know what you’re doing.
Privilege Escalation & Post Exploitation
GCP - Pub/Sub Post Exploitation
Pub/Sub Lite
Pub/Sub Lite is a messaging service with zonal storage. Pub/Sub Lite kos ’n fraksie van Pub/Sub en is bedoel vir hoë volume streaming (tot 10 miljoen boodskappe per sekonde) pipelines en gebeurtenisgedrewe stelsels waar lae koste die primêre oorweging is.
In PubSub Lite there are topics and subscriptions, there aren’t snapshots and schemas and there are:
- Reservations: Pub/Sub Lite Reservations is a feature that allows users to reserve capacity in a specific region for their message streams.
- Operations: Refers to the actions and tasks involved in managing and administering Pub/Sub Lite.
Enumeration
# lite-topics
gcloud pubsub lite-topics list
gcloud pubsub lite-topics describe <topic>
gcloud pubsub lite-topics list-subscriptions <topic>
# lite-subscriptions
gcloud pubsub lite-subscriptions list
gcloud pubsub lite-subscriptions describe <subscription>
# lite-reservations
gcloud pubsub lite-reservations list
gcloud pubsub lite-reservations describe <topic>
gcloud pubsub lite-reservations list-topics <topic>
# lite-operations
gcloud pubsub lite-operations list
gcloud pubsub lite-operations describe <topic>
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
- Kyk na die subscription plans!
- Sluit aan by die 💬 Discord group of die telegram group of volg ons op Twitter 🐦 @hacktricks_live.
- Deel hacking tricks deur PRs in te dien by die HackTricks en HackTricks Cloud github repos.
HackTricks Cloud

