Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Command-line interface for CyberChef #1046

Open
Boolean263 opened this issue Jun 1, 2020 · 3 comments
Open

Feature request: Command-line interface for CyberChef #1046

Boolean263 opened this issue Jun 1, 2020 · 3 comments
Labels

Comments

@Boolean263
Copy link

It would be very helpful to have a command line interface for performing CyberChef operations on local files without the need for a GUI web app.

@d98762625 suggested I create this ticket to be a better venue than PR #1043 for the design discussion of what CyberChef's official CLI could look like.

Design considerations

An ideal CLI would have a fairly simple interface. The only inputs needed are:

  • A recipe, being a list of operations to perform
  • A list of files upon which to perform the operations
  • A directory or file into which to place the output

In keeping with a common paradigm in unix-like operating systems, if no input files are given, then input should come from stdin; likewise, if no output destination is specified, then output should go to stdout. This is to accommodate the very common practice of chaining several single-purpose commands together to address specific needs.

A CLI would not replace the web app, and should not be designed with feature-parity to the web app in mind. The thrust of this ticket is to get command-line access to the operations which CyberChef provides, for use on data which shouldn't or can't easily be loaded into the web app.

A CLI would not replace the Node API, and should not be designed to expose every last detail of that API. Using the CLI should be easier for the general case than writing a program.

Specifying recipes

There are many ways one could specify a recipe to the CLI, and this is probably where most of the complexity will come from. The CLI could possibly support multiple ways of receiving the recipe. Some possibilities:

  • String of JSON from a file
    • eg. from CyberChef's "Save Recipe → Clean JSON" or "→ Compact JSON" dialog
  • List of "Chef Format" operations in a file
    • eg. from CyberChef's "Save Recipe → Chef Format" dialog
  • List of operations specified on the command line
    • Strict "Chef Format": To_Base64('A-Za-z0-9+/=') To_Hex('None')
    • Simplified semantic format leveraging the flexibility of chef.bake(): 'tobase64:A-Za-z0-9+/=' to-hex:none

I ordered these roughly from least to most end-user friendly, but they aren't mutually exclusive. Some use cases are easier when loading a pre-composed recipe from a file, while others are easier by specifying operations on the command line.

@geekscrapy
Copy link

geekscrapy commented Jul 5, 2021

Not sure if you are aware of this: https://chepy.readthedocs.io/en/latest/

Might provide some ways to do things, albeit in Python.

I'd love to be able to run using a native cyberchef instance! At the moment I'm converting between CyberChef and Chepy

It would be great to be able to manage recipes from the cli, giving them friendly names for use with the cli

@Kreijstal
Copy link

I was not aware of chepy, why do reinvent the wheel instead of providing cyberchef api over node or something?

@meiraxx
Copy link

meiraxx commented Nov 13, 2022

A Cyberchef offline API would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants