d98762625 / CyberChef-server

A server providing RESTful access to CyberChef

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CyberChef server

Gitter

Run CyberChef in a server and provide an API for clients to send Cyberchef recipes to bake.

Motivation

CyberChef has a useful Node.js API, but sometimes we want to be able to programmatically run CyberChef recipes in languages other than JavaScript. By running this server, you can use CyberChef operations in any language, as long as you can communicate via HTTP.

Example use

Assuming you've downloaded the repository and are running it locally:

curl -X POST -H "Content-Type:application/json" -d '{"input":"... ---:.-.. --- -. --. --..--:.- -. -..:- .... .- -. -.- ...:..-. --- .-.:.- .-.. .-..:- .... .:..-. .. ... ....", "recipe":{"op":"from morse code", "args": {"wordDelimiter": "Colon"}}}' localhost:3000/bake

response:

SO LONG, AND THANKS FOR ALL THE FISH

Features

  • Compatible with recipes saved from CyberChef. After using CyberChef to experiment and find a suitable recipe, the exported recipe JSON can be used to post to the /bake endpoint. Just copy/paste it in as your recipe property as part of the POST body.

Installing

  • Clone the repository
  • cd into the project and run npm install
  • Run npm run
  • In a browser, navigate to localhost:3000 to see usage documentation.

API overview

For full documentation of the API, you can find the swagger page hosted at the root url. See Installing to run the application and browse the docs.

Currently the server just has one endpoint: /bake. This endpoint accepts a POST request with the following body:

Parameter Type Description
input String The input data for the recipe. Currently accepts strings.
recipe String or Object or Array One or more operations, with optional arguments. Uses default arguments if they're not defined here.

Example: one operation, default arguments

{
    "input": "One, two, three, four.",
    "recipe": "to decimal"
}

// response: 79 110 101 44 32 116 119 111 44 32 116 104 114 101 101 44 32 102 111 117 114 46

For more information on how operation names are handled, see the Node API docs

Example: one operation, non-default arguments by name

{
    "input": "One, two, three, four.",
    "recipe": {
        "op": "to decimal",
        "args": {
            "delimiter": "Colon"
        }
    }
}
// response: 79:110:101:44:32:116:119:111:44:32:116:104:114:101:101:44:32:102:111:117:114:46

Example: one operation, non-default arguments by position

{
    "input": "One, two, three, four.",
    "recipe": {
        "op": "to decimal",
        "args": ["Colon"]
    }
}
// response: 79:110:101:44:32:116:119:111:44:32:116:104:114:101:101:44:32:102:111:117:114:46

Example: all together

{
    "input": "One, two, three, four.",
    "recipe": [
        {
            "op":"to decimal",
            "args": {
                "delimiter": "CRLF"
            }
        },
        {
            "op": "swap endianness",
            "args": ["Raw"]
        },
        "MD4"
    ]
}
// response: 31d6cfe0d16ae931b73c59d7e0c089c0

Licencing

CyberChef-server is released under the Apache 2.0 Licence and is covered by Crown Copyright.

ezoic increase your site revenue

About

A server providing RESTful access to CyberChef

License:Apache License 2.0


Languages

Language:JavaScript 100.0%