Wireshark does not capture python POST request
Asked Answered
T

1

8

I have a python script which triggers a http POST request using standard libraries. I'm trying to view and debug the requests content by capturing in wireshark.

The request is sucesfull because I recieve the correct server response. In wireshark I listen on all available interfaces but cannot find the request.

I have also tried some filtering options like http filter but the request was still not found.

I have Ubuntu installed and the server host is not localhost

How can I find the request?

Telescopy answered 11/3, 2015 at 9:20 Comment(3)
Information about your OS and the server host(is it localhost?) make sense. Please add it.Durning
Have you found any solution for this ?? Im facing the same issue on JavaScrivner
"the server host is not localhost" I.e., the server host is another computer - you're not sending the request to a server on the computer that's running the Python script?Josiahjosias
W
2

You are unable to capture HTTP POST request because you are using Wireshark http filters. Do not filter traffic with HTTP filters, instead of that use website/URL IP address.

I have just tried to filter the traffic with the help of Wireshark and found that I can filter it with the help of IP address.

Refer below link, https://www.w3schools.com/python/ref_requests_post.asp

enter image description here

enter image description here

Use Filter : "ip.addr==192.229.133.221"

enter image description here

I can filter the packets, but its TCP encrypted traffic and we cannot get additional information without decryption.

enter image description here

Refer below answer, it will help you to find the IP address of your URL.

How to use filters in the wireshark?

If you are not comfortable with it, use “Microsoft Network Monitor” tool. It shows applications name along with IP address and ports.

enter image description here

Once you know the IP address and ports used, you can filter the traffic with the help of Wireshark easily.

Note:- I will suggest instead of "Wireshark" or "Microsoft Network Monitor”, please use fiddler. Refer below link,

How to capture Visual Studio Code traffic through Fiddler?

Whispering answered 16/2, 2021 at 18:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.