Intercepting/Modifying/Viewing Packets?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Intercepting/Modifying/Viewing Packets?

  1. #1
    Join Date
    Jun 2011
    Posts
    6

    Talking Intercepting/Modifying/Viewing Packets?

    Hello all!

    I am new to network programming so forgive my ignorance.

    I have a question regarding packet intercepting/viewing, etc.

    I have a process that runs on my PC. This process communicates to a server using a fixed IP address (I cannot modify it).

    What I want to do is write a program that intercepts the packets going out to the server and allows me to view and or modify the packets. And then the reverse, I want to intercept the returning packets then forward them back to the process.

    If I cannot change the IP address / port that the PC process uses how can I "redirect" the packets into my interceptor application? I know there is such a thing as port forwarding that you can setup with your router but I don't think what I am doing is port forwarding. (Or maybe it is?)

    Basically here is what I need to do.

    [Current]
    PROCESS -> SERVER
    SERVER->PROCESS

    [NEW]
    PROCESS->INTERCEPTOR->SERVER
    SERVER->INTERCEPTOR->PROCESS

    If I could modify the IP address that the process uses I could just change it to connect to my "interceptor." I believe that the fact that I cannot change the IP address is the clutch of the problem here.

    Also note that I don't want to just "sniff" the packets. Sniffing would allow me to see the packets but I need to modify them as well.

    I hope I was able to describe what I am looking to do well enough for anyone to point me in the right direction.

    Perhaps an image will help explain what I need:



    Thanks in advance!

    Jan
    Last edited by tackyjan; May 16th, 2012 at 02:42 AM.

  2. #2
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,553

    Re: Intercepting/Modifying/Viewing Packets?

    The answer (if there is one) is heavily dependent on the identity of the operating system. Which one are you using? Windows? Linux? etc?

    If Windows, then look at LSP (Layered Service Provider). You can write an LSP and insert it into the network stack. The network stack goes through all LSPs in the stack, and gives each one the opportunity to do something to the network traffic.

    But be forewarned: LSPs are complicated, and since they can be the source of malicious software, many anti-virus programs will not allow their installation.

    You stated that you are new to network programming. This task is very complicated, and I might humbly suggest that it might be far beyond your current capabilities.

    Mike

  3. #3
    Join Date
    Jun 2011
    Posts
    6

    Re: Intercepting/Modifying/Viewing Packets?

    Quote Originally Posted by MikeAThon View Post
    The answer (if there is one) is heavily dependent on the identity of the operating system. Which one are you using? Windows? Linux? etc?

    If Windows, then look at LSP (Layered Service Provider). You can write an LSP and insert it into the network stack. The network stack goes through all LSPs in the stack, and gives each one the opportunity to do something to the network traffic.

    But be forewarned: LSPs are complicated, and since they can be the source of malicious software, many anti-virus programs will not allow their installation.

    You stated that you are new to network programming. This task is very complicated, and I might humbly suggest that it might be far beyond your current capabilities.

    Mike
    Windows 7 64 bit.

    Yeah, perhaps it is beyond my capabilities, at least for now.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center