StringCheese is a CTF tool to solve easy challenges automatically in many cases where a strings | grep is just not enough

Overview

StringCheese

StringCheese logo

StringCheese is a script written in Python to extract CTF flags (or any other pattern with a prefix) automatically.

It works like a simple strings | grep command, but can detect many encodings (like base64, XOR, rot13) and works on file formats other than plaintext.

Installation

Use the package manager pip to install StringCheese.

sudo pip install stringcheese

Usage

StringCheese only needs to know the flag prefix to work. You can pass it the input file using the --file option or through stdin.

stringcheese FLAG{ --file input.txt
cat  input.txt | stringcheese FLAG{

How it works

StringCheese generates strings which encode the flag prefix in various ways.

Those strings are then searched in several transformed version of the input file : one in two bytes, reversed, etc.

When the encoded flag prefix is found somewhere, the corresponding decoder is called to regenerate the flag.

how it works

Authors and contributors

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

GNU GPL 2.0

Issues
  • implement base10 ascii search

    implement base10 ascii search

    Implements a search for ascii encoded in base10, e.g. 678470 => CTF.

    This solves the challenge Photographie of ESAIP CTF 2021 (challenge.zip).

    $ stringcheese CTF{ --file newstega5.jpg
    MATCH FOUND! In stream, using encoding base10_ascii:
    CTF{NEPEF}
    
    opened by Hedroed 1
  • Transfer ascii10 search to the new source file

    Transfer ascii10 search to the new source file

    During my last pull request, the main source file moved from __main__.py to stringcheese.py but my code has not propagated to this new location.

    I also add an example file in examples/ folder.

    $ stringcheese FLAG{ --file examples/asciibase10
    MATCH FOUND! In stream, using encoding base10_ascii:
    FLAG{thisIsAFlagInBase10}
    
    opened by Hedroed 0
  • Asking validation during runtime are useless

    Asking validation during runtime are useless

    Validation requests during execution are useless and can be annoying. So I propose to write only a message in the console to inform the user.

    Moreover it is completely useless and redundant to ask for confirmation for the --fast option because the user has already taken the decision to add the option to this command.

    You can see an example of using stringcheese on a 1MB file with the --fast option. I precise than the executing took less than a second.

    stringcheese FLAG{ --file 1mb_file.bin --fast
    Warning, with --fast your files will be treated faster by ignoring some tests so you might miss some flags. Do you wish to continue? (y/N) : y
    This is a large file and may take a long time to be treated, do you wish to continue? (y/N) : y
    MATCH FOUND! In stream, using encoding base10_ascii:
    FLAG{the_flag}
    0%|                                                                                                                     | 0/29 [00:00<?, ?it/s]
    
    opened by Hedroed 1
Owner
Mathis HAMMEL
Deputy CTO @ Sogeti & Co-Founder @ h25 Competitive programmer, CTF player
Mathis HAMMEL
C and Python examples from my book on using PETSc to solve PDEs

p4pdes PETSc for Partial Differential Equations is a new book on using PETSc to solve partial differential equations by modern numerical methods. Orde

Ed Bueler 111 May 30, 2022
Experimental managed C-strings library

Stricks Managed C strings library. ?? API Why ? Because handling C strings is tedious and error-prone. Appending while keeping track of length, null-t

Francois Alcover 79 Jun 21, 2022
A fast Python Common substrings of multiple strings library with C++ implementation

A fast Python Common substrings of multiple strings library with C++ implementation Having a bunch of strings, can I print some substrings which appea

Đào Nguyên Dương 6 Sep 14, 2021
➿ mulle-c-string-escape turns data into C-strings

mulle-c-string-escape ➿ mulle-c-string-escape turns data into C-strings Non-ASCII characters will be escaped to hex or octal. C-escapes are used for k

Nat! 9 Apr 11, 2022
C++ library to manage strings with different encodings

StringSuite C++ library to manage strings and (almost) any kind of encoded data. License Encmetric is written under the GNU Lesser General Public Lice

Paolo 3 Feb 12, 2022
Just me learning how to do certain data structures in C

data_structures_c Just me learning how to do certain data structures in C Currently implemented data structures Hash table Associative array lookup in

Hypervisor 2 Sep 28, 2021
Get the ability to use variable argument lists in C++ without requiring the first parameter! Meant to support a WG14 proposal to fix up not having empty argument lists.

Vargs Alright, it's time to commit code crimes for the greater good! What if you did not need to pass an initial parameter to your C++ ... functions?

Shepherd's Oasis 3 Dec 2, 2021
Easy to use, header only, macro generated, generic and type-safe Data Structures in C

C Macro Collections Easy to use, header only, macro generated, generic and type-safe Data Structures in C. Table of Contents Installation Contributing

Leonardo Vencovsky 307 Jun 28, 2022
Allocator Aware Containers Made Easy

Custom Allocator Aware containers made easy with "wit" Have you ever looked at the allocator specification and thought about how hard it would be to

Darth Rubik 4 Sep 25, 2021
A simple and easy-to-use library to build pipelines in C

A simple and easy-to-use library to build pipelines in C

Ray 11 Feb 22, 2022
"Wireless Made Easy!" - Microchip MRF MiWi package is MiWi P2P and Star Stacks for MRF24J40 and MRF89XA transceivers running on MPLAB X IDE

MRF-MiWi "Wireless Made Easy!" - Microchip MiWi P2P and Star Stack Opened for MRF24J40 and MRF89XA transceiver running on MPLAB X IDE Devices: | MRF24

Microchip Technology 2 Dec 28, 2021
This project contains the carefully compiled easy to medium level Data Structures & Algorithm questions.

Engineering-Daze Hey everyone! ?? This project contains the carefully compiled easy to medium level Data Structures & Algorithm questions. Engineering

DSC-Banasthali 8 Apr 30, 2022
Data Structures And Algorithms Made Easy

Data Structures And Algorithms Made Easy Copyright (c) August 28, 2016 CareerMonk Publications and others. E-Mail : [email protected] Last modificat

Narasimha Karumanchi 373 Jun 19, 2022
A reverse engineering tool to interactively reconstruct structures and generate header files

ReGenny ReGenny is a reverse engineering tool to interactively reconstruct structures and generate usable C++ header files. Header file generation is

null 65 Jun 22, 2022
This is a curve topology verification tool based on Fast Linking Numbers for Topology Verification of Loopy Structures.

Fast Linking Numbers This tool, called verifycurves, takes input models that consist of closed-loop curves, and outputs a topology certificate as a .t

Ante Qu 22 Jan 26, 2022
Diablo II Resurrected map revealing tool.

D2RMH Diablo II Resurrected map revealing tool. What's New v0.2 add display for Unique Chest, Well, neighbour map path fix display of correct taltomb

Soar Qin 150 Jun 17, 2022
Blumentals Surfblocker password exploitation tool.

PoiSoN A Blumentals Surfblocker v5.x password exploitation tool. It is released as a reverse engineering proof-of-concept code. Screenshot & demo pois

Aleksandar 3 May 7, 2022
A tool to collect the exceptions that can reach a C++ function

Exceptions Reporter This tool tries to answer this r/cpp question for a tool to find out, for a given function in my code base, which exceptions it ma

Niels Lohmann 18 Nov 8, 2021
Chad Strings - The Chad way to handle strings in C.

chadstr.h Chad Strings - The Chad way to handle strings in C. One str(...) macro to handle them all. Examples Usage: int table = 13; int id = 37; str

null 776 Jun 26, 2022
Project in the field of Advanced Programming Techniques by prof. Brian Kernighan, inspired by real event that made Ken Thompson invent grep command

ed_to_grep Project in the field of Advanced Programming Techniques by prof. Brian Kernighan, inspired by real event that made Ken Thompson invent grep

mirko 1 Oct 19, 2021
Fast regular expression grep for source code with incremental index updates

Fast regular expression grep for source code with incremental index updates

Arseny Kapoulkine 247 Jun 19, 2022
The movements of your RC vehicles are jerky and not smooth? This Arduino device will solve this issue by adding acceleration and deceleration ramps to the PWM signals!

This is an Arduino Pro Mini 3.3V / 8MHz based RC servo ramp / delay generator Features: 4 RC servo PWM inputs and outputs (can be enhanced) Reads the

null 4 Apr 15, 2022
This repo contains source code of our paper presented in IROS2021 "Single-Shot is Enough: Panoramic Infrastructure Based Calibration of Multiple Cameras and 3D LiDARs"

Single-Shot is Enough: Panoramic Infrastructure Based Calibration of Multiple Cameras and 3D LiDARs Updates [2021/09/01] first commit, source code of

Alibaba 57 Jun 21, 2022
0day VirtualBox 6.1.2 Escape for RealWorld CTF 2020/2021

RWCTF21-VirtualBox-61-escape 0day VirtualBox 6.1 Escape for RealWorld CTF 2020/2021 Demo What? This is our solution for RealWorld CTF's "Box Escape" c

null 121 Jun 9, 2022
An R package for monitoring the trend of daily COVID-19 positive cases in Tokyo

R Package TokyoCovidMonitor A simple RStan-based package for monitoring daily COVID-19 positive cases in Tokyo Overview This package offers a simple m

Takashi J. OZAKI 14 Mar 15, 2022
About Write a program to create a circular doubly linked list and perform insertions and deletions of various cases

Write a program to create a circular doubly linked list and perform insertions and deletions of various cases Circular Doubly Linked List Circular Dou

MH Miyazi 3 Aug 28, 2021
A CTF fuzz powerd by protobuf.

protobuf_ctf_fuzz 一、简介 通过 protobuf + AFLplusplus 进行传统 ctf fuzz。 请参考这篇博文 来了解具体细节。 二、构建与运行 构建很简单,只需一行命令即可: 网络一定一定一定要好!!! 否则还是一条一条的粘贴 ./build.sh 中的命令运行,确

Kiprey 8 May 6, 2022
C++ Matrix -- High performance and accurate (e.g. edge cases) matrix math library with expression template arithmetic operators

Matrix This is a math and arithmetic matrix library. It has stood many years of performing in mission critical production for financial systems. It ha

Hossein Moein 67 Jun 5, 2022
Problem set of the final contest from CTF COMPFEST 13

CTF COMPFEST 13 - Final This repository contains the problem set of final contest from CTF COMPFEST 13. Table of Contents Problem Title Author Categor

CTF COMPFEST 5 Oct 29, 2021