![]() |
|
[Python] Raw socket returns raw hexadecimal data? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Raw socket returns raw hexadecimal data? (/showthread.php?tid=5538351) |
Raw socket returns raw hexadecimal data? - Infamia - Jan 30, 2017 I'm not that inclined with raw sockets, so I'm trying to make a browser using them; sounds kind of stupid, but it's a kind of personal journey since [INSERT FEW YEARS AGO THIS AND THIS HAPPENED]. But on my quest I have encountered a discrepancy -- here is my code; Code from socket import *Not necessarily the prettiest, but here's my problem; ![]() A t and a domino is returned as the supposed-to-be HTML, now I did my Googling; I'm not that contradictory of myself to constantly tell people to Google it and never do so myself -- the closest I got to figuring out what this was is a Stackoverflow/exchange post claiming it's a binary frame of some sort; here's the raw data from the 't/domino' combination; Code \x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\xb3Q\xd4\xd5U\xf0H\xcd\xc9\xc9\xb7W\xd0\xd5\xb5\xe3\xb2\xc9\xccMW(.J\xb6U*\xc9HM\xcdK\xd1+\xc8KW\xb2\xe3\x02\x02\x1b\x90\xca\xf0\x8c\xc4\x12\x88B\xb8\x90\xa7By~^Jj\x91B9PN!\xb3X\x01H\x02\xf5*\x005+\xe4\xa7)$\xe6\xe4\x00\xb9\x99y\xe9\xc5\x10\xf3AZ\xbc=\x83\x83\xe1\x86 L\x8a\x89A(14A\xb0\xf5\xf5\xc1l\x00\xe0Q\xd3\x01\xab\x00\x00\x00Maybe I'm just retarded, but I can't seem to figure out this issue :( Thanks for any help in advance. * - nooelec - Jan 30, 2017 Code "Accept-Encoding: gzip,deflate\r\n",The server is probably returning gzip encoded data in the response, hence the binary shit. Also, that is not a "raw socket", it is a TCP connection you are doing. Edit: Definitely think it is gzip. The "\x1f\x8b" is indicative of that. * - (╯°□°)╯︵ ┻━━┻ - Jan 30, 2017 (Jan 30, 2017 01:25 PM)nooelec Wrote: Yeah I think this is right. Your response encoding is messed up. * - Infamia - Jan 30, 2017 (Jan 30, 2017 01:25 PM)nooelec Wrote: Oooh, alright; thanks. I'll look into it. ![]() YESSS I LOVEE YOU ALLL |