Click here to Skip to main content
15,889,833 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
I want to list all incomming/outgoing connection

Authorised / UnAuthorized connection both

Help me.
Posted
Comments
Sergey Alexandrovich Kryukov 21-Feb-12 0:53am    
Not a question. And not clear.
--SA
Member 8654809 21-Feb-12 1:03am    
Suppose a Novice PC user download application/song(Suppose Linkin Park album mp3), then that application/song tries to access a server or broadcast his information to an IP address.

I want to catch these kind a connection. Just alert user, if user want to diconnect. then user can disconnect.
Dave Kreskowiak 21-Feb-12 9:50am    
There's no way to do this. You have no ability to determine what is and what isn't a valid connection. There's no such thing as authorized or unauthorized as every program that is launched by a user runs AS the user.

The only way to determine what a bad connection would be is to maintain a list of known-bad IP Addresses. Since this is impossible (Google for "Enumerating Badness") to maintain, you can't possibly determine what is and isn't a bad connection.


Playing an MP3 file will not try to initiate a connection to anything. Since it's just data, Media Player or anything else playing it won't just spontaneously try to create a connection. They don't execute code contained in the MP3 file.

Use netstat command. It will list all connections.
These links may help.. netstat man page and netstat on windows.

But form your comment "I want to catch these kind a connection. Just alert user, if user want to diconnect. then user can disconnect.", I think a proxy or firewall software can solve your problem, try ashampoo firewall, it is free, and block whatever you want to block.
 
Share this answer
 
v3
Since you posted your question with programming language tags, I assume you what to build a program that informs the user.

To do so you can use for example (Win)PCap. It offers a api for you're program that allows you to capture / monitor the network traffic. See http://en.wikipedia.org/wiki/Pcap[^]

Regards
Piet
 
Share this answer
 
In addition to the advice above, you need to buy TCP/IP Illustrated, Volume 1: The Protocols.

Essentially you're asking how to write a firewall and intrusion detection program. you have a wide range of protocols that you'll need to understand, as it's not as simple as just watching for connections. On a modern OS, there are lots of connections going in and out of your PC. Making sense of them is a huge task.

The netstat advice above, is a good start in getting a handle on what you're PC is already doing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900