For the complete documentation index, see llms.txt. This page is also available as Markdown.

CyberChef

CyberChef is GCHQ's "Cyber Swiss Army Knife". It is a standalone web page with hundreds of data transformation operations. You drag operations into a recipe, give it data, and the output updates in real time. You do not have to install software, CyberChef does not send your data to a remote server, and the interface makes it easy to try different operations.

For example, when you think that data is XOR-encoded, you can try keys and see immediately if the output looks like plaintext. If you find AES-encrypted data and do not know if the mode is CBC or CTR, try both.

During reverse engineering, you often move data between IDA and CyberChef. You find an encrypted region in a binary, copy the bytes, paste them into CyberChef in a browser tab, find the correct transformation, and then copy the result back into IDA. This takes time, and it is easy to make a mistake.

The CyberChef plugin removes these steps. It puts the CyberChef data transformation engine into IDA Pro, with a panel next to your disassembly. Data goes from top to bottom through three areas: input, recipe, and output.

CyberChef panel with input, recipe, and output

CyberChef comes from the open source ida-cyberchef plugin, which is available for free in the IDA plugin repository. HCLI installs it together with the add-on, online and from the offline bundle. CyberChef works on all platforms and Python versions that the add-on supports.

Input

The plugin reads data directly from your IDB. It can follow your cursor, and transform and show a slice of data from that address. As you move through the disassembly, it reads bytes at the current position and applies the recipe in real time. This helps you to test a hypothesis. For example, if you found an XOR key and want to see how it decodes a region of data, scroll through the region and look at the result.

You can also use the selection, or type an address range. You can always paste or type data directly, as in the CyberChef web interface, and select if the data is a string, hex, or base64. To send a region to a panel, select it and use CyberChef → Send to CyberChef-A in the context menu:

Send to CyberChef context menu action

Recipe

To make your recipe, use the search bar to find an operation in the approximately 500 supported operations. The search uses fuzzy matching. For malware analysis, the most frequently used operations are XOR variants (also XOR brute force), byte operations such as shift and invert, AES and RC4 encryption, and hash algorithms. The full CyberChef catalog is available, for example protobuf decoding, to and from charcode, and CitrixCTX1 Decode. When you move the mouse over an operation, the plugin shows its documentation.

Operation search with documentation

You can put many operations in a recipe, and the result updates when you change a parameter. This works as in the web interface, but your data stays in IDA.

Recipe with Rotate left and XOR operations

Output destinations

When you have the correct transformation, you can send the output to different destinations. The simplest are the clipboard and a file. When you copy, you select the format (hex dump, hex string, C-style array, raw bytes, or plain string), so that you can paste the result into reports or other tools.

Output panel with destination buttons

Two destinations are specific to IDA. The first adds the decoded data as a comment at the source address. Use this to annotate encrypted strings without changes to the bytes in the database. The comment shows in the IDB what the data decodes to:

Decoded data as a comment at the source address

The second patches the transformed bytes into the IDB. Use this when you decoded an embedded configuration and want cross-references to its fields in IDA. When you apply types to the decoded bytes, such as a custom structure, IDA shows the data more clearly:

Decoded configuration patched into the IDB with a structure applied

Under the hood

The plugin does not port the operations from JavaScript to Python or C++. It runs the CyberChef JavaScript code in a JavaScript engine in IDA. This needs only a small amount of code, and the plugin can use the work of the CyberChef community and contribute back to it.

Some operations need a web browser or network access, so the plugin does not support them: HTTP request, DNS over HTTPS, Optical Character Recognition, and Add Text To Image. JWT Sign and JWT Verify also do not work, but JWT Decode works.

You can also use the CyberChef engine as a Python library. Give it data and a recipe as Python data structures, and get the result back:

For the background, see the blog post IDA Pro, Meet CyberChef.

Configuration

To open a CyberChef panel, select Extensions → Malware Analysis → Data Transformation → Open CyberChef or View → Open subviews → CyberChef, or press Shift + C. You can open up to 26 panels, named CyberChef-A to CyberChef-Z.

CyberChef has no settings. You select these options in each panel:

Option
Values
Default
Description

Input source

Manual Input, From Cursor, From Selection, From Location

Manual Input

From Cursor reads 256 bytes at the cursor and follows it. From Selection follows the selection in the disassembly and hex views. From Location reads a fixed address and length, and does not follow the cursor.

Input format

Text (UTF-8), Hex String, Base64

Text (UTF-8)

How to interpret manual input. Not available for the other input sources.

Address and length

hexadecimal address, decimal length or end address

length 256

The range to read in From Location mode.

Output format

Depends on the result type

Hex Dump for bytes, Pretty JSON for JSON

Bytes can show as Hex Dump, Text, Hex String (spaced or unspaced), String Literal, C Array (hex or decimal), or C Variable.

Output destination

Copy to clipboard, Save to file, Copy to IDB, Set comment

none

Copy to IDB patches the bytes into the database, and is available only for bytes output from the From Selection or From Location input sources. Set comment adds the output as a comment at the start of the input range, or at the cursor.

The input area shows only the first 256 bytes of the input, but the recipe gets all the data. A recipe stops after 30 seconds. CyberChef does not save the recipe, input, or input source. When IDA restores a desktop layout, CyberChef panels open empty.

If you have a question, an idea, or a problem, email support@hex-rays.com. The Malware Analysis team reads every message and replies quickly.

Last updated

Was this helpful?