Friday, May 10, 2013

Use TCPMon

This is just quick note on TCPMon, an open source tool. Sometimes it can prove invaluable. Yet, I can totally forget where to get it and how to use it. So some quick notes:

1. I think there are multiple versions of this tool. I merely grabbed the oldest one that still works like a charm: http://ws.apache.org/tcpmon/download.cgi (2006, that's ancient!).

2. For the heavy duty TCP monitoring, Wireshark (Ethetreal used to be called) is more powerful. However, TPCMon has its niches:
  • If i remember correctly, Wireshark cannot sniff local traffic (when you want to monitor something from localhost to localhost). But that's where TCPMon shines. It's light weight and can monitor local traffic
  • In fact, TCPMon works a proxy, you direct your TCP traffic to TCPMon, then it forwards to your destination, and you can see the traffic in the TCPMon console.
3. Install and run is like no brainer. Install is just unzip, to run it, it has a batch command tcpmon.bat.

4. Simple use case - I am testing a local web service client, which calls an OSB proxy service on local port 8011 with WS-security header. OSB log shows the security violation, but i can't see what i'm missing in the SOAP header. Here is how i set up TCPMon to check the payload:

On Admin tab, i set
  • Listen port # to 8080 (that's the port TCPMon will monitor).
  • hostname "127.0.0.1"
  • target port# 8011 (TCPMon forwards everything to 8011, which is my OSB port)
  • click add, then you'll see a new tab: port 8080
Let's test it:

My OSB fooPS has a WSDL: http://localhost:8011/OWSM_Demo/fooPS?wsdl

You use http://localhost:8080/OWSM_Demo/fooPS?wsdl to access your fooPS proxy. If you test it with SOAPUI, you'll see your payload show up in the TPCMon console (under "port 8080" tab).

that's all!

 

No comments:

Post a Comment