Electronic – arduino – Hacking a mouse with an Arduino

arduinohackingmicrocontrollermouse

I was challenged in university to Hack a mouse in the following manner:

system
What is happening:
computer1 has an optical mouse connected to it, and this optical mouse has been hacked in one way or another so computer2 can send commands to the Arduino which in turn sends commands to the optical mouse that control the cursors movements in computer 1.

Basically all the drivers and all that stuff that the optical mouse of computer1 had is not being changed. I have to hack into the mouse at some point to change the information that is being given. It could be at the sensors (sending predesigned images to them to provoke specific movements) or it could be somewhere after the information from the sensor has already been analysed. Basically computer1 has no idea the Arduino is interfering in any process, very under the radar.

I am not sure however how I would go about doing this… hacking the sensor would require me to design images that would be sent to the mouse…. not sure how the hacking there would work. If I were to hack the end result of the images being analysed, I would have to find out at what point is the mouse sending this information (and over which peace of circuitry) and find a way of intercepting and replacing this information.

Which of the 2 options do you guys believe is more realistic and why?

Best Answer

Made this an answer rather than long comment:

Running with Wouter's suggestion that a PS/2 (serial) mouse would be much easier than USB: You read the serial data coming in from the mouse, examine it, and either pass it straight along to the PC or modify it for your own eviiiil ends. As long as the data is valid, the PC has no way of knowing it's not what the mouse is really doing.

This is a classic man-in-the-middle attack: http://en.wikipedia.org/wiki/Man-in-the-middle_attack

Point of interest: I regularly see issues where a serial GPS or USB-to-serial adapter is plugged into a Windows PC at boot, some data (be it GPS NMEA data, serial console output from a development board, etc.) received on a serial port by Windows at boot-time can be mistaken for a PS/2 mouse by the Windows driver and result in a minute of madness with pointers shooting around, things randomly being clicked on, menus appearing, etc. until either cables are yanked out or the machine is rebooted.