GCP - App Engine Enum
Tip
学习并练习 AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
学习并练习 GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
学习并练习 Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
支持 HackTricks
- 查看 subscription plans!
- 加入 💬 Discord group 或者 telegram group 或 关注 我们的 Twitter 🐦 @hacktricks_live.
- 通过向 HackTricks 和 HackTricks Cloud github 仓库 提交 PRs 来分享 hacking tricks。
基本信息
Google Cloud Platform的 (GCP) App Engine 是一个 强大、无服务器的平台,专为大规模开发和托管Web应用程序而设计。该平台的设计旨在简化开发过程并增强应用程序的可管理性。GCP的App Engine的主要特点和优势包括:
- 无服务器架构:App Engine自动处理基础设施,包括服务器配置、配置和扩展。这使开发人员能够专注于编写代码,而无需担心底层硬件。
- 自动扩展:App Engine可以根据接收到的流量自动扩展您的应用程序。它在流量增加时扩展以处理增加的流量,并在流量减少时缩减,帮助优化成本和性能。
- 语言和运行时支持:它支持流行的编程语言,如Java、Python、Node.js、Go、Ruby、PHP和.NET。您可以在标准或灵活环境中运行应用程序。标准环境更具限制性,但针对特定语言进行了高度优化,而灵活环境允许更多自定义。
- 集成服务:App Engine与许多其他GCP服务集成,如Cloud SQL、Cloud Storage、Cloud Datastore等。这种集成简化了基于云的应用程序的架构。
- 版本控制和流量分配:您可以轻松部署多个版本的应用程序,然后在它们之间分配流量以进行A/B测试或逐步推出。
- 应用程序洞察:App Engine提供内置服务,如日志记录、用户身份验证和一套用于监控和管理应用程序的开发工具。
- 安全性:它提供内置安全功能,如应用程序版本控制、用于安全连接的SSL/TLS证书以及身份和访问管理。
防火墙
可以为运行应用程序的实例配置一个简单的 防火墙,选项如下:
.png)
SA
这些应用程序使用的默认服务帐户是 <proj-name>@appspot.gserviceaccount.com,该帐户在项目上具有 编辑者 角色,并且APP Engine实例中的服务帐户 以cloud-platform范围(以及其他范围)运行。
存储
源代码和元数据 自动存储在名为 <proj-id>.appspot.com 和 staging.<proj-id>.appspot.com 以及 <country>.<proj-id>.appspot.com 的存储桶中。
每个文件 的应用程序都以 内容的sha1作为文件名 存储:
.png)
在 staging.<proj-id>.appspot.com 的 ae 文件夹中,每个版本都有一个文件夹,其中包含 源代码 文件和 manifest.json 文件,该文件 描述了应用程序的组件:
{"requirements.txt":{"sourceUrl":"https://storage.googleapis.com/staging.onboarding-host-98efbf97812843.appspot.com/a270eedcbe2672c841251022b7105d340129d108","sha1Sum":"a270eedc_be2672c8_41251022_b7105d34_0129d108"},"main_test.py":{"sourceUrl":"https://storage.googleapis.com/staging.onboarding-host-98efbf97812843.appspot.com/0ca32fd70c953af94d02d8a36679153881943f32","sha1Sum":"0ca32fd7_0c953af9_4d02d8a ...
容器
网络应用程序最终将在 容器内执行,并使用 Code Build 来构建容器。
URLs & 区域
默认网页将暴露在 URL <project-uniq-name>.appspot.com,尽管旧版本的 URL 会略有不同,例如 https://20240117t001540-dot-<project-uniq-name>.uc.r.appspot.com(注意初始时间戳)。
看起来每个区域只能部署 1 个应用引擎网络应用程序,但可以在 app.yml 中指示 service: <servicename> 并创建一个新服务(一个新网页)。此新网页的 URL 格式将为 <servicename>-dot-<project-uniq-name>.appspot.com。
枚举
Caution
每次您向应用程序上传新代码时,都会创建一个新版本。所有版本都被存储,并且它们甚至有一个 访问它们的 URL。因此,修改旧版本的代码可能是一个 很好的持久性技术。
与 Cloud Functions 一样,应用程序可能依赖于在运行时通过环境变量访问的秘密。这些变量存储在 app.yaml 文件中,可以通过以下方式访问:
# List the apps
gcloud app services list
gcloud app services describe <app-name>
# Access via browser to the specified app
gcloud app services browse <app-name>
# Get App versions
gcloud app versions list
# Get all the info of the app and version, included specific verion URL and the env
gcloud app versions describe -s <app-name> <version-id>
# Logs
gcloud app logs tail -s <app-name>
# Instances
## This is only valid if a flexible environment is used and not a standard one
gcloud app instances list
gcloud app instances describe -s <app-name> --version <version-id> <ID>
## Connect to the instance via ssh
gcloud app instances ssh --service <app-name> --version <version-id> <ID>
# Firewalls
gcloud app firewall-rules list
gcloud app firewall-rules describe <num_fw>
# Get domains
gcloud app domain-mappings list
gcloud app domain-mappings describe <name>
# SSl certificates
gcloud app ssl-certificates list
gcloud app ssl-certificates describe <name>
权限提升
未认证枚举
GCP - App Engine Unauthenticated Enum
后期利用
GCP - App Engine Post Exploitation
持久性
Tip
学习并练习 AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
学习并练习 GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
学习并练习 Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
支持 HackTricks
- 查看 subscription plans!
- 加入 💬 Discord group 或者 telegram group 或 关注 我们的 Twitter 🐦 @hacktricks_live.
- 通过向 HackTricks 和 HackTricks Cloud github 仓库 提交 PRs 来分享 hacking tricks。
HackTricks Cloud

