Sunday, September 20, 2009

A Diversion into Mischief

Ever notice how there are PILEs of old keyboards around? Every new computer comes with a new keyboard... but noone ever throws the old ones away!

They are always around work... discarded in various sideways... and it gets us thinking - what can we do with them?

How about annoy friends, family, and strangers!

Here is a keyboard we found with a small 8-bit microcontroller. This controller is quite powerful, and we can program it to do our bidding... all for only $2!

This controller can easily be embedded inside the keyboard to run off the keyboard's power and do our will.

You can see how small they are - the larger one has solder pins on it, and the smaller one (same microcontroller) is even more compact.

This is the danger of our society - cheap (or even free) technology that is not only powerful but even dangerous - all in the hands of bored teenagers and persons of questionable intent.

Instead of having this controller record all keystrokes that it then emails to us automatically, we will instead make a prank keyboard. The microcontroller will wait patiently inside the keyboard for a random amount of time, and then, out of the blue, type its own random (and extremely annoying) message to the user!

No one ever suspects the hardware - they always assume they have a virus or other threat.

Opening up the keyboard, you can see the simple circuit board. The cable comes in from the right side. Black wires are ground (and shield), red = power (+5V), green = data, and white = the clock line for the PS/2 Keyboard.

After the software is working, we will simply glue our controller to an empty space on the circuitboard, and wire our pins to connect to the cable pins

The software is simple - we select a random number between 1 and 65535, and tell the chip to sleep for that many seconds. When the chip wakes up, it will simply use the data and clock signals to talk "keyboard talk" to the users computer and send our own silly message. The great thing about the old PS/2 keyboard protocals is that they are simple, and when our chip takes control, the keyboard itself will wait patiently until we are done. The PC thinks it is the keyboard and will receive all of it just as patiently.

Here we are testing the software on a hardware platform. The software is working great!

We are barely using any code resources on the chip. For $2 we can utilize more computing power than NASA used to land a man on the moon - and it runs off a single AA battery if we wanted it to!

Our message can be anything we want it to be. And what do we chose to send? Something silly, of course.

Now, we simply put our 'modified' keyboard back in the pile, and wait for a surplus scrapper to give the keyboard to some public school or 3rd world country to use.

Of course, we are only doing this for an academic exercise and would never inflict this on an innocent... we are just making the point that we should all be careful out there - especially with 'free' hardware!

Kind of fun thinking of other mischief to do... isn't it!