OWASP/wrongsecrets

GitHub: OWASP/wrongsecrets

一个故意包含密钥管理漏洞的示例应用,用于训练识别与修复错误的密钥使用方式。

Stars: 1425 | Forks: 549

# OWASP WrongSecrets [![Tweet](https://img.shields.io/badge/-Twitter-%232B90D9?style=for-the-badge&logo=x&logoColor=white)](https://twitter.com/intent/tweet?text=Want%20to%20dive%20into%20secrets%20management%20and%20do%20some%20hunting?%20try%20this&url=https://github.com/OWASP/wrongsecrets&hashtags=secretsmanagement,secrets,hunting,p0wnableapp,OWASP,WrongSecrets) [](https://tootpick.org/#text=Want%20to%20dive%20into%20secrets%20management%20and%20do%20some%20hunting?%20try%20this%0A%0Ahttps://github.com/OWASP/wrongsecrets%20%23secretsmanagement,%20%23secrets,%20%23hunting,%20%23p0wnableapp,%20%23OWASP,%20%23WrongSecrets) [](https://bsky.app/intent/compose?text=Want%20to%20dive%20into%20secrets%20management%20and%20do%20some%20hunting?%20try%20this%0A%0Ahttps://github.com/OWASP/wrongsecrets%20%23secretsmanagement%20%23secrets%20%23hunting%20%23p0wnableapp%20%23OWASP%20%23WrongSecrets) [](https://www.linkedin.com/shareArticle/?url=https://www.github.com/OWASP/wrongsecrets&title=OWASP%20WrongSecrets) [![Java checkstyle and testing](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/2a7760ad8e160859.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/main.yml) [![Pre-commit](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/0c49ce5182160900.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/pre-commit.yml) [![Terraform FMT](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/56382d3b28160901.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/terraform.yml) [![CodeQL](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/cd5d028851160902.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/codeql-analysis.yml) [![Dead Link Checker](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/c5159d80f0160904.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/link_checker.yml) [![Javadoc and Swaggerdoc generator](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/259fa5c449160905.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/java_swagger_doc.yml) [![Test Heroku with cypress](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/303922306b160906.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/heroku_tests.yml) [![Test minikube script (k8s)](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/a788d9b455160908.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/minikube-k8s-test.yml) [![Test minikube script (k8s&vault)](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/9fc39606ba160909.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/minikube-vault-test.yml) [![Docker container test](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/fff2e363b8160910.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/container_test.yml) [![Test container on podman](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/4c25f53acf160911.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/container-alts-test.yml) [![DAST with ZAP](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/1bd8b12442160913.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/dast-zap-test.yml) [![PR Preview and Visual Diff](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/c956afec48160914.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/pr-preview.yml) [![Build Preview](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/564b3b608f160915.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/build-preview.yml) [![Visual Diff](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/6a4afa5aee160917.svg)](https://github.com/OWASP/wrongsecrets/actions/workflows/visual-diff.yml) [![OWASP Production Project](https://img.shields.io/badge/OWASP-production%20project-48A646.svg)](https://owasp.org/projects/) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7024/badge)](https://bestpractices.coreinfrastructure.org/projects/7024) [![Discussions](https://img.shields.io/github/discussions/OWASP/wrongsecrets)](https://github.com/OWASP/wrongsecrets/discussions) [![Docker pulls](https://img.shields.io/docker/pulls/jeroenwillemsen/wrongsecrets.svg)](https://hub.docker.com/r/jeroenwillemsen/wrongsecrets) 欢迎来到 OWASP WrongSecrets 游戏!游戏中充满了现实生活中**错误的** secrets 管理示例。每一个示例都被封装成一个挑战,你需要使用各种工具和技术来解决这些挑战。通过解决这些挑战,你将能够识别常见的错误,并反思自己的 secrets 管理策略。 你能解决全部 62 个挑战吗? 不妨先尝试[我们的 Heroku 演示环境](https://wrongsecrets.herokuapp.com/)。 想要体验其他挑战?请阅读下面的设置说明。 ## 🚀 快速开始 **新入 WrongSecrets?从这里开始:** 1. **先试用在线版**:访问我们的 [Heroku 演示](https://wrongsecrets.herokuapp.com/) 熟悉挑战 2. **本地运行**:使用 Docker 体验完整版(含所有挑战): docker run -p 8080:8080 -p 8090:8090 jeroenwillemsen/wrongsecrets:latest-no-vault 然后打开 [http://localhost:8080](http://localhost:8080) 3. **想提前看看?** 试试我们的 bleeding-edge 主干容器(可能不稳定): docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-master:latest-master ⚠️ *注意:这是开发版本,可能不稳定* 4. **高级设置**:如需在云环境和 Kubernetes 中运行,请参考下方详细说明 **你将学到:** - 常见的 secrets 管理错误 - 如何识别暴露的凭证 - 保护 secrets 的最佳实践 - 检测 secrets 的工具与技术 **它是如何工作的:** 本仓库包含**故意设计为易受攻击的代码和配置文件**,其中隐藏了真实与伪造的 secrets。你需要检查源代码、配置文件、Docker 容器和云部署来发现这些 secrets。每个挑战都教你 secrets 在现实应用中可能以何种方式被意外泄露。 ![screenshotOfChallenge1](/images/screenshot.png) ## 📋 先决条件 **基础使用:** - 一个网页浏览器 - Docker(用于本地搭建)-[安装指南](https://docs.docker.com/get-docker/) **高级设置:** - Kubernetes/Minikube-[安装指南](https://minikube.sigs.k8s.io/docs/start/) - 云账户(AWS/GCP/Azure)用于云挑战 - 命令行基础 ## 目录 ### 🎯 入门 - [快速开始](#-quick-start) - [先决条件](#-prerequisites) - [支持](#support) ### 🐳 部署选项 - [基础 Docker 练习](#basic-docker-exercises) - [在 Heroku 上运行](#running-these-on-heroku) - [在 Render.io 上运行](#running-these-on-renderio) - [在 Railway 上运行](#running-these-on-railway) - [基础 Kubernetes 练习](#basic-k8s-exercise) - [基于 Minikube 的练习](#minikube-based) - [基于 Kubernetes 的练习](#k8s-based) - [使用 Minikube 的 Vault 练习](#vault-exercises-with-minikube) ### ☁️ 云挑战 - [云挑战](#cloud-challenges) - [在 AWS 上运行 WrongSecrets](#running-wrongsecrets-in-aws) - [在 GCP 上运行 WrongSecrets](#running-wrongsecrets-in-gcp) - [在 Azure 上运行 WrongSecrets](#running-wrongsecrets-in-azure) - [仅在自己的云环境中运行 Challenge 15](#running-challenge15-in-your-own-cloud-only) ### 🎮 高级用法 - [是否想无指引地游玩?](#do-you-want-to-play-without-guidance-or-spoils) - [CTF](#ctf) - [CTFD 支持](#ctfd-support) - [FBCTF](#fbctf-support-experimental) - [将 OWASP WrongSecrets 用作 secret 检测基准](#use-owasp-wrongsecrets-as-a-secret-detection-benchmark) ### 👨‍💻 开发与贡献 - [开发注意事项](#notes-on-development) - [Spring Boot 4 迁移检查清单](docs/SPRING_BOOT_4_ADOPTION_CHECKLIST.md) - [依赖管理](#dependency-management) - [在 IntelliJ IDEA 中启动项目](#get-the-project-started-in-intellij-idea) - [开发期间自动重载](#automatic-reload-during-development) - [如何添加一个挑战](#how-to-add-a-challenge) - [本地测试](#local-testing) - [本地自动化测试](#Local-automated-testing) - [是否想在自有发行版中禁用某些挑战?](#want-to-disable-challenges-in-your-own-release) ### 📚 资源与社区 ## 支持 版权 © 2020-2025 Jeroen Willemsen 及 WrongSecrets 贡献者。 ## 🛤️ 选择你的路径 不确定哪种方式适合你?以下快速指南: | **我想…** | **推荐方案** | **可用挑战** | |----------|------------|------------| | 快速试用 | [Heroku 容器](https://www.wrongsecrets.com/) | 基础挑战(0-4、8、12-32、34-43、49-52、54-61) | | 本地运行 | [基础 Docker](#basic-docker-exercises) | 同上,但在本地机器上运行 | | 学习 Kubernetes secrets | [K8s/Minikube 设置](#basic-k8s-exercise) | Kubernetes 挑战(0-6、8、12-43、48-61) | | 练习云上 secrets | [云挑战](#cloud-challenges) | 全部挑战(0-61) | | 举办 CTF/工作坊 | [CTF 设置](#ctf) | 可定制挑战集 | | 贡献项目 | [开发设置](#notes-on-development) | 全部挑战 + 开发工具 | ## 基础 Docker 练习 _适用于挑战 0-4、8、12-32、34-43、49-52、54-61_ 进行基础 Docker 练习目前需要: - Docker [从这里安装](https://docs.docker.com/get-docker/) - 一个可以渲染 HTML 的浏览器 你可以通过以下命令安装: ``` docker run -p 8080:8080 -p 8090:8090 jeroenwillemsen/wrongsecrets:latest-no-vault ``` 如果你想看看下一个版本的内容,可以使用我们自动构建的 master 容器: ``` docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-master:latest-master ``` ⚠️ **警告**:这是从最新主干分支构建的开发版本,可能包含实验性功能或不稳定。 **📝 端口说明:** - 端口 **8080**:主应用(挑战 0-62) - 端口 **8090**:MCP 服务器(挑战 60 需要) **📝 挑战 62(Google Drive MCP)说明:** 挑战 62 需要配置 Google Service Account 才能完整运行。请参考 [docs/CHALLENGE62_GOOGLE_DRIVE_SETUP.md](docs/CHALLENGE62_GOOGLE_DRIVE_SETUP.md) 获取设置说明。未配置时,挑战会显示占位信息。 现在你可以通过以下链接开始寻找 secrets:
所有 Docker 挑战链接(点击展开)。 - [localhost:8080/challenge/challenge-0](http://localhost:8080/challenge/challenge-0) - [localhost:8080/challenge/challenge-1](http://localhost:8080/challenge/challenge-1) - [localhost:8080/challenge/challenge-2](http://localhost:8080/challenge/challenge-2) - [localhost:8080/challenge/challenge-3](http://localhost:8080/challenge/challenge-3) - [localhost:8080/challenge/challenge-4](http://localhost:8080/challenge/challenge-4) - [localhost:8080/challenge/challenge-8](http://localhost:8080/challenge/challenge-8) - [localhost:8080/challenge/challenge-12](http://localhost:8080/challenge/challenge-12) - [localhost:8080/challenge/challenge-13](http://localhost:8080/challenge/challenge-13) - [localhost:8080/challenge/challenge-14](http://localhost:8080/challenge/challenge-14) - [localhost:8080/challenge/challenge-15](http://localhost:8080/challenge/challenge-15) - [localhost:8080/challenge/challenge-16](http://localhost:8080/challenge/challenge-16) - [localhost:8080/challenge/challenge-17](http://localhost:8080/challenge/challenge-17) - [localhost:8080/challenge/challenge-18](http://localhost:8080/challenge/challenge-18) - [localhost:8080/challenge/challenge-19](http://localhost:8080/challenge/challenge-19) - [localhost:8080/challenge/challenge-20](http://localhost:8080/challenge/challenge-20) - [localhost:8080/challenge/challenge-21](http://localhost:8080/challenge/challenge-21) - [localhost:8080/challenge/challenge-22](http://localhost:8080/challenge/challenge-22) - [localhost:8080/challenge/challenge-23](http://localhost:8080/challenge/challenge-23) - [localhost:8080/challenge/challenge-24](http://localhost:8080/challenge/challenge-24) - [localhost:8080/challenge/challenge-26](http://localhost:8080/challenge/challenge-25) - [localhost:8080/challenge/challenge-27](http://localhost:8080/challenge/challenge-27) - [localhost:8080/challenge/challenge-28](http://localhost:8080/challenge/challenge-28) - [localhost:8080/challenge/challenge-29](http://localhost:8080/challenge/challenge-29) - [localhost:8080/challenge/challenge-30](http://localhost:8080/challenge/challenge-30) - [localhost:8080/challenge/challenge-31](http://localhost:8080/challenge/challenge-31) - [localhost:8080/challenge/challenge-32](http://localhost:8080/challenge/challenge-32) - [localhost:8080/challenge/challenge-34](http://localhost:8080/challenge/challenge-34) - [localhost:8080/challenge/challenge-35](http://localhost:8080/challenge/challenge-35) - [localhost:8080/challenge/challenge-36](http://localhost:8080/challenge/challenge-36) - [localhost:8080/challenge/challenge-37](http://localhost:8080/challenge/challenge-37) - [localhost:8080/challenge/challenge-38](http://localhost:8080/challenge/challenge-38) - [localhost:8080/challenge/challenge-39](http://localhost:8080/challenge/challenge-39) - [localhost:8080/challenge/challenge-40](http://localhost:8080/challenge/challenge-40) - [localhost:8080/challenge/challenge-41](http://localhost:8080/challenge/challenge-41) - [localhost:8080/challenge/challenge-42](http://localhost:8080/challenge/challenge-42) - [localhost:8080/challenge/challenge-43](http://localhost:8080/challenge/challenge-43) - [localhost:8080/challenge/challenge-49](http://localhost:8080/challenge/challenge-49) - [localhost:8080/challenge/challenge-50](http://localhost:8080/challenge/challenge-50) - [localhost:8080/challenge/challenge-51](http://localhost:8080/challenge/challenge-51) - [localhost:8080/challenge/challenge-52](http://localhost:8080/challenge/challenge-52) - [localhost:8080/challenge/challenge-54](http://localhost:8080/challenge/challenge-54) - [localhost:8080/challenge/challenge-55](http://localhost:8080/challenge/challenge-55) - [localhost:8080/challenge/challenge-56](http://localhost:8080/challenge/challenge-56) - [localhost:8080/challenge/challenge-57](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/303922306b160906.svg) - [localhost:8080/challenge/challenge-58](http://localhost:8080/challenge/challenge-58) - [localhost:8080/challenge/challenge-59](http://localhost:8080/challenge/challenge-59) - [localhost:8080/challenge/challenge-60](http://localhost:8080/challenge/challenge-60) - [localhost:8080/challenge/challenge-61](http://localhost:8080/challenge/challenge-61) - [localhost:8080/challenge/challenge-62](http://localhost:8080/challenge/challenge-62)
请注意,这些挑战仍属初级阶段,解释说明也较为简单。欢迎通过 PR 改进内容 😄。 ### 在 Heroku 上运行 你也可以在 [https://wrongsecrets.herokuapp.com/](https://wrongsecrets.herokuapp.com/) 测试!Heroku 提供了开源支持包,让我们能够免费运行该应用。 使用 [这个链接](https://wrongsecrets.herokuapp.com/) 访问我们托管的版本。如果想自行部署到 Heroku(例如用于培训),可以点击 [这个链接](https://heroku.com/deploy?template=https://github.com/OWASP/wrongsecrets/tree/master)。请注意,这会产生费用,且本项目及维护者不对此负责。 ### 在 Render.io 上运行 *状态:实验性* 你可以在 [https://wrongsecrets.onrender.com/](https://wrongsecrets.onrender.com/) 测试。请注意我们运行在免费层级,无法提供任何保证。请勿滥用或尝试破坏它,这样会妨碍他人体验。 想自己在 Render 上部署?点击下方按钮: ### 在 Railway 上运行 *状态:由 alphasec.io 维护* ## 基础 Kubernetes 练习 _适用于挑战 0-6、8、12-43、48-62_ ### Minikube 方式 确保已安装以下工具: - Docker [从这里安装](https://docs.docker.com/get-docker/) - Minikube [从这里安装](https://minikube.sigs.k8s.io/docs/start/) K8S 环境基于 Minikube。你可以在项目根目录使用以下命令: ``` minikube start kubectl apply -f k8s/secrets-config.yml kubectl apply -f k8s/secrets-secret.yml kubectl apply -f k8s/challenge33.yml kubectl apply -f k8s/challenge53/secret-challenge53.yml echo "Setting up the bitnami sealed secret controler" kubectl apply -f https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.27.0/controller.yaml kubectl apply -f k8s/sealed-secret-controller.yaml kubectl apply -f k8s/main.key kubectl delete pod -n kube-system -l name=sealed-secrets-controller kubectl create -f k8s/sealed-challenge48.json echo "finishing up the sealed secret controler part" wait 10 #or check whether secret48 is there kubectl apply -f k8s/secret-challenge-deployment.yml while [[ $(kubectl get pods -l app=secret-challenge -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for secret-challenge" && sleep 2; done kubectl expose deployment secret-challenge --type=LoadBalancer --port=8080 minikube service secret-challenge ``` 或者: ``` ./k8s-vault-minikube-start.sh ``` 现在你可以通过提供的 IP 和端口进一步操作 K8s 版本(而非 localhost)。 - [localhost:8080/challenge/challenge-5](http://localhost:8080/challenge/challenge-5) - [localhost:8080/challenge/challenge-6](http://localhost:8080/challenge/challenge-6) - [localhost:8080/challenge/challenge-33](http://localhost:8080/challenge/challenge-33) - [localhost:8080/challenge/challenge-48](http://localhost:8080/challenge/challenge-48) - [localhost:8080/challenge/challenge-53](http://localhost:8080/challenge/challenge-53) ### 纯 Kubernetes 方式 想直接在自己的 K8s 上运行?使用以下命令: ``` kubectl apply -f k8s/secrets-config.yml kubectl apply -f k8s/secrets-secret.yml echo "Setting up the bitnami sealed secret controler" kubectl apply -f https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.27.0/controller.yaml kubectl apply -f k8s/sealed-secret-controller.yaml kubectl apply -f k8s/main.key kubectl delete pod -n kube-system -l name=sealed-secrets-controller kubectl create -f k8s/sealed-challenge48.json echo "finishing up the sealed secret controler part" wait 10 #or check whether secret48 is there kubectl apply -f k8s/challenge33.yml kubectl apply -f k8s/secret-challenge-deployment.yml while [[ $(kubectl get pods -l app=secret-challenge -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for secret-challenge" && sleep 2; done kubectl port-forward \ $(kubectl get pod -l app=secret-challenge -o jsonpath="{.items[0].metadata.name}") \ 8080:8080 ``` 现在你可以通过提供的 IP 和端口进一步操作 K8s 版本(而非 localhost)。 - [localhost:8080/challenge/challenge-5](http://localhost:8080/challenge/challenge-5) - [localhost:8080/challenge/challenge-6](http://localhost:8080/challenge/challenge-6) - [localhost:8080/challenge/challenge-33](http://localhost:8080/challenge/challenge-33) - [localhost:8080/challenge/challenge-48](http://localhost:8080/challenge/challenge-48) ## 使用 Minikube 的 Vault 练习 _适用于挑战 0-8、12-61_ 确保已安装: - Minikube(带 Docker) - Docker - Helm [从这里安装](https://helm.sh/docs/intro/install/) - kubectl [从这里安装](https://kubernetes.io/docs/tasks/tools/) - jq [从这里安装](https://stedolan.github.io/jq/download/) - Vault [从这里安装](https://developer.hashicorp.com/vault/install) - grep、Cat 和 Sed 运行 `./k8s-vault-minikube-start.sh`,脚本完成后,挑战将在 等待你。这将允许你运行挑战 0-8、12-61。 运行完 `k8s-vault-minikube-start.sh` 后,若要恢复端口转发,请运行:`k8s-vault-minikube-resume.sh`。 这是因为再次运行启动脚本会替换 Vault 中的密钥,而不会更新 secret-challenge 应用程序中的密钥。 ## 云挑战 _适用于挑战 0-62_ **阅读此部分前请注意:** 由于以下练习包含 IAM 权限提升操作, **永远不要在与生产环境相关或可能影响整体资源的账户上运行这些练习。** ### 在 AWS 上运行 WrongSecrets 请参考 [AWS 子文件夹中的 README](aws/README.md)。 ### 在 GCP 上运行 WrongSecrets 请参考 [GCP 子文件夹中的 README](gcp/README.md)。 ### 在 Azure 上运行 WrongSecrets 请参考 [Azure 子文件夹中的 README](azure/README.md)。 ### 仅在自己的云环境中运行 Challenge 15 如果你想包含自己的 Canarytokens 进行云部署,请执行以下操作: 1. 叉出该项目。 2. 确保使用 [GCP 入口](/gcp/k8s-vault-gcp-ingress-start.sh) 或 [AWS 入口](aws/k8s-aws-alb-script.sh) 脚本生成入口。 3. 前往 [canarytokens.org](https://canarytokens.org/generate) 并选择 `AWS Keys`,在 WebHook URL 字段添加 `/canaries/tokencallback`。 4. 加密收到的凭证,以便 [Challenge15](/src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge15.java) 可以再次解密它们。 5. 提交未加密和加密的内容到 Git,并再次提交(不包含解密内容)。 6. 调整你 fork 中 Challenge 15 的提示,指向你自己的 fork。 7. 创建容器并推送到你的注册表。 8. 覆盖 K8s 定义文件中的 AWS 或 GCP 定义。 ## 是否想无指引游玩或不被剧透? 每个挑战都有“显示提示”按钮和“怎么回事?”按钮。这些按钮可以简化挑战并给出解释。不过,解释可能会破坏你作为黑客的乐趣。 因此,你可以通过覆盖以下环境变量来操作它们: - `hints_enabled=false` 将关闭“显示提示”按钮。 - `reason_enabled=false` 将关闭“怎么回事?”解释按钮。 - `spoiling_enabled=false` 将关闭 `/spoil/challenge-x` 端点(其中 `x` 是挑战的简称)。 ## 启用 Swagger 文档和 UI 你可以通过覆盖 `SPRINGDOC_UI` 和 `SPRINGDOC_DOC` 来启用 Swagger 文档和 Swagger UI。 ## 特别感谢与贡献者 ### 领导者: - [Ben de Haan @bendehaan](https://www.github.com/bendehaan) - [Jeroen Willemsen @commjoen](https://www.github.com/commjoen) ### 顶级贡献者: - [Jannik Hollenbach @J12934](https://www.github.com/J12934) - [Puneeth Y @puneeth072003](https://www.github.com/puneeth072003) - [Joss Sparkes @RemakingEden](https://www.github.com/RemakingEden) ### 贡献者: - [Nanne Baars @nbaars](https://www.github.com/nbaars) - [Marcin Nowak @drnow4u](https://www.github.com/drnow4u) - [Rodolfo Neves @roddas](https://www.github.com/roddas) - [Osama Magdy @osamamagdy](https://www.github.com/osamamagdy) - [Pastekitoo @Pastekitoo](https://www.github.com/Pastekitoo) - [Shubham Patel @Shubham-Patel07](https://www.github.com/Shubham-Patel07) - [za @za](https://www.github.com/za) - [Divyanshu Dev @Novice-expert](https://www.github.com/Novice-expert) - [Tibor Hercz @tiborhercz](https://www.github.com/tiborhercz) - [ Elbring Jr. @neatzsche](https://www.github.com/neatzsche) - [Adarsh A @adarsh-a-tw](https://www.github.com/adarsh-a-tw) - [Diamond Rivero @diamant3](https://www.github.com/diamant3) - [Norbert Wolniak @nwolniak](https://www.github.com/nwolniak) - [Filip Chyla @fchyla](https://www.github.com/fchyla) - [Dmitry Litosh @Dlitosh](https://www.github.com/Dlitosh) - [Vineeth Jagadeesh @djvinnie](https://www.github.com/djvinnie) - [Mahaputra Ilham Awal @mahaputrailhamawal](https://www.github.com/mahaputrailhamawal) - [Turjo Chowdhury @turjoc120](https://www.github.com/turjoc120) - [SndR @SndR85](https://www.github.com/SndR85) - [Josh Grossman @tghosth](https://www.github.com/tghosth) - [alphasec @alphasecio](https://www.github.com/alphasecio) - [CaduRoriz @CaduRoriz](https://www.github.com/CaduRoriz) - [Madhu Akula @madhuakula](https://www.github.com/madhuakula) - [Mike Woudenberg @mikewoudenberg](https://www.github.com/mikewoudenberg) - [Spyros @northdpole](https://www.github.com/northdpole) - [RubenAtBinx @RubenAtBinx](https://www.github.com/RubenAtBinx) - [Alex Bender @alex-bender](https://www.github.com/alex-bender) - [Danny Lloyd @dannylloyd](https://www.github.com/dannylloyd) - [Nicolas Humblot @nhumblot](https://www.github.com/nhumblot) - [Rick M @kingthorin](https://www.github.com/kingthorin) - [Shlomo Zalman Heigh @szh](https://www.github.com/szh) - [Fern @f3rn0s](https://www.github.com/f3rn0s) - [Jeff Tong @Wind010](https://www.github.com/Wind010) ### 测试者: - [Dave van Stein @davevs](https://www.github.com/davevs) - [Marcin Nowak @drnow4u](https://www.github.com/drnow4u) - [Marc Chang Sing Pang @mchangsp](https://www.github.com/mchangsp) - [Vineeth Jagadeesh @djvinnie](https://www.github.com/djvinnie) ### 特别感谢: - [Madhu Akula @madhuakula @madhuakula](https://www.github.com/madhuakula) - [Nanne Baars @nbaars @nbaars](https://www.github.com/nbaars) - [Björn Kimminich @bkimminich](https://www.github.com/bkimminich) - [Dan Gora @devsecops](https://www.github.com/devsecops) - [Xiaolu Dai @saragluna](https://www.github.com/saragluna) - [Jonathan Giles @jonathanGiles](https://www.github.com/jonathanGiles) ### 赞助: [![gitguardian_logo.png](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/fadddc12f8160918.jpg)](https://blog.gitguardian.com/gitguardian-is-proud-sponsor-of-owasp/) [GitGuardian](https://www.gitguardian.com/) 的赞助使我们能够支付云账户的费用。 [![JetBrains logo.](https://www.jetbrains.com/company/brand/img/logo_jb_dos_3.svg)](https://jb.gg/OpenSource) [Jetbrains](https://www.jetbrains.com/) 许可给项目负责人一个 Intellij IDEA Ultimate 实例。没有它我们无法如此快速开发! [![1password_logo.png](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/5a9f22e300160919.png)](https://github.com/1Password/1password-teams-open-source/pull/552) [1Password](https://1password.com/) 授予我们一个开源许可,用于 1Password 作为 secret 检测测试平台。 [![AWS Open Source](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/87bae8ffba160920.png)](https://aws.amazon.com/) [AWS](https://aws.amazon.com/) 授予我们 AWS Open Source 信用额度,用于测试我们的项目以及 Wrongsecrets CTF Party 设置。 ## 寻求帮助 你可以通过以下方式帮助我们: - 点 Star - 分享这个应用给其他人 - 当然,我们非常乐意接受你的帮助 [了解更多贡献方式](https://github.com/OWASP/wrongsecrets/issues/37)。我们欢迎其他云提供商(如 Alibaba 或 Tencent Cloud)的支持!有问题请创建 issue 或发起 PR。查看 [我们的贡献指南](https://github.com/OWASP/wrongsecrets/blob/master/CONTRIBUTING.md) 获取详细信息。 ## 使用 OWASP WrongSecrets 作为 secret 检测基准 由于大量 secret 检测工具正在涌现(针对 Docker 和 Git),我们正在创建一个基准测试平台。 想知道你的工具是否能检测到所有内容?我们将跟踪嵌入在 [此问题](https://github.com/OWASP/wrongsecrets/issues/201) 中的 secrets,并有一个 [分支](https://github.com/OWASP/wrongsecrets/tree/experiment-bed) 用于为你的工具添加额外 secrets。最终,该分支将包含一个用于生成 Docker 容器的脚本,以便最终测试你的容器 secret 扫描。 ### 自动化 Secret 扫描器对比 我们现在提供一个自动化的 GitHub Action 工作流,用于对 WrongSecrets 代码库进行多个 secret 扫描工具的基准测试。该 [Secret Scanner Comparison 流程](/.github/workflows/scanner-comparison.yml) 测试 7 种不同的工具: - **TruffleHog** - 基于 Docker 的 secret 扫描器 - **git-secrets** - AWS Labs 的 git hook 扫描器 - **gitleaks** - 高性能 Go 基础扫描器 - **detect-secrets** - Yelp 的企业级扫描器 - **gittyleaks** - Python 基础模式检测器 - **whispers** - Skyscanner 结构化扫描器 - **trufflehog3** - Python 版本的 TruffleHog 该工作流每周运行一次,并提供一个对比表,展示每种工具检测到多少 secrets,帮助你了解不同 secret 扫描工具的相对有效性。详见 [docs/scanner-comparison.md](/docs/scanner-comparison.md) 了解运行和解读结果的更多细节。 ## CTF 我们有 3 种方式参与 CTF: - 快速的“直接参与”方式,基于我们的 Heroku 域 [https://wrongsecrets-ctf.herokuapp.com](https://wrongsecrets-ctf.herokuapp.com),我们在此处为其编写了[文档](/ctf-instructions.md)。 - 更详细的说明文档在 [ctf-instructions.md](/ctf-instructions.md)。 - 一个完全可定制的 CTF 设置,其中每位玩家拥有自己的 WrongSecrets 虚拟实例和虚拟的 wrongsecrets-desktop 实例,以便他们可以无干扰地游玩。为此你需要使用 [WrongSecrets CTF Party 设置](https://github.com/OWASP/wrongsecrets-ctf-party)。 ### CTFD 支持 希望使用 CTFD 来参与基于免费 Heroku wrongsecrets-ctf 实例的 CTF?可以! 注意:CTFD 支持现在基于 [Juiceshop CTF CLI](https://github.com/juice-shop/juice-shop-ctf)。 注意-II: [https://wrongsecrets-ctf.herokuapp.com](https://wrongsecrets-ctf.herokuapp.com)(临时下线,因缺少 OSS 信用额度)基于 Heroku,容量有限。 首次创建用于 CTFD 的 zip 文件前,你需要先访问 [https://wrongsecrets-ctf.herokuapp.com/api/Challenges](https://wrongsecrets-ctf.herokuapp.com/api/Challenges) 一次,然后执行以下步骤: ``` npm install -g juice-shop-ctf-cli@12.0.0 juice-shop-ctf #choose ctfd and https://wrongsecrets-ctf.herokuapp.com as domain. No trailing slash! The key is 'TRwzkRJnHOTckssAeyJbysWgP!Qc2T', feel free to enable hints. docker run -p 8001:8000 -it ctfd/ctfd:3.7.4 ``` 现在访问 CTFD 实例 [http://localhost:8001](http://localhost:8001) 并设置你的 CTF。 然后使用管理备份功能导入你用 juice-shop-ctf 命令创建的 zip 文件。 开始游戏,使用 [https://wrongsecrets-ctf.herokuapp.com](https://wrongsecrets-ctf.herokuapp.com)! 希望自行搭建?可以!注意人们可能会找到你的 key,所以要妥善保护它:确保运行实际 ctf-key 的容器不对外公开,类似于我们的 Heroku 容器。 ## FBCTF 支持(实验性!) 注意:FBCTF 支持是实验性的。 遵循与 CTFD 相同的步骤,只是现在选择 fbctfd国家映射的 URL 设为 `https://raw.githubusercontent.com/OWASP/wrongsecrets/79a982558016c8ce70948a8106f9a2ee5b5b9eea/config/fbctf.yml`。 然后遵循 [https://github.com/facebookarchive/fbctf/wiki/Quick-Setup-Guide](https://github.com/facebookarchive/fbctf/wiki/Quick-Setup-Guide) 运行 FBCTF。 ## 开发注意事项 在本地机器上进行开发时,请使用 `local` 配置文件 `./mvnw spring-boot:run -Dspring-boot.run.profiles=local,without-vault` 如果你想在不使用 Vault 的情况下测试:启动 Vault 后,在下一个终端执行(使用上一步获取的 token): ``` export SPRING_CLOUD_VAULT_URI='http://127.0.0.1:8200' export VAULT_API_ADDR='http://127.0.0.1:8200' vault server -dev ``` 并在你的下一个终端中执行(使用上一步获取的 token): ``` export SPRING_CLOUD_VAULT_URI='http://127.0.0.1:8200' export SPRING_CLOUD_VAULT_TOKEN='' vault token create -id="00000000-0000-0000-0000-000000000000" -policy="root" vault kv put secret/secret-challenge vaultpassword.password="$(openssl rand -base64 16)" vault kv put secret/injected vaultinjected.value="$(openssl rand -base64 16)" vault kv put secret/codified challenge47secret.value="debugvalue" ``` 现在使用 `local-vault` 配置文件进行开发。 ``` ./mvnw spring-boot:run -Dspring-boot.run.profiles=local,local-vault ``` 如果你想在没有 Vault 实例的情况下开发,请额外使用 `without-vault` 配置文件: ``` ./mvnw spring-boot:run -Dspring-boot.run.profiles=local,without-vault ``` 想要推送容器?查看 `.github/scripts/docker-create-and-push.sh` 脚本,该脚本生成并推送所有容器。不要忘记在组合容器前重新构建应用。 想知道为什么 Vault 在 Kubernetes 中不起作用?执行 `kubectl exec vault-0 -n vault -- vault audit enable file file_path=stdout`。 ### 依赖管理 我们使用 CycloneDX 和 OWASP Dependency-check 来检查依赖项是否存在漏洞。 你可以使用 OWASP Dependency-checker 通过运行 `mvn dependency-check:aggregate` 和 `mvn cyclonedx:makeBom` 来使用 CycloneDX 创建 SBOM。 ### Dependency-Check Maven 插件配置 OWASP WrongSecrets 使用 [`dependency-check-maven`](https://jeremylong.github.io/DependencyCheck/dependency-check-maven/index.html) 插件自动扫描项目依赖项是否存在已知漏洞(CVEs)。 #### 工作原理 插件在 Maven 构建(`./mvnw clean install`)期间运行,并检查所有依赖项 against 公共漏洞数据库。 #### 配置亮点 插件在 `pom.xml` 的 `` 部分配置: ``` org.owasp dependency-check-maven ${dependency-check-maven.version} ... false ossindex true check ``` - **nvdApiKey**:访问 NVD 数据库的 API 密钥(推荐用于更快、更可靠的扫描)。 - **ossIndexServerId**:引用 Maven `settings.xml` 中的 OSS Index 凭证。 - **ossindexAnalyzerEnabled**:设置为 `true` 以启用 OSS Index 扫描。如果遇到认证错误(401),请将其设置为 `false` 以禁用 OSS Index。 #### 认证 OSS Index 要使用 OSS Index,需要将凭证添加到 Maven `settings.xml`: ``` ossindex YOUR_OSSINDEX_USERNAME YOUR_OSSINDEX_API_TOKEN ``` 替换 `YOUR_OSSINDEX_USERNAME` 和 `YOUR_OSSINDEX_API_TOKEN` 为你的 OSS Index 账户详细信息。 #### 故障排除 - 如果看到 `401 Unauthorized` 错误,请检查你的凭证或通过设置 `false` 来禁用 OSS Index。 - 你可以始终在不使用 OSS Index 的情况下运行构建,如果更偏好仅使用 NVD 扫描。 #### 更多信息 参见 [Dependency-Check Maven Plugin Documentation](https://jeremylong.github.io/DependencyCheck/dependency-check-maven/index.html) 获取高级配置选项。 ### 在 IntelliJ IDEA 中启动项目 要求:确保已安装以下工具:[Docker](https://www.docker.com/products/docker-desktop/)、[Java25 JDK](https://jdk.java.net/25/)、[NodeJS 24](https://nodejs.org/en/download/current) 和 [IntelliJ IDEA](https://www.jetbrains.com/idea/download)。 1. 叉出并克隆项目(如文档所述)。 2. 在 IntelliJ 中导入项目(例如作为 mvn 项目 / 本地源码) 3. 确保使用 Java25(并确保可以找到 JDK) 4. 进入 IDE 设置 > 语言与框架 > Lombok,并确保启用 Lombok 处理 5. 打开 Maven 标签页并运行“重新加载所有 Maven 项目”以同步并下载所有内容。接下来,在同一标签页中使用“安装”选项作为 OWASP WrongSecrets 生命周期的一部分生成 asciidoc 等。 6. 现在运行 `org.owasp.wrongsecrets.WrongSecretsApplication.java` 中的 `main` 方法。这应该会失败并显示堆栈跟踪。 7. 现在转到应用程序的运行配置,并确保已激活 `without-vault` 配置文件。这是通过将 VM 选项参数设置为 `--server.port=8080 --spring.profiles.active=local,without-vault` 完成的。设置 `K8S_ENV=docker` 作为环境参数。 8. 重复步骤 6:再次运行应用程序,你应该有一个正常运行的应用程序,可以通过浏览器访问 http://localhost:8080。 **在 IntelliJ IDEA 中启动项目的图示指南** 可在 [_Contributing.md_](https://github.com/OWASP/wrongsecrets/blob/master/CONTRIBUTING.md#how-to-get-started-with-the-project-in-intellij-idea) 中找到。 如果愿意,可以编辑并通过 pull request 提出更改。务必遵循我们的[贡献指南](https://github.com/OWASP/wrongsecrets/blob/master/CONTRIBUTING.md)以确保你的工作被接受。 请注意,我们官方仅支持 Linux 和 macOS 进行开发。如果你想在 Windows 上开发,请使用 WSL2 或运行 Linux 的虚拟机。我们确实包含了 Windows 检测和一些 `exe` 文件用于首次实验,但正在寻找活跃的维护者。希望在 Windows 上开发?请创建 PR;😄。 如果阅读本节后仍不清楚应用程序代码:请参考 [Baeldung 上的一些 Spring Boot 教程](https://www.baeldung.com/spring-boot)。 ### 开发期间自动重载 为了使更改加载更快,我们已将 `spring-dev-tools` 添加到 Maven 项目中。 要在 IntelliJ 中自动启用此功能,请确保: - 在编译器 -> 自动构建项目下启用 - 在高级设置 -> 允许自动启动,即使应用程序当前正在运行。 你也可以手动调用:构建 -> 重新编译文件,这将强制重新加载应用程序。 ### 如何添加一个挑战 请按照以下步骤添加挑战: 1. 首先确保已有一个 [Issue](https://github.com/OWASP/wrongsecrets/issues) 报告需要添加挑战。 2. 在 `org.owasp.wrongsecrets.challenges` 文件夹中添加新挑战。确保在 `src/main/resources/explanations` 中添加说明,并在新挑战类中引用它。 3. 添加适当的单元测试、集成测试和 UI 测试,以证明你的挑战正常工作。 4. 不要忘记在 `src/main/resources/wrong-secrets-configuration.yaml` 中配置该挑战。 5. 审查 [CONTRIBUTING 指南](CONTRIBUTING.md) 以设置你的贡献环境并编写良好的提交信息。 有关更多详细信息,请参考 [_Contributing.md_](https://github.com/OWASP/wrongsecrets/blob/master/CONTRIBUTING.md#how-to-add-a-challenge)。 如果你想将现有的云挑战迁移到另一个云:请扩展 `org.owasp.wrongsecrets.challenges.cloud` 包中的 Challenge 类,并确保在包含单独云标识的文件夹中添加所需的 Terraform。确保将环境添加到 `org.owasp.wrongsecrets.RuntimeEnvironment`。 与其他项目合作,让你的容器运行起来,以便你可以在云账户中测试。 ### 本地测试 如果你对代码库进行了更改或添加了新的挑战,并希望查看容器在合并后的外观,请按照以下步骤操作: 1. 确保已安装 bash 并打开。 2. 导航到 `.github/scripts`。 3. 运行 docker-create 脚本 `bash docker-create.sh`。 - 注意:如果要在 minikube 上运行,请先运行 `eval $(minikube docker-env)`。 4. 按照提示操作,可能需要安装/更改软件包。 5. 运行新创建的容器: - 在本地运行:`docker run -p 8080:8080 -p 8090:8090 jeroenwillemsen/wrongsecrets:local-test-no-vault` - 在 minikube 上运行:使用容器 `jeroenwillemsen/wrongsecrets:local-test-k8s-vault` 在部署定义中。 - 在带有 Vault 的 minikube 上运行:使用容器 `jeroenwillemsen/wrongsecrets:local-test-local-vault` 在你的部署定义中。 ### 本地自动化测试 我们目前有 2 个不同的测试套件,均通过 `./mvnw test` 触发: - 一个常规的 junit 测试套件,包含单元测试和集成测试,位于 [`test/java` 文件夹](src/test/java),输出到默认的目标目录。 - 一个 Cypress 测试套件,集成通过 junit 测试,位于 [`test/e2e`文件夹](src/test/e2e),输出到 [`target/test-classes/e2e/cypress/reports/`](target/test-classes/e2e/cypress/reports/)。请参阅 [cypress readme](src/test/e2e/cypress/README.md) 获取更多细节。 注意:你可以执行完整的清理、构建和测试流程 `./mvnw clean install`。 ## 🔧 故障排除 ### 常见问题 **Docker 问题:** - **端口已被占用**:更改端口映射:`docker run -p 8081:8080 -p 8091:8090 jeroenwillemsen/wrongsecrets:latest-no-vault` - **找不到 Docker**:确保 Docker 已安装并正在运行 - **权限被拒绝**:在 Linux 上,可能需要将用户添加到 docker 组 **浏览器问题:** - **无法访问 localhost:8080**:检查 Docker 容器是否正在运行,使用 `docker ps` - **挑战未加载**:清除浏览器缓存或尝试隐身模式 **Kubernetes 问题:** - **Minikube 无法启动**:尝试 `minikube delete` 然后 `minikube start` - **Pods 处于 pending 状态**:使用 `kubectl describe pod ` 检查资源 **需要帮助?** - 查看我们的 [GitHub Issues](https://github.com/OWASP/wrongsecrets/issues) - 加入我们的 [OWASP Slack](https://owasp.slack.com/archives/C02KQ7D9XHR) - 查看 [Support](#support) 部分 ## 想要游玩,但无法安装工具? 如果你想游玩挑战,但无法安装 keepass、Radare 等工具。但可以使用 Docker 容器,请尝试以下操作: ``` docker run -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock jeroenwillemsen/wrongsecrets-desktop:latest ``` 或使用更可配置的: ``` docker run -d \ --name=webtop \ --security-opt seccomp=unconfined \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ -e SUBFOLDER=/ \ -e KEYBOARD=en-us-qwerty \ -p 3000:3000 \ -v /var/run/docker.sock:/var/run/docker.sock \ --shm-size="2gb" \ --restart unless-stopped \ jeroenwillemsen/wrongsecrets-desktop:latest ``` 然后访问 [http://localhost:3000](http://localhost:3000)。 注意:小心尝试将 `jeroenwillemsen/wrongsecrets-desktop` 容器部署到 Heroku;😄。 ## Docker 在 macOS 上使用 M1 和 Colima(实验性!) 注意:我们不正式支持 Colima,因为我们在 GitHub 运行器上遇到了大量问题。 如果你无法切换到 Docker Desktop/Podman,并且想在 Apple Silicon M1 上使用 Colima 来运行 Docker 镜像 `jeroenwillemsen/wrongsecrets`,你可以尝试以下操作之一: - 关闭 Colima(`colima stop`) - 更改 Docker 上下文(`docker --context desktop-linux run -p 8080:8080 jeroenwillemsen/wrongsecrets:latest-no-vault`) - 使用 1 个 CPU 运行 Colima(`colima start -m 8 -c 1 --arch x86_64`) ## 是否想在你的发行版中禁用某些挑战? 如果你想运行 WrongSecrets 但不想展示某些挑战:请阅读这一节。 *_注意_* 请注意,我们不对你基于此流程创建的 fork 提供任何支持。请理解原始应用程序的许可和版权仍然有效。 需求: - 安装 Java 25 的 JDK; - 拥有注册表账户以推送你变体的 WrongSecrets 容器镜像; 以下是创建你自定义发行版中禁用某些挑战的步骤: 1. 叉出该仓库。 2. 在 `src/main/resources/wrong-secrets-configuration.yaml` 中移除你不再希望出现在你 fork 中的挑战引用。 3. 在项目根目录运行 `./mvnw clean install` 4. 现在为你目标平台构建 Docker 镜像: ``` docker buildx create --name mybuilder docker buildx use mybuilder docker buildx build --platform linux/amd64,linux/arm64 -t :-no-vault --build-arg "argBasedPassword='this is on your command line'" --build-arg "PORT=8081" --build-arg "argBasedVersion=" --build-arg "spring_profile=without-vault" --push docker buildx build --platform linux/amd64,linux/arm64 -t :-kubernetes-vault--build-arg "argBasedPassword='this is on your command line'" --build-arg "PORT=8081" --build-arg "argBasedVersion=" --build-arg "spring_profile=kubernetes-vault" --push ``` ## 进一步阅读 secrets 管理 想了解更多?查看以下资料: - [博客:10 个 secrets 管理要点](https://dev.to/commjoen/secure-deployment-10-pointers-on-secrets-management-187j) - [OWASP SAMM 的 secrets 管理](https://owaspsamm.org/model/implementation/secure-deployment/stream-b/) - [GitHub 上的 secrets 检测主题](https://github.com/topics/secrets-detection) - [OWASP Secrets 管理 Cheatsheet](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Secrets_Management_Cheat_Sheet.md) - [OpenCRE 关于 secrets 管理](https://www.opencre.org/cre/223-780?register=true&type=tool&tool_type=training&tags=secrets,training&description=With%20this%20app%2C%20we%20have%20packed%20various%20ways%20of%20how%20to%20not%20store%20your%20secrets.%20These%20can%20help%20you%20to%20realize%20whether%20your%20secret%20management%20is%20ok.%20The%20challenge%20is%20to%20find%20all%20the%20different%20secrets%20by%20means%20of%20various%20tools%20and%20techniques.%20Can%20you%20solve%20all%20the%2062%20challenges%3F&trk=flagship-messaging-web&messageThreadUrn=urn:li:messagingThread:2-YmRkNjRkZTMtNjRlYS00OWNiLWI2YmUtMDYwNzY3ZjI1MDcyXzAxMg==&lipi=urn:li:page:d_flagship3_feed;J58Sgd80TdanpKWFMH6z+w==)
标签:hunting, JS文件枚举, p0wnableapp, secrets, secretsmanagement, Spring Boot, WrongSecrets, XML 请求, 域名枚举, 子域名突变, 安全培训, 安全开发, 安全意识, 密钥存储, 密钥安全, 密钥审计, 密钥旋转, 密钥查找, 密钥泄露, 密钥狩猎, 密钥硬编码, 开源安全项目, 漏洞演示, 请求拦截, 错误密钥管理示例