Solved

Monitor Sockets

Posted on 2002-06-11
9
257 Views
Last Modified: 2010-04-04
Hello,

How can I monitor ALL outing sockets from my computer,
And get:
 * what program sent the socket
 * Where to its senging
 * port of the socket
 * And The message
0
Comment
Question by:S_Warrior
9 Comments
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
0
 
LVL 2

Expert Comment

by:ivobauer
Comment Utility
Hi, listenning...
0
 
LVL 1

Expert Comment

by:barbourwill
Comment Utility
There is a windows function called GetTcpTable which gets info on all incoming and outgiong TCP connections/connection requests and open ports.
0
 

Author Comment

by:S_Warrior
Comment Utility
barbourwill:

What Unit have the GetTcpTable?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:barbourwill
Comment Utility
its not in any of the delphi units, heres some of the prototypes etc:

  const
    MIB_TCP_STATE_CLOSED = 1;
    MIB_TCP_STATE_LISTEN = 2;
    MIB_TCP_STATE_SYN_SENT = 3;
    MIB_TCP_STATE_SYN_RCVD = 4;
    MIB_TCP_STATE_ESTAB = 5;
    MIB_TCP_STATE_FIN_WAIT1 = 6;
    MIB_TCP_STATE_FIN_WAIT2 = 7;
    MIB_TCP_STATE_CLOSE_WAIT = 8;
    MIB_TCP_STATE_CLOSING = 9;
    MIB_TCP_STATE_LAST_ACK = 10;
    MIB_TCP_STATE_TIME_WAIT = 11;
    MIB_TCP_STATE_DELETE_TCB = 12;

  type
    PMIB_TCPROW=^TMIB_TCPROW;
    TMIB_TCPROW = record
      dwState : LongWord; //state of the connection
      dwLocalAddr : TLongWordBytes; //address on local computer
      dwLocalPort : TLongWordBytes; //port number on local computer
      dwRemoteAddr : TLongWordBytes; //address on remote computer
      dwRemotePort : TLongWordBytes; //port number on remote computer
    end;
    PMIB_TCPTABLE=^TMIB_TCPTABLE;
    TMIB_TCPTABLE = record
      dwNumEntries : LongWord; //number of entries in the table
      table : array[0..150] of TMIB_TCPROW; //array of TCP connections
    end;

    {api declarations}
    function GetTcpTable (pTcpTable: Pointer; var pdwSize : Longword; bOrder : LongWord): LongWord;stdcall;
    function GetTcpTable; external 'iphlpapi.dll' name 'GetTcpTable';
   
0
 
LVL 1

Expert Comment

by:barbourwill
Comment Utility
i'm not sure how you get to see the actual data being transmitted, you probably need to hook winsock or something.


0
 

Author Comment

by:S_Warrior
Comment Utility
barbourwill:
what is TLongWordBytes?
0
 
LVL 1

Expert Comment

by:pnh73
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from barbourwill

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
Comment Utility
Force accepted, PAQ & refund
(The expert never came back for further assistance)

** Mindphaser - Community Support Moderator **
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

7 Experts available now in Live!

Get 1:1 Help Now