Solved

TCP/IP Port Data Capture

Posted on 2002-03-26
9
1,186 Views
Last Modified: 2013-11-13
Hi,
     I need to be able to capture data from a app that gets data from a server on a tcp/ip port. I tried winsocks but I get an error trying to listen to a port that is in use. There must
Be some way to capture the string data from that port so I can use it in my program. Any help would be great.

Thanks
Mark
0
Comment
Question by:ShockWave
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:baltman
ID: 6897603
Well, the only thing I can think of right now, is that you change the port number on the application you are trying to capture data from. Once you did that, the port is available for you to use  and capture/manipulate the data. If your other application still needs the data, you could configure your winsock application to send the data it just received to the application's new port and it should be fine....

What are you specifically trying to do? With some more details, the experts migt be able to do a little more....

hope this helps!

BA
0
 
LVL 2

Expert Comment

by:polygon
ID: 6897620
If the port is used by another app, you have to change it...

If not, you are most probably forgetting to close it. So the first time you start your app, it works but then when you stop it (ot get some error), the port does not get closed and each time you try again, you get port in use error.

the only way to get going again is to restart the machine and take care of closing the port at the end of your program...
0
 

Author Comment

by:ShockWave
ID: 6897661
Thanks for the responses I can not change the apps port number it is not my app.. What I am trying to do is capture data that is going to the app so I can search the data for flagged keywords.
0
 
LVL 1

Expert Comment

by:baltman
ID: 6897736
Well, I think we got some bad news for you in that case, because if an address and port are in use, you can not open it in VB's WinSock Control...

You could do some re-routing of that app's data by setting routes on the port number to your winsock application and then let your winsock application re-route it to the application. You could use a simple firewall (TCP Mapping) for that...if you have the ability.

BA
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6898324

Sounds like you need a packet sniffer.  Two applications cannot bind to the same port on the same machine.  I think I remember seeing some rudimentary packet sniffer on

http://www.planetsourcecode.com

Good luck!
0
 

Author Comment

by:ShockWave
ID: 6900064
CodeWizrd,
     I downloaded a packet sniffer and it captured all the data that I needed but could not find any source code or info on a packet sniffer. If anybody has any info
On packet sniffer links for info on how to code a packet sniffer program or actual sorce code you will get the points.  Thanks Again CodeWizrd.
0
 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6900350

Shockwave,

I went back and took a look and was unable to find any vb source for a packet sniffer.  I did find, however, source for one written in C for Windows.  Here is the link:

Download:
ftp://ftp.maticad.it/pub/misc/ntsniff.zip

Info:
http://www.freecode.com/projects/ntsniff/?topic=37,175,248,255

Hope this helps...

Rich

0
 
LVL 1

Accepted Solution

by:
CodeWizrd earned 75 total points
ID: 6900369

Oops

Shows me that I should check my links before I post them...

This page:

http://www.tlsecurity.net/windows/ids/sniffer/

Shows info and links to multiple packet sniffers for windows.  2 of them (including ntsniff from above) include source code.

Rich
0
 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6900378
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now