Thread: Packet Interception(?)

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    14

    Packet Interception(?)

    theoretical question.

    There is a client and a server (on a TCP internet connection of coarse). The client is constantly recieving packets from the server. Packets are systematically sent back to the server with keyboard and mouse input into the client.

    What i would like to setup is automated packet responses, eliminating user input. To do this though..? I have a few ideas on how it might be done but I do not know the right solution. Assuming I don't have the code for the client, how could this be achieved?

    Thanks guys.

  2. #2
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Maybe I'm missing something here. But can't you just set up an infinite loop on the client to automatically respond to the server? I have done this many times to "stress test" C/S apps. Are you trying to emulate keyboard and mouse movement as input to be sent to the server?

    Bob

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Welcome to the forums!

    1. Monitor client output with Ethereal.
    2. Emulate with a socket.

  4. #4
    Unregistered User
    Join Date
    Sep 2005
    Location
    Antarctica
    Posts
    341
    two different ways Ive done packet filtering in the past, the harder way (but better way) is to write an NDIS filter driver. Don't count on getting much good info on doing this here, or anywhere for that matter. The easier way is to write an LSP (Layered Service Provider), you can use that to filter all winsock calls. It's still a pretty complicated process, but it's all done in user mode. You can only filter things that go through winsock so this will limit you to TCP/IP, it won't filter things like IPX/SPX, but who the hell uses that anymore anyway???

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    12

    Post The Interceptor Principle #1

    Since your subject says packet interception, I'm assuming you want a 3rd host to get the packets and reply. You can use the pcap library to capture the packets in promiscuous mode. The library supports filtering too so you can get just the packets you need.

    Once you've got a request, you can create a RAW socket, create your own IP header to use the IP of the actual client, build the TCP header, attach the payload and send the 'automated' keyboard and mouse values.

  6. #6
    Registered User
    Join Date
    Oct 2005
    Posts
    14
    cool.. this is good stuff. i'll need to do some background work but i've got my head around it thanks! one more question though. say you build or modify outgoing packets.. this is good but at the same time i want the client to react. like moving the coordinace of a sprite in an online game. i want the client and server both react to the automation.


    do you know what i mean?

  7. #7
    Registered User
    Join Date
    Sep 2004
    Posts
    197
    yea, sounds like your trying to cheat to me, but then again, thats me.
    If any part of my post is incorrect, please correct me.

    This post is not guarantied to be correct, and is not to be taken as a matter of fact, but of opinion or a guess, unless otherwise noted.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Packet processing in Socket programming, please help
    By pumpkin in forum Networking/Device Communication
    Replies: 5
    Last Post: 05-28-2009, 01:33 AM
  2. Replies: 4
    Last Post: 05-05-2009, 05:35 AM
  3. How to make a Packet sniffer/filter?
    By shown in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2009, 09:51 PM
  4. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 03:25 AM
  5. Raw Packet (sorry tripple weird Post)
    By Coder87C in forum Networking/Device Communication
    Replies: 6
    Last Post: 03-04-2006, 11:34 AM