-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] HTTP Gzip payload decryption #163
Conversation
Hi @windhamwong, could you give some examples of bugs in |
I cannot provide a good sample for you to test out, but when the payload is too large or in a particular situation (I didn't look into it), it won't decrypt and prompt you saying "Input buffer is broken". I looked up the issues in its github, it has loads of issues but no one has an idea to solve it. Try to grab some HTTP response with gzip, you should see more than 50% of them are not working. Probably it happens in HTTP only. I tried all the way to decrypt the payload (including ways by modifying codes), but none of the current operation can do the job. |
Sample:
So, the hex converts the hex to plaintext. We can see the gzip encoded data in the response. When we try to do "Strip HTTP Headers" and "GunZip" to decode Gzip payload, it appears failed because there are few numbers before the header of Gzip payload. This is common in HTTP traffic and it stops the Gunzip operation to decode due to the incorrect data in the first few bytes.
|
@n1474335 Looking into imaya/zlib.js, it has multiple issues on non-Ascii language, i.e. Chinese, and large content decoding. I encountered the same issue when I was developing my operation as well. It often throws Input Buffer issue when the content is too large (Actually not large in practical usage, but zlib.js just can't handle). |
Hi @windhamwong, thanks for the extra information. Rather than creating a new operation, it would make more sense to modify the current |
I am currently using my own recipe. I found out that sometimes zlib.js is better than pako, likely 30% of the time, however, I am still looking for a better solution to solve the issue of failing GZIP decoding. |
Closing due to inactivity. We can reopen this if a clear decision is reached over the future of zlib operations. |
[ADD] Library Pako (https://github.com/nodeca/pako)
[ADD] Operation: HTTP Gzip Decrypt - Decrypts gzip payload in HTTP request/response and keeps the HTTP header in the result
As the original library CyberChef using (zlib.js - https://github.com/imaya/zlib.js) has different bugs that cause failing decrypting gzip. I worked out that Pako can provide better/faster/stable way to decrypt gzip. The operation I added utilize this library for gzip payload. Although there is still a minor bug when the payload is too long, the overall result is pretty good.
I do not own/participate on this Pako library.