
项目说明
![Follow Hackgnar]()
BLE Capture the Flag
The purpose of BLE CTF is to teach the core concepts of Bluetooth Low Energy client and ser. While it has also been built to be fun, it was built with the intent to teach and reinforce core concepts that are needed to plunge into the world of Bluetooth hacking. After completing this CTF, you should ha you need to start fiddling with any BLE GATT device you can find.
Setting Up the CTF
In order to set up the CTF you will need the following:
1. The pre-compiled firmware or source code in this repository to build and flash an ESP32 (esp32, esp32s3, or esp32c6) with the CTF GATT server.
2. An esp32 microcontroller
3. A Linux box (OSX/Win + Linux ) with a bluetooth controller or a bluetooth usb dongle
4. Bluetooth tools such as gatttool (from bluez-tools), gratttool, or other BLE tools (hcitool, etc)
For instructions to compile/flash your own firmware or flash the provided pre-compiled firmware read this documentation
Flags
How to Submit Flags
Before you can submit flags, you have to discover the Bluetooth MAC address of your device. Here are a couple example commands to help you find your device:
Discover MAC using hcitool:
Now that you ha your device’s MAC address, you can now communicate with it. Before we get started with flags, let’s check out how we can see our current score. In order to see where you are in the CTF, you can read from handle 42 on the device to see how many flags you have. The following are example commands of how to view your current score. Make sure you replace the MAC address in the example commands with the MAC address of your device.
Show score:
Ok, ok, ok, on to the flags! All flags are md5 sums truncated to 20 characters to avoid MTU limits by some hardware. They can be submitted to the gatt server on handle 44. The following are examples of how to submit a flag. Make sure you replace the MAC address in the example commands with the MAC address of your device:
Submit flag:
`
Flag Hints
| Flag | Description | Hint |
| ------- | ----------------------------- | ------- |
| Flag 1 | This flag is a gift and can only be obtained from reading the hint! | Read Me! |
| Flag 0x002e | Learn how to read handles | More |
| Flag 0x0030 | Read handle puzzle fun | More |
| Flag 0x0016 | Learn about disco device attributes | More |
| Flag 0x0032 | Learn about reading and writing to handles | More |
| Flag 0x0034 | Learn about reading and writing ascii to handles | More |
| Flag 0x0036 | Learn about reading and writing hex to handles | More |
| Flag 0x0038 | Learn about reading and writing to handles differently | More |
| Flag 0x003c | Learn about write fuzzing | More |
| Flag 0x003e | Learn about read and write speeds | More |
| Flag 0x0040 | Learn about single response notifications | More |
| Flag 0x0042 | Learn about single response indicate | More |
| Flag 0x0046 | Learn about multi response notifications | More |
| Flag 0x0048 | Learn about multi response indicate | More |
| Flag 0x004c | Learn about BT client device attributes | More |
| Flag 0x004e | Learn about message sizes MTU | More |
| Flag 0x0050 | Learn about write responses | More |
| Flag 0x0052 | Hidden notify property | More |
| Flag 0x0054 | Use multiple handle properties | More |
| Flag 0x0056 | OSINT the author! | More |
| Flag 0x005a | A characteristic is more than its value | More |
| Flag 0x005d | The server can see who you are | More |
| Flag 0x005f | You do not always need to connect | More |
| Flag 0x0061 | Learn to read the error, not just the failure | More |
| Flag 0x0063 | Find things by UUID, not by handle | More |
| Flag 0x0065 | Descriptors are not read only | More |
| Flag 0x0068 | Learn about queued long writes | More |
| Flag 0x006a | Notifications are not ordered | More |
| Flag 0x006d | A value is not a fixed property of a handle | More |
| Flag 0x006f | Challenge and response | More |
项目信息
开发语言:C
Star 数:778
技术要点
该项目属于CTF思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕A Bluetooth low energy capture the flag展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
使用与学习建议
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
免责声明
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。