-
Notifications
You must be signed in to change notification settings - Fork 12
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
Offset between selection and what is sent to stdin when using 'Process Selection' and multi-byte character encoding #26
Comments
In function
with
I get the expected result, but this assumes the contents is UTF-8 encoded, which depends on what the HTTP Server sent. |
I did further tests and it seems Burp is using some sort of 'auto-detection' technique to check if the contents is utf-8 or not. A strategy would be to use the same technique: Try to decode the whole message as utf-8. If it fails , use |
submited PR #27 |
Thanks for the detailed report and the PR; with that being merged, I'll close this as well. |
Hi,
Using Piper with a 'Context Menu Item' definition
sh -c "cat >/tmp/Piper"
, which basicly dumps to a file what is sent to it, I noticed that in some cases, when using it from the Context menuExtensions>Piper>Process Selection
, the contents of the file is different than what I have selected: it has the same length, but starts a few characters before the selection.For instance if the sentence "Hello World" is in the Reponse tab, I select "World", and get "Hello" sent to the script.
By trial and error, I managed to understand that it occurs when the HTTP Response is encoded in utf-8 (
Content-Type: text/html; charset=utf-8
), and only in portions of the body that appear after characters that take more than one byte to encode (such as 'é' or 'è'). In fact I have noticed that there will be an offset of one position for each of those specific characters that appear anywhere before the selected text.So if the body contains
Nous sommes désolés de vous voir partir
,If I select anything before
désolés
, there is no offset. If I select the wordpartir
, the stringr part
will be send to the script, as if the selection had been made 2 characters ahead.The text was updated successfully, but these errors were encountered: