-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Garbled output - possible character encoding issue #954
Comments
Could you try downloading the response body as-is (browser devtools -> reload page -> network tab -> find the document request (first) -> copy as curl -> run it and save into file) and feed it to Also please compare the headers returned through Warpgate and when accessing the page directly |
I'm remote from my lab today but I have been able to gather some information. I've attempted a few different file typing/identifying methods to see if it is 'compressed' or another file type, but everything is returning it a generic binary data, so I don't believe it is a mistyped file/return. Comparing the headers at the browser you can see that there is a difference in the content-type. Warpgate returns Of course this doesn't make too much sense why this would be causing some issues, because the webpage itself includes the meta charset of utf-8 unless there is some weird browser or Warpgate interaction (stepping well out of my comfort zone here). But that said, I have this issue on Windows and Mac under Firefox and Chrome (this testing/output from Windows Firefox). I can't recall if I have tested under MacOS Safari but I can confirm same behavior on IOS Safari. |
Is there a chance you could run tcpdump on the server side to capture the traffic directly between Warpgate and Fortigate? |
The "Response from device" above is a packet capture (loaded into wireshark) captured on the FortiGate, is that sufficient? I came provide that. I could try and capture on my Docker host but would be trickier as Docker and FortiGate are both VMs on the same physical host, and presumably show the same being direct without anything between them. |
Thanks for the project. Been using it in my home lab for a little while now and experimenting with its use in my work environment where I have unfortunately found an issue. I have had a search here on GitHub and on Internet in general but haven't found anything similar.
When attempting to access Web GUI for one particular device 'brand', regardless using HTTP or HTTPS on the back end results in 'garbled' output.
![image](https://private-user-images.githubusercontent.com/32225542/308187605-f87d9e9e-0c07-4a88-a97b-b8921116d7b6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNjU4MjUsIm5iZiI6MTcyNjE2NTUyNSwicGF0aCI6Ii8zMjIyNTU0Mi8zMDgxODc2MDUtZjg3ZDllOWUtMGMwNy00YTg4LWE5N2ItYjg5MjExMTZkN2I2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEyVDE4MjUyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY3ZTk0ZmIzZTlhNjBlNTllNTUxOWMyYmZlMWY5NGM3MjVhZDExZTY2MjYzNTU1OWYyZGUzYTgzN2NlM2I5ODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Lk1E0qo5t_lKYDglxJlME23eHBd1SU1ashRsUKPVRjk)
Having a look at this made me think it was a character encoding mismatch. So I decided to capture the packets between the device and Warpgate (using HTTP to get 'clear text') and from the packet capture I can see the expected HTML.
![image](https://private-user-images.githubusercontent.com/32225542/308188506-6fb3d5d8-8af5-4338-90fb-bb751cabd590.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNjU4MjUsIm5iZiI6MTcyNjE2NTUyNSwicGF0aCI6Ii8zMjIyNTU0Mi8zMDgxODg1MDYtNmZiM2Q1ZDgtOGFmNS00MzM4LTkwZmItYmI3NTFjYWJkNTkwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEyVDE4MjUyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0NjlhMTU0ZWVhNjc0MGY3NzUzMTFkOTY4M2E2MDgyZWExNDdhZGM2MDAwMmU3MWYwMDNlZWZmMzFmODJkZjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.g1jDuWX-fFf4r7nT5ci5nTV1OT0St88NRDXv_Wd-uVg)
In below example, 192.168.0.14 is my lab docker host and 192.168.0.118 is my lab device I am wanting to connect to (FortiGate firewall)
Looking in Docker logs there is no obvious errors or issues. You can see 200 returned for the page (which is presented as garble) and the favicon 404 (which is expected).
![image](https://private-user-images.githubusercontent.com/32225542/308199586-3810b6fa-cbcd-49a9-9044-fc91c6316146.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNjU4MjUsIm5iZiI6MTcyNjE2NTUyNSwicGF0aCI6Ii8zMjIyNTU0Mi8zMDgxOTk1ODYtMzgxMGI2ZmEtY2JjZC00OWE5LTkwNDQtZmM5MWM2MzE2MTQ2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEyVDE4MjUyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAxYzA1ZTdkMjA2NzExYjdkNDUwM2Q4MzAxMWFhNGNhNzA2NTRiZTFkYzEyMjM5NzJjYjNkYmUxYjQxM2VmYWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.h4yrKqAE8MNIEmot-6MC93Q0GEqVIFPV0Q9tTx1f0Zo)
I haven't seen this problem in the handful of other systems I have configured before, and appears to be isolated the this brand so far, affecting 3 different that I have tested with. Other thought I had was the body is gziped and Warpgate not handling this correctly but I have other systems/servers that gzip encoded without issue (and given it is widely used), and the returned garble doesn't appear to be valid GZIP data.
I am unsure if there is anything obvious that I have missed here but I have looked at it over two different times/sessions and haven't picked up anything else. I have no experience in Rust, but basic programming and Docker knowledge. So any pointers help or guidance would be appreciated!
The text was updated successfully, but these errors were encountered: