How to get Http Body Message From a TCP packet in C#

i'm working on a tcp listener project on c#. I'm using pcap.net for packet capture. But when i'm trying to get the http message with such command like tcp.Http.Decode(Encoding.UTF8), i get some encrypted script. I'm listening on sites that not using SSL protection. I tried tcp.Http.ToMemoryString() then decode it with UTF8 with bytes I can get the Http header properly but i cant get the HTTP message in a readable form. Any ideas how can i do it or am i missing something?

Upvotes: 0

Views: 937

Answers (1)

brickner
brickner

Reputation: 6585

You should use the HttpDatagram.Body property to get the body.

This would return the parsed body part of the HTTP packet.

Note though that you are parsing a single packet, so you will only get the data from that packet, which might not contain the entire HTTP response body.

Upvotes: 1

Related Questions