I am developing a python messenger client but I feel this is more targeted to superuser than StackOverflow. My server application seems not to get the data sent from time to time, so I want to see what exactly is being sent each time over a specific port such as 42222. I tried wireshark but I am having trouble filtering data on this port specifically.

link|improve this question
feedback

2 Answers

up vote 3 down vote accepted

Your WireShark solution will work, you just need to use the correct filter:

port 42222

You may want to read the WireShark wiki on capture filters, there is an abundance of useful filters you can use.

link|improve this answer
if you specify only the source port you won't be able to see replies, and if you only specify dest port you won't see requests – nos Sep 5 '09 at 21:45
@nos, ahhh, don't know what I was thinking... You're absolutely right. (To avoid confusion, I removed my earlier comment assuming "that only a local or remote port is to be monitored".) By the way: a similar display filter would read tcp.port eq 42222 or udp.port eq 42222 (where things like tcp.dstport would only show part of the communications, like @nos noted). – Arjan Sep 6 '09 at 14:38
feedback

Download and run Nirsoft's SmartSniff (it's 'portable', so no installation required), press CTRL + F8 to open the Filter and enter the folowing line:

include:local:tcp:42222

now adjust the Options (e.g. Display Capture Time, Display Outgoing Data, etc.) to your likings. you may create a HTML report from the View menu.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown