BinaryChat  by Protosec-Research

CLI tool for binary analysis, aiding CTF Pwners

Created 2 years ago
373 stars

Top 76.0% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides an AI-powered tool for analyzing binary files, specifically targeting Capture The Flag (CTF) participants in the "Pwn" category. It aims to streamline binary analysis and vulnerability detection by leveraging OpenAI's API and LangChain, allowing users to query binary file structures and potential exploits.

How It Works

The tool utilizes LangChain to process binary files, breaking them into manageable chunks for efficient analysis by OpenAI's GPT models. It employs a retrieval-augmented generation (RAG) approach, storing embeddings of the file chunks in a Chroma vector store. A carefully crafted few-shot prompt guides the AI to identify vulnerabilities, explain their causes, and suggest mitigations, mimicking an experienced CTF analyst.

Quick Start & Requirements

  • Installation: pip install --index-url=https://pypi.org/simple/ Ret2GPT
  • Prerequisites:
    • Python 3.x
    • OpenAI API Key (export OPENAI_API_KEY="Enter your api_key here")
    • Optional: retdec (from avast/retdec)
  • Usage: ret2gpt [FILE_PATH]
  • Documentation: 中文文档 📖 English README 📖

Highlighted Details

  • Leverages LangChain for efficient document splitting and QA chain creation.
  • Features a detailed, few-shot prompt designed for CTF Pwn analysis.
  • Provides built-in commands for code analysis, exploit template generation, and help.
  • Supports interactive querying of binary file contents and potential vulnerabilities.

Maintenance & Community

The project is maintained by Protosec-Research. Further community engagement details are not explicitly provided in the README.

Licensing & Compatibility

The project's licensing is not explicitly stated in the README. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The tool relies heavily on the OpenAI API, incurring costs and requiring an API key. The effectiveness of the analysis is dependent on the quality of the provided binary file, the decompiled output, and the prompt engineering. The project is described as a "re-maintenance" starting September 1st, suggesting potential ongoing development and changes.

Health Check
Last Commit

10 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
7 stars in the last 30 days

Explore Similar Projects

Starred by Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic), Hiroshi Shibata Hiroshi Shibata(Core Contributor to Ruby), and
6 more.

oss-fuzz by google

0.1%
11k
Continuous fuzzing for open source software
Created 9 years ago
Updated 23 hours ago
Feedback? Help us improve.