CTF思路
点击放大

Learn AI security through a series of LLM CTF challenges. No sign ups, no cloud fees, run e locally on your system.
I' AI Goat to learn about LLM de and the security risks companies face that use it. The CTF format is a great way for security researchers to gain practical experience and learn about how these systems are and can be exploited. Thank you for your interest in this project and I hope you have fun!
Remember, an LLM engine wrapped in a web application hosted in a cloud en is going to be subject to the same traditional cloud and web application security threats. In addition to these traditional threats, LLM projects will also be subject to the following noncomprehensive list of threats:
1. Prompt Injection
2. Insecure Output Handling
3. Training Data Poisoning
4. Denial of Service
5. Supply Chain
6. Permission Issues
7. Data Leakage
8. Excessi
9. O
10. Insecure Plugins
A prebuilt Docker image, ai-base, has all the libraries needed to run the LLM and challenges. This container is downloaded during the installation process along with the LLM binary. A docker compose that launches each challenge attaches the LLM binary, specific challenge files, and exposes TCP ports needed to complete each challenge. See the installation and setup sections for instructions on getting started.
An optional CTFd container has been prepared that includes each challenge description, hints, category, and flag submission. The container image is hosted in our dockerhub and is call ai-ctfd alongside the ai-base image. The ai-ctfd container can be launched from the ai-goat.py and accessed using your browser.
sudo apt install git -ysudo apt install python3-pip -ysudo usermod -aG docker $USERrebootInstallation steps.> Important: Once launched, you must create a user registering a user account. This registration stays local on the container and does not require a real email address.
1. After you clone the repo, na to ai-goat/app/challenges/1/app.py and change the flag in the string on line 12.
2. Then na to ai-goat/app/challenges/2/entrypoint.sh and change the flag on line 3.
3. Next you will need to change the flags in CTFD. Launch CTFD (./ai-goat.py --run ctfd and open browser to ) and then login with the root user using q as the password.
4. Once logged in, na the admin panel (top nav bar) -> Challenges (top nav bar) -> select a challenge -> and hit the Flags sub-tab.
5. Change the flag for each CTFD challenge to match the same string you changed the in the source code.
Have fun!
Challenges section for a description of each challenge or refer to the ai-ctfd web page from Step 1. The following command launches the first challenge:The challenge container will launch in the background and provide instructions on how to interact with the challenge. Each challenge has a flag, which is a string surrounded by curly braces. For example: {eXampl3F!ag}. You the flag through submission to the subject challenge in the ai-ctfd page.
> Important: Sometimes LLMs make up the flag value, so make sure you the flag in ai-ctfd ;)
> Important: The LLM response can take 30 seconds or so
./ai-goat.py --run <CHALLENGE NUMBER>. This command will restart the container if it is already running.docker container ps. To stop a container: docker stop <CONTAINER NAME>.> Important: ai-ctfd will effectively start from scratch so make sure to create a new user and resubmit/redo any previous challenges if desired.
LLM01: Prompt Injections | LLM07: Data Leakage
LLM02: Insecure Output Handling
CHANGELOG.md file. Branches are created for each respecti.Art by: ejm97 on ascii.co.uk
AI container technology:
1. Library: llama-cpp-python
2. Large Language Model: LLM
开发语言:Python
Star 数:368
该项目属于CTF思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕Learn AI security through a series of vulnerable LLM CTF challenges. No sign ups, no cloud fees, run everything locally on your system.展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | ai-goat - Learn AI security through a series of vulnerable L |
| 所属分类 | CTF思路 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 23:42:53 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 240 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |