Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SpecTrace - state of this repo / hackathon result

The repo β€œspectrace” ( https://github.com/stoyse/spectrace/ ) was created during an AI security hackathon as a team repo. This text change commit corrects and clarifies some things and will most likely be the last one before the project is archived.

The idea and workflow for the project was drafted by Richard Meinsen and presented to Joseph Chris Adrian before the hackathon. As a data scientist he decided to stay in the team but to work with synthetic data on another aspect as the concept did not offer data for machine learning.

During the hackathon the concept was presented to Julian Stosse and Javier Peres. Julian Stosse and Richard Meinsen then verified the concept by manual workflow execution and manually writing the prompts. They successfully proved that the concept can work, and shared all the results in the team. The concept can be helpful to support software / firmware development. The approach would be most useful & usable when implemented as cli or via scripts -> usable in CI/CD.

Without discussion with the team Javier Peres decided to make it a web app and vibe coded that web app on the evening of day 1 based on the explanations and information he had received from the team. On day 2 the team was in the situation that Javier had put the source not in the agreed upon team repo but in his own repo where the team had no access, also without mentioning the team members in the files. Richard made clear that mentioning the team members was necessary, as well as using the team repo that all the team had access to. Besides other problems Javier Peres repeatedly force pushed on the team repo, effectively removing the work from the repo that others had pushed. For other hackathon team members the resulting experience is totally bitter.

It is useless to continue with this repo as the vibe coded web app looks shiny but does not work correctly (bad for presenting) while the basic workflow worked fine. Further the workflow should not be implemented as a web app with point and click file uploads as this does not align with professional software development workflows and CI/CD.

Further the claim "SpecTrace is an AI-powered firmware security analysis platform that decompiles binary firmware files using Ghidra and performs intelligent code comparison to identify security vulnerabilities, compliance issues, and behavioral changes between firmware versions. The application combines automated binary analysis with OpenAI GPT-4 to provide detailed" is quite exaggerated as a) the so far pushed state of code does not work correctly what made it also not presentable working (but what would have worked as tested for the validation) and b) the web workflow is not really usable for firmware development or in general software development.

One can take the work of others, wrap it cheap and shiny, and promote oneself with that as an inventive creator. That's not new. But in the end it just wastes time and resources.

Making this state clear in this public repo is the only way to make sure there is also not much profit for Javier Peres from this. It will not make the time losses and the ruined hackathon for the other team members any better. The hope is, that some others will notice that such an egoistic approach can cause problems and will refrain from it.

See also

--------------------------------------------------------------------------------------

πŸ›‘οΈ SpecTrace

AI-Powered Firmware Security Analysis Platform with Binary Decompilation

SpecTrace is an advanced cybersecurity platform that combines cutting-edge AI algorithms with Ghidra's powerful binary analysis capabilities to provide comprehensive firmware security analysis, vulnerability detection, and compliance validation.

SpecTrace Banner


🎯 Overview

SpecTrace revolutionizes firmware security analysis by offering both text-based and binary-based analysis workflows. Upload source code or binary firmware files, and get detailed security insights powered by OpenAI's GPT-4 and NSA's Ghidra decompiler.

πŸ”₯ Key Capabilities

  • πŸ”§ Binary Decompilation: Convert firmware binaries to readable assembly/C code using Ghidra
  • πŸ€– AI Security Analysis: GPT-4 powered vulnerability detection and risk assessment
  • πŸ“Š Compliance Validation: Automated security compliance checking
  • πŸ“ˆ Change Analysis: Compare firmware versions and track modifications
  • 🎨 Modern Interface: Intuitive React dashboard with real-time progress tracking

πŸš€ Features

Binary Analysis

  • Multi-Format Support: ELF, PE, Mach-O, Intel HEX, raw binaries
  • Architecture Detection: Automatic CPU architecture identification
  • Decompilation: Assembly disassembly and high-level C code generation
  • Metadata Extraction: Compiler info, build details, and binary characteristics

Security Analysis

  • Vulnerability Detection: Buffer overflows, hardcoded credentials, memory issues
  • Risk Assessment: CRITICAL, HIGH, MEDIUM, LOW severity classification
  • Pattern Recognition: Common attack vectors and security anti-patterns
  • Compliance Checking: Industry standard security requirement validation

Analysis Workflows

  • Text Mode: Direct source code analysis (.asm, .c, .h files)
  • Binary Mode: Automatic decompilation + analysis workflow
  • Dual Comparison: Compare old vs new firmware versions
  • Specification Validation: Ensure code matches documentation

User Experience

  • Drag & Drop Upload: Intuitive file handling
  • Real-Time Progress: Live analysis status with detailed steps
  • Comprehensive Reports: Detailed findings with actionable recommendations
  • Debug Panel: Development insights and API call monitoring

πŸ“ Architecture

spectrace/
β”œβ”€β”€ πŸ“ api/                     # FastAPI Backend
β”‚   β”œβ”€β”€ πŸ“ services/            # Core analysis services
β”‚   β”‚   β”œβ”€β”€ ghidra_service.py   # Binary decompilation
β”‚   β”‚   β”œβ”€β”€ code_analyzer.py    # AI code analysis
β”‚   β”‚   β”œβ”€β”€ spec_analyzer.py    # Specification analysis
β”‚   β”‚   └── compliance_analyzer.py # Compliance validation
β”‚   β”œβ”€β”€ πŸ“ routes/              # API endpoints
β”‚   β”œβ”€β”€ πŸ“ middleware/          # Error handling & logging
β”‚   β”œβ”€β”€ πŸ“ tests/              # Automated tests
β”‚   └── πŸ“„ main.py             # Application entry point
β”œβ”€β”€ πŸ“ dashboard/               # React Frontend
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/          # Main application pages
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/     # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ πŸ“ lib/           # Utility functions
β”‚   β”‚   └── πŸ“ hooks/         # Custom React hooks
β”œβ”€β”€ πŸ“ features/               # Feature documentation
β”œβ”€β”€ πŸ“ docs/                  # Installation & setup guides
β”œβ”€β”€ πŸ“ files/                 # Sample test files
β”œβ”€β”€ πŸ“ images/                # Screenshots & assets
β”œβ”€β”€ 🐳 Dockerfile             # Container configuration
β”œβ”€β”€ 🐳 docker-compose.yml     # Multi-service orchestration
└── πŸ“„ README.md              # This file

πŸ› οΈ Technology Stack

Backend (API)

Component Technology Purpose
Framework FastAPI High-performance async API
Language Python 3.11+ Core application logic
AI Engine OpenAI GPT-4 Security analysis & insights
Binary Analysis Ghidra 11.0.3+ Firmware decompilation
Database In-memory Session state management
Testing pytest Automated testing

Frontend (Dashboard)

Component Technology Purpose
Framework React 18 + TypeScript User interface
Build Tool Vite Fast development & building
Styling Tailwind CSS Responsive design
Components shadcn/ui + Radix UI Accessible components
State Management React Hooks Application state
HTTP Client Fetch API Backend communication

Infrastructure

Component Technology Purpose
Containerization Docker + Docker Compose Deployment & development
Web Server Uvicorn ASGI server
Reverse Proxy Built-in CORS Cross-origin requests
File Storage Local filesystem Temporary file handling

πŸ“‹ Prerequisites

For All Platforms

  • OpenAI API Key (required for AI analysis)
  • Internet Connection (for AI API calls and package downloads)
  • 4GB+ RAM (for Ghidra binary analysis)
  • 2GB+ Disk Space (for Ghidra installation and temporary files)

Platform-Specific Requirements

Platform Requirements Installation Guide
πŸͺŸ Windows Python 3.11+, Node.js 18+, Java 17+, Git πŸ“– Windows Setup
🍎 macOS Python 3.11+, Node.js 18+, Java 17+, Homebrew πŸ“– macOS Setup
🐧 Linux Python 3.11+, Node.js 18+, Java 17+, wget/curl πŸ“– Linux Setup
🐳 Docker Docker Desktop or Docker Engine πŸ“– Docker Setup

πŸš€ Quick Start

🐳 Docker Installation (Recommended)

Fastest way to get started with zero configuration:

# 1. Clone the repository
git clone https://github.com/your-repo/spectrace.git
cd spectrace

# 2. Create environment configuration
echo "OPENAI_API_KEY=your_openai_api_key_here" > .env

# 3. Launch the platform
docker-compose up --build

πŸŽ‰ Access the application:

πŸ’» Manual Installation

Choose your platform-specific guide:


🎯 Usage Guide

Step 1: Choose Analysis Mode

Analysis Mode Selection

πŸ“„ Text Mode: Upload source code files directly

  • Supported: .asm, .c, .h, .txt files
  • Use case: When you have firmware source code

πŸ”§ Binary Mode: Upload firmware binaries for decompilation

  • Supported: .bin, .elf, .exe, .hex files
  • Use case: When you only have compiled firmware

Step 2: Upload Files

File Upload Interface

Required Files:

  • Firmware Files: 2 versions (original + updated)
  • Specifications: 2 versions (original + updated documentation)

File Size Limits:

  • Text files: 50MB max
  • Binary files: 100MB max
  • Specifications: 10MB max

Step 3: Analysis Process

Analysis Progress

The platform automatically:

  1. πŸ” Prepares Analysis: Validates files and sets up environment
  2. πŸ”§ Decompiles Binaries: Converts binaries to readable code (if binary mode)
  3. πŸ“Š Analyzes Code: AI-powered security analysis and comparison
  4. πŸ“ Processes Specs: Documentation analysis and change detection
  5. βœ… Validates Compliance: Checks code-to-spec alignment
  6. πŸ“‹ Generates Report: Comprehensive results with recommendations

Step 4: Review Results

Analysis Results

Report Sections:

  • 🚨 Security Findings: Vulnerabilities with severity ratings
  • πŸ“ˆ Risk Assessment: Overall security posture
  • πŸ”„ Change Analysis: Code modifications and their impact
  • πŸ“‹ Compliance Status: Documentation alignment score
  • πŸ’‘ Recommendations: Actionable security improvements

πŸ“Š API Reference

Binary Analysis Endpoints

POST /api/v1/decompile
Content-Type: multipart/form-data

# Upload binary file for decompilation
# Returns: Assembly code + decompiled C code

Code Analysis Endpoints

POST /api/v1/compare-code
Content-Type: application/json

# Compare two firmware code versions
# Returns: Security findings + risk assessment

Specification Analysis Endpoints

POST /api/v1/compare-specs
Content-Type: application/json

# Compare two specification versions
# Returns: Feature changes + behavioral analysis

Compliance Validation Endpoints

POST /api/v1/validate-compliance
Content-Type: application/json

# Validate code-to-specification alignment
# Returns: Compliance score + mismatches

πŸ“š Full API Documentation: http://localhost:8000/docs


πŸ”§ Supported Binary Formats

Format Extension Architecture Use Case
ELF .elf Linux/Embedded Linux executables, IoT firmware
PE .exe, .dll Windows Windows programs, drivers
Mach-O .app, .dylib macOS macOS applications
Intel HEX .hex, .ihex Embedded Microcontroller firmware
Raw Binary .bin, .img Various Custom firmware images
S-Record .s19, .srec Embedded Motorola S-record format

πŸ§ͺ Testing

Run Backend Tests

cd api
pytest -v                    # Run all tests
pytest tests/test_ghidra*    # Test Ghidra integration
python run_tests.py          # Custom test configuration

Run Frontend Tests

cd dashboard
npm test                     # Run React tests
npm run lint                 # Check code quality
npm run type-check          # TypeScript validation

Integration Testing

# Test complete workflow with sample files
cd api
python -c "
import asyncio
from services.ghidra_service import GhidraDecompiler

async def test():
    decompiler = GhidraDecompiler()
    print('βœ… Ghidra integration ready!')

asyncio.run(test())
"

πŸ› οΈ Development

Development Setup

# 1. Clone and setup
git clone https://github.com/your-repo/spectrace.git
cd spectrace

# 2. Backend development
cd api
pip install -r requirements.txt
python main.py

# 3. Frontend development
cd dashboard
npm install
npm run dev

Available Scripts

Backend (API)

python main.py              # Start development server
pytest                      # Run tests
python run_tests.py         # Custom test runner
uvicorn main:app --reload   # Alternative server start

Frontend (Dashboard)

npm run dev                 # Development server
npm run build              # Production build
npm run preview            # Preview production build
npm run lint               # Code linting
npm run type-check         # TypeScript checking

Environment Variables

# Required
OPENAI_API_KEY=sk-...       # Your OpenAI API key

# Optional
GHIDRA_INSTALL_DIR=/opt/ghidra    # Ghidra installation path
JAVA_HOME=/usr/lib/jvm/java-17    # Java installation path
DEBUG=true                        # Enable debug logging

πŸ‘₯ Team

SpecTrace was developed by the following team for the AI Cybersecurity Hackathon - Sponsored by SAP & KPMG:

  • Richard Meinsen
  • Joseph Chris Adrian
  • Javier Peres
  • Julian Stosse

πŸ“ License

This project is licensed under the GPL v3 - see https://www.gnu.org/licenses/gpl-3.0.en.html and LICENSE file for details.

Copyright Β© 2025 SpecTrace Team Hackathon


πŸ›‘οΈ SpecTrace - Revolutionizing Firmware Security with AI

Built with ❀️ for the cybersecurity community

GitHub Stars Docker Pulls License: MIT

🌐 Website β€’ πŸ“– Documentation β€’ πŸ’¬ Community β€’ 🐦 Twitter

About

SpecTrace is an AI-powered firmware security analysis platform that decompiles binary firmware files using Ghidra and performs intelligent code comparison to identify security vulnerabilities, compliance issues, and behavioral changes between firmware versions. The application combines automated binary analysis with OpenAI GPT-4 to provide detailed

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages