Add Deobfuscation operation - minusone #2119
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello CyberChef team π¨βπ³
I'm currently working on minusone, a Tree-Sitter based deobfuscation tool.
For now, only Powershell is supported, but we plan to work on several others like VBS and JavaScript.
Under the hood, minusone relies on different deobfuscation rules that are applied in a specific order to the tree-sitter tree.
See the Powershell rule set here.
When dealing with obfuscation, Cyberchef has always been a must have for me, because obfuscated scripts often involve data pre/post-processing, which is really easy to do/show/explain with Cyberchef.
On the other side, minusone adds a very powerful cleanup for Powershell obfuscation that is not available yet in Cyberchef.
Combining both tools would be very interesting to qualify easily obfuscated scripts.
Minusone is written in Rust. Thanks to WASM32-WASIP2, it's possible to compile a minusone WASM component, that I then included in CyberChef.
Hence, the module is very simple by itself in this PR has all the complexity is handled with the minusone library itself.
I put the Deobfuscation operation in the
Forensics
category.I create a new module, named
Obfuscation
to load it, because I didn't know where to put it (Code
maybe?). Hence, remember tonpm run build
this PR beforenpm start
, as a new module was created.There is just one bug remaining:
When loading the operation for the first time, I get an error and the output returns
[Object object]
.But as soon as I start writing in the input window, the operation loads correctly and it's working like a charm.
Here is a screenshot of the bug on Firefox:

Again, once I start writing in the input, the deobfuscation operation works as excepted.
I have trouble trying to debug this issue, so if you have any idea, please reach me.
I added also two tests to ensure the operation behaves normally.