ctf-crypto

Analyze and exploit cryptographic implementations in binaries to recover flags or keys.

797|69|Updated Aug 18, 2023
One-click install
npx skills add https://github.com/cyberkaida/reverse-engineering-assistant --skill ctf-crypto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ctf-crypto
Source: https://github.com/cyberkaida/reverse-engineering-assistant/tree/main/ReVa/skills/ctf-crypto
Command: npx skills add https://github.com/cyberkaida/reverse-engineering-assistant --skill ctf-crypto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps identify, analyze, and exploit cryptographic implementations in binaries to recover flags, keys, or decrypt data for CTF challenges.

Core Features & Use Cases

  • Crypto presence and algorithm detection: Detects whether cryptography is used and identifies potential algorithms (e.g., RC4, AES, RSA) through strings, imports, and pattern analysis.
  • Implementation analysis and key extraction: Traces data and key material sources, analyzes key schedules and data flows, and documents weaknesses that enable flag recovery.
  • Guided exploitation workflow: Provides a structured workflow from discovery to exploitation, including renaming variables, mapping memory, and reproducing logic for verification.
  • Use Case: Given a binary with a hardcoded key and a simple XOR-based cipher, locate the key and decrypt the embedded payload.

Quick Start

Start by uploading the target binary and instruct the AI to locate any hardcoded keys, analyze the crypto routine, and attempt to decrypt the embedded data.

Frequently Asked Questions about ctf-crypto

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find hardcoded keys and decrypt data in a binary?

To find hardcoded keys and decrypt binary data, you trace data-flow and string patterns to locate key material, then reproduce the cipher logic to recover the original payload. This involves analyzing key schedules and mapping memory within the compiled program.

How does weak crypto detection in reverse engineering work?

Weak crypto detection in reverse engineering works by analyzing decompiled code and string patterns to identify poorly implemented algorithms like custom ciphers or weak RNGs. It traces data flows to document specific vulnerabilities that enable key extraction or data recovery.

What is the best way to identify custom ciphers in compiled programs?

The best way to identify custom ciphers in compiled programs is through decompilation review and pattern analysis, looking for non-standard cryptographic routines and key schedules. Tracing data-flow sources reveals how the custom cipher processes encrypted payloads.

Can I use this workflow for CTF challenges involving weak RNGs and RC4?

Yes, this workflow supports CTF challenges involving weak RNGs and algorithms like RC4, AES, or RSA. It detects cryptographic presence through imports and strings, then traces the implementation to exploit weaknesses for recovering flags or decrypted data.

Why does key extraction fail when analyzing binary crypto routines?

Key extraction fails when analyzing binary crypto routines if data-flow tracing misses key material sources or if variables are not renamed correctly during decompilation. Mapping memory and reproducing the key schedule logic accurately is required to verify the extracted key.