C Board  

Go Back   C Board > General Programming Boards > Networking/Device Communication

Reply
 
LinkBack Thread Tools Display Modes
Old 10-23-2005, 04:36 AM   #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.
muehl is offline   Reply With Quote
Old 10-23-2005, 08:10 AM   #2
Registered User
 
Join Date: Mar 2005
Location: Mountaintop, Pa
Posts: 1,059
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
BobS0327 is offline   Reply With Quote
Old 10-23-2005, 10:38 AM   #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.
anonytmouse is offline   Reply With Quote
Old 10-23-2005, 12:15 PM   #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???
rockytriton is offline   Reply With Quote
Old 10-23-2005, 11:58 PM   #5
tin
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.
tin is offline   Reply With Quote
Old 10-25-2005, 05:44 AM   #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?
muehl is offline   Reply With Quote
Old 10-28-2005, 07:47 PM   #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.
Xipher is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Packet processing in Socket programming, please help pumpkin Networking/Device Communication 5 05-28-2009 01:33 AM
segmentation fault while writing a packet to a pacp file Neminath C Programming 4 05-05-2009 05:35 AM
How to make a Packet sniffer/filter? shown C++ Programming 2 02-22-2009 09:51 PM
Global Variables Taka C Programming 34 11-02-2007 03:25 AM
Raw Packet (sorry tripple weird Post) Coder87C Networking/Device Communication 6 03-04-2006 11:34 AM


All times are GMT -6. The time now is 05:02 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22