INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Jobs from Indeed

Sniffing the data you are sending?

Sniffing the data you are sending?

(OP)
Is there a way of using VB6 to monitor what my computer is actually sending to the internet ?
Particularly when I have a browser open doing nothing or when I click on an object on the screen such as a link.


RE: Sniffing the data you are sending?

Well, yes. But it can be complex.

Easiest way is to install WinPcap and then an ActiveX control such as PacketX, which simplifies things a lot

Then something like the following:

CODE

Option Explicit

Private Sub Form_Load()
    PacketXCtrl1.Adapter = PacketXCtrl1.Adapters(1) ' Assuming only one adapter, and that this is the one we want to monitor
    
    ' Following 4 lines from PacketX example code
    '// Capture buffer parameters
    PacketXCtrl1.Adapter.BuffSize = 256& * 1024 '// 256 KB
    PacketXCtrl1.Adapter.BuffMinToCopy = 0
    '// Hardware filter and capture mode
    PacketXCtrl1.Adapter.HWFilter = PktXPacketTypePromiscuous
    PacketXCtrl1.Adapter.Mode = PktXModeCapture

    ' Start monitoring
    PacketXCtrl1.Start
End Sub

Private Sub Form_Unload(Cancel As Integer)
    PacketXCtrl1.Stop
End Sub

Private Sub PacketXCtrl1_OnPacket(ByVal pPacket As PacketXLibCtl.IPktXPacket)
    ' if the source of the packet is our adapter
    If pPacket.SourceIpAddress = PacketXCtrl1.Adapter.NetIP Then
        Debug.Print pPacket.SourceIpAddress, pPacket.SourcePort, pPacket.DestPort
    End If
End Sub 

RE: Sniffing the data you are sending?

Was this of any use?

RE: Sniffing the data you are sending?

(OP)
Thanks. Away on hols again. Will try when I get back

RE: Sniffing the data you are sending?

SO, back?

RE: Sniffing the data you are sending?

(OP)
Yes but just spent a week in hospital with a foreign virus!
It might be some time before I get back to programming.
Thanks anyway

RE: Sniffing the data you are sending?

>hospital with a foreign virus!

Doesn't sound good. Hope you are on the road to recovery.

RE: Sniffing the data you are sending?

(OP)
Recovered OK.
Damn foreigners! Probably arrived on a leaky boat?

RE: Sniffing the data you are sending?

Did you solve your sniffing problem?

RE: Sniffing the data you are sending?

Hello ...

RE: Sniffing the data you are sending?

(OP)
Yes I'm still alive thanks!
As I am approaching my 80th birthday I have given programming a bit of a rest for a while - too busy with other things!
I will get back to it when the nights get longer (it's summer here).
My only problem now is to find out how the retire from retirement. Whoever said I'd be bored when I retire was crazy!

RE: Sniffing the data you are sending?

You can use wireshark application as sniffing tool it uses (winpcap sniffing tool), you can download it here: https://www.wireshark.org/download.html
However, if you decided to implement it on VB6 you have to use dll and callbacks that is in Winpcap package.

for reliable solution it is highly recommended to use c++ as programming language, in this case you will find many Winpcap sample applications (with source code) to capture all traffic on your network

Wael
VoIP Expert
www.tele-finity.com

RE: Sniffing the data you are sending?

You need to understand Ted's history. He doesn't really want to packet capture, he doesn't want a 3rd party app; and he's not a C++ programmer

And it's only a year since he asked ...

RE: Sniffing the data you are sending?

(OP)
My how time flies (when you get old) but then maybe it's just as well?
Retirement seems busier than when I was working for a living but it is possible I just think slower.
Sorry I haven't got back to following this up but the need for it is now not so evident.

I suppose I will give it a go as soon as I get motivated by a vicious internet bug (again)

Thank you all for your interest and help.

RE: Sniffing the data you are sending?

I was beginning to worry, Ted. Hadn't see you on here for a few months. Hope all is well in sunny Australia.

RE: Sniffing the data you are sending?

Are you still out there, Ted?

RE: Sniffing the data you are sending?

(OP)
Yes, still alive. Thanks for your thoughts.
Just returned home from a 17,000 km three month round Australia trip towing our camper trailer with my 4wd.
Had a fantastic time only needing being rescued once by the State Emergency Service.
I had never visited the Aussie western desert areas before, the scenery equals anywhere else I have been (and that amounts to 33 different countries so far!). It is like being transported back in time 50,000 years to what the world would have been like BC (Before Computers).

I'll get back to this problem when I get a chance as I am still curious about how browsers actually work.

RE: Sniffing the data you are sending?

smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close