Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8672329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:10:36+00:00 2026-06-12T19:10:36+00:00

I am trying to view the raw html being sent over the wire using

  • 0

I am trying to view the raw html being sent over the wire using scapy. The issue i am having is the the payload of the tcp packet isn’t printing as ascii.

def sniffer_callback(packet):
    print "[*] Got a packet"
    if(validate_packet(packet)):
            resend_packet(packet)
    else:
            resend_packet(packet)
             print "------------------------------"

def validate_packet(packet):
# Validate whether the packet came from the right domain    
     print "[!] Validating Packet"
      tcp = packet[TCP]
      print  tcp.payload

[*] Got a packet

[!] Validating Packet

HTTP/1.1 200 OK

Content-Type: application/json;charset=utf-8

Cache-Control: max-age=5

Content-Encoding: gzip

Content-Length: 121

Accept-Ranges: bytes

Date: Thu, 11 Oct 2012 23:45:45 GMT

Age: 4

Connection: keep-alive

P3P: CP=”CAO DSP COR CURa ADMa DEVa TAIa PSAa PSDa IVAi IVDi CONi OUR SAMo OTRo BUS PHY
ONL UNI PUR COM NAV INT DEM CNT STA PRE”

m�=
�0
���
MSkxqP�A��I�n������Fާ3���/HE����jFn�Vm���xk��ZL��b��m���������”h��=�L,�2�Q����

Thats an example of a packet i recieve but i am wondering how to view the entire packet not just the http header.

Thanks in advance for the help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:10:37+00:00Added an answer on June 12, 2026 at 7:10 pm

    The packet you chose is actually compressed using gzip. Notice this header:

    Content-Encoding: gzip
    

    You should be able to decompress it with the gzip module. A guide is available at:

    http://www.diveintopython.net/http_web_services/gzip_compression.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to render the following HTML using an MVC3 Razor View: <input
<text>@this.Html.Raw(</div><div class=\newDiv\>).ToString()</text> I'm trying to output </div><div class=newDiv> as-is in the view, but, it's
I'm trying to view the contents of a topic using activemq-admin . This is
I am trying to implement a Whitelist HTML Sanitizer using HtmlAgilityPack . I want
Using the following: MVC 3 VB.NET RAZOR VIEW engine Html Helper Class In my
I'm trying to hook into Google Analytics and have this: @using (Html.BeginForm(Register, Account, FormMethod.Post,
im trying to display items in a list view based on my raw query.
I am trying to view the source code of Wireshark to understand protocol analysis,
I'm trying to view a users tweets from my app but twitter responses with
I have an extremely simple page that I'm trying to view in the Facebook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.