-
Notifications
You must be signed in to change notification settings - Fork 4
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
Binary guide #26
Binary guide #26
Conversation
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 32.2%, saving 32.37 KB.
15 images did not require optimisation. |
src/concepts/essentials/binary.md
Outdated
@@ -0,0 +1,74 @@ | |||
# Dealing with Binary Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would create a new concept section Backend runtime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sytten "Dealing with Binary Data" is a lot more meaningful than "Backend runtime" for a user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Section is the parent of the concept
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah gotcha, makes sense now 👌
src/concepts/essentials/binary.md
Outdated
} | ||
``` | ||
|
||
The intention is to send the byte `\x85` with a binary value of `[1000 0101]`. However, JavaScript is interpreting it as the Unicode code point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code point C2 85
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the goal was to send just the byte 85?
src/concepts/essentials/binary.md
Outdated
- Second byte `85`: `[10000101]` <span style="color: #EBEBF599; font-style: italic">(continuation byte)</span> | ||
::: | ||
|
||
This will result in it being interpreted as the unprintable `NEL` <span style="color: #EBEBF599; font-style: italic">(Next Line)</span> character, which will be replaced with `�`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence plus the tip make no sense in context, it was probably moved around or something before it was removed.
You just said that this will send C2 85 and NOT just 85. This exemple is when the actual character 85 is sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to show what happens if you dont deal with bytes correctly, then you would should xxd capture with C2 85
src/concepts/essentials/binary.md
Outdated
This can result in security bypasses. For example, if a validation filter is matching against the `/admin` path, if it receives `/admin…` it may allow the request to pass through. | ||
|
||
To learn how you can use raw bytes in Caido plugins, click [here](/guides/components/utf.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont care about that in this concept
src/concepts/essentials/binary.md
Outdated
<img alt="C2 85" src="/_images/rust_conversion.png" center/> | ||
::: | ||
|
||
To preserve the byte, the raw byte must be used instead. By sending it raw, it is invalid UTF-8. When the target receives invalid UTF-8 it may fallback to a different encoding standard to try and make sense of it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a guide, but we can give at least one example like:
// path is /admin
let path = [...req.getPath({ raw: true }), 0x85];
req.setPath(path)
src/concepts/essentials/binary.md
Outdated
::: | ||
|
||
To preserve the byte, the raw byte must be used instead. By sending it raw, it is invalid UTF-8. When the target receives invalid UTF-8 it may fallback to a different encoding standard to try and make sense of it: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move here the NEL explanation + screens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So keep everything but just move it underneath this? Starting at the "Example" header?
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 38.7%, saving 61.97 KB.
19 images did not require optimisation. |
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 46.2%, saving 55.01 KB.
18 images did not require optimisation. |
No description provided.