0

I am working on network analyzer. I have used code available form http://www.binarytides.com/python-packet-sniffer-code-linux/. The data section output of the program is as follows:

Content-Type: text/html; charset=iso-8859-1

M�Ak�0 ���ZO�aQz��▒�&e�� �s�эU���V:���� ����'qW�oձ.�U�UP7/�~ ��}�v��*n�<���J&��W/�%mb��$7��a���I�����G���D�RYO�&�Gx֗�uC▒~t�!B�7�.@ !� ��>�6��yԭ%��X9�7�i�i ��w���

�� O��?6�]��l���K��

I need to convert this raw data into readable form and then analyze the data.I am using using python 2.7.

2
  • 1
    Looks like you are receiving some kind of Unicode text, and not really iso-8859-1 as the header says. Commented Feb 19, 2013 at 6:26
  • Content-Encoding: gzip Content-Length: 235 Keep-Alive: timeout=5, max=97 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1 Can any one help me to decode the packet? Commented Feb 22, 2013 at 3:04

1 Answer 1

1

If you look at the Content-Encoding header, it says gzip. This means that the web-page is compressed using the gzip algorithm. As such it's binary data that you can't print out, you have to uncompress it first.

You can use the Python gzip module for that.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes I have uncompressed it using gzip Python module but the result after the uncompression and conversion is not working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.