Results 1 to 10 of 10

Thread: ws2_32.dll hooking

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    5

    ws2_32.dll hooking

    Hi,

    Basically, I have an app that communicates with a server. I need a way to monitor all the sent and received packets that are being transmitted through the app. I've been killing myself the past two days trying to figure a way to hook into ws2_32.dll to monitor these packets but I can't find a way! I'm not a VB expert, but I'm sure for someone else here, this is 5 minutes work!

    Thanks in advance!!

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: ws2_32.dll hooking

    It may or may not be 5 minutes work, but I suspect you're unlikely to get a response since the methodology required would lend itself to hacking into C/S applications which would not be something that anyone (with good intentions) would post on a public forum such as this (IMHO).

    I'm not suggesting for a moment that your intentions are questionable, just that somebody else reading the soultion may have other ideas!

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    5

    Re: ws2_32.dll hooking

    Since I would only need to log the packets being sent and received through my app, I can hardly see how it would be some sort of malicious software. Would it be possible for help via PM?

  4. #4
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: ws2_32.dll hooking

    The only constructive suggestion I can make is, that as it's 'your app' you modify it so that as data is transmitted and received you log the data to a file. I assume it's using Winsock so the necessary changes would be trivial.

  5. #5
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: ws2_32.dll hooking

    Thats what I was going to say, if its your own application then cant you just build the monitoring/logging functionality into your app?

    Also, I dont quite see why Doogle thinks this could be used in a malicious way as its just monitoring packets - I assume you mean literally just counting them or something, not inspecting their contents?

    As for hooking that dll, try the API forum and post whatever code you have got so far
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: ws2_32.dll hooking

    If you are looing for a packet sniffer then you may want to have a look at this, you could try modifying it to suit your needs.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  7. #7
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: ws2_32.dll hooking

    My concern was, and is, the use of the work "Packets". In order to get at Packets you have to be down at the TCP and / or IP levels as normally, things like Winsock never see a Packet, only the payload.

    If you're at the Packet level then you're able to see all Packets, not just the ones you want to look at. That presents a Security threat, since you can modify the contents, spoof the IP address etc. Not something we should (IMHO) be publishing here for all and sundry to see.

  8. #8

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    5

    Re: ws2_32.dll hooking

    I basically need a way to be able monitor the packets that get transferred between my app and the internet. IE: If I had a WebBrowser control and load a page, I should be able to see a few GET packets being transferred.

    I've seen this done in Delphi where they person hooked ws2_32.dll and monitored everything that gets sent between the application and ws2_32.dll. I just need a way to be able to do something similar in VB.

    If it is too "unsafe" to post it, can someone at least help me out via PM or MSN?

  9. #9
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: ws2_32.dll hooking

    Have you tried looking at the link I provided in post #6?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  10. #10

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    5

    Re: ws2_32.dll hooking

    Yes I did, but it's too complicated. I don't need to monitor ALL connections, just the data being transferred from my app and nothing else.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width