CTF思路
点击放大


> the re-maintainance for chatwithbinary.com will start on sept-1
<img width="1507" alt="image" src="
<img width="1000" alt="Xnip2023-04-16_11-36-38" src="
ChatWithBinary is a cutting-edge software tool designed to analyze binary files using the LangChain (OpenAI API) technology. It primarily focuses on aiding CTF (Capture The Flag) Pwners in gaining a deeper understanding of the binary files they are working with and pro assistance to help them sol more effectively :)
中文文档 README 📖
English README 📖
ChatWithBinary is built upon a strong foundation of artificial intelligence and machine learning, which enables it to analyze complex binary files quickly and efficiently. By le the power of OpenAI API, RET2GPT can offer a comprehensive and detailed analysis of binary files, making it an indispensable tool for CTF Pwners.
The primary goal of ChatWithBinary is to streamline the process of understanding binary files, thereby allowing CTF Pwners to focus on solving challenges rather than getting bogged down in the intricacies of binary analysis. The software achieves this by pro users with a thorough examination of the binary file's structure, logic, and potential . This analysis assists Pwners in identifying any weak points in the code that may be exploitable by attackers.
All in all, ChatWithBinary includes those feature:
* Easy-to-use : No need to input any other files, only the binary file and you are good to go
* Langchains: Use langchain to split the file, save you tons of tokenizing time and lots of money
* Precise Analyze : Analyze binary file using langchain & OpenAI API, use elebrately designed prompt by me to get the best result
* Automatic : Use langchain and OpenAI API to automate analysis of binaries without human inter
pip:Additionally, if yu didn't install retdec yet, you may need to install it ://github.com/avast/retdec first, it won't take too long, will be once and for all
Before you start, you still need to set your OPENAI_KEY in the terminal, you can get your key from here
Then you can use it by Ret2GPT in the terminal:
Now, if you only want to try Ret2GPT, you can simply run it by using python3:
However, if you want tot use Ret2GPT permanently, you can easily install it by executing the install.sh file:
After that, you can use ret2gpt command to run our software from anywhere, what a magic is that?
OPENAI_KEY in the terminal, you can get your key from hereFirst, the usage of this file in commandline is:
Now, you entered the commandline interface, You can ask ANYQUESTION YOU WANT
for example, if want to find of the program is to buffer o, you can ask:
you can use help command to get the help message:
I am sure you will figure out yourself what does two commands means
<!-- The commands in the program are super easy, I am sure you will figure out yourself, but if you still have any questions, you can always ask me by opening an issue on our github repo. -->
<!-- <img width="800" alt="Xnip2023-04-16_11-04-30" src=" -->
to find the answer of this question, we must analysis every directory and step of the program, so let's start!
langchain_proprocess/For this part of code, I ha a series of functions and utilities that le the power of the LangChain (OpenAI API) technology to create an ad question-answering system. This system is specifically tailored for processing and analyzing text files, with the primary goal of assisting Capture the Flag (CTF) Pwners in understanding binary files and solving challenges more effectively.
I started by importing the necessary modules and initializing the ChatOpenAI model with the GPT-3.5 Turbo model. Next, I defined several utility functions that handle tasks in the text analysis pipeline:
loading: split_files:create_qa: Also, I use GPT3.5 for QA bot
qa_with_docs: query_about_files: summerize_chain: To ensure the question-answering system is context-aware and can provide accurate and relevant information, I built a detailed prompt using the build_prompt_for_qa(). This function employs a few-shot learning approach with the FewShotPromptTemplate class, incorporating several examples of code analysis and identification. These examples serve as a guide for the model, helping it understand the context and respond accordingly.
built_in_command/Ret2gpt do not require that much of explaination, it is just a command line interface that allows users to interact with the system. The built_in_command folder contains the following files:__init__.py: This file is responsible for initializing the built_in_command folder as a python package.check_for_command.py: This file contains the check() and help() function, check() checks if the user input is a command, and return different prompt with the command, and help() prints the help message.command_line.py: This file contains the command_line() function, which is the main function of the built_in_command folder. It is responsible for parsing the user input and calling the corresponding function. ![Star History Chart]()
开发语言:Python
Star 数:375
该项目属于CTF思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕ChatWithBinary: Advanced AI-powered binary analysis tool leveraging OpenAI & LangChain (2023)展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | BinaryChat - ChatWithBinary: Advanced AI-powered binary analysi |
| 所属分类 | CTF思路 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 23:42:43 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 266 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |