PS2 to USB keyboard converter also logs your keystrokes

[Shawn McCombs] is up to no good with his first Teensy project. The board you see above takes the input from a PS2 keyboard and converts it to a USB connection. Oh, and did we mention that it also keeps track of everything you type as well?

From the beginning the project was intended to be a keylogger. It’s a man-in-the-middle device that could be hidden inside the case of a keyboard, making it appear to be a stock USB keyboard. Data is stored to an SD card so an attacker would need to gain access to the hardware after the data he’s targeting has been typed.

It works mostly as [Shawn] expected. He is, however, having trouble handling the CTRL, ALT, Windows, and Caps Lock keys. If this were actually being used maliciously it would be a dead giveaway. Many secure Windows machine require a CRTL-ALT-DELETE keystroke to access the login screen.

Comments

  1. fartface says:

    http://x86ed.com/programming/arduino/programmable-arduino-usb-keylogger/

    Already done and smaller so it fits inside a keyboard easier.

    • Jeffh says:

      Adrian’s is not a keystroke logger as that article implies, it just acts as a HID and can inject key strokes, which can be used to install malware.

    • Shawn says:

      Thanks, Jeffh.

    • Shawn says:

      I admit my project is not the best, and needs work, but it does function. I plan to fix the problems, and eventually make a permanent build. The reason it looks so weird, and bulky now is because I need it for prototyping. Thanks everyone, hope you like it. Also if I can’t get the code for ctrl, alt, win keys to work. I am thinking of hardwiring them to the teensy as buttons. Any opinions? Objections?

  2. CrashSerious says:

    Keyboard modifiers…

    My guess is he’s either having trouble with shift keys or has hard coded them in.

    Ctrl+A is sent as two key strokes; 0 + 65 IIRC.

  3. spiderwebby says:

    This’ll be awesome once he gets the bugs ironed out. and it’ll save me a load of effort when I finally get round to making by dvorak keyboard usb :D

    • Urza9814 says:

      Was thing the same thing — this could be quite useful for making my old Model Ms USB, if it’ll work with them…though I’d probably just buy one of the existing adapters that are known to work, they’re probably cheaper since I don’t have the hardware for this already.

      Also, always nice to get a reminder of another benefit of using Dvorak. If it’s converting in software, a keylogger like this is just going to give gibberish. Sure, it’s a simple find and replace if they know what’s going on, but still, it’ll make the attacker’s job just a little bit tougher :)

  4. Pete says:

    How convenient. I have been thinking about a project that I need to send USB keyboard commands from a microcontroller…

  5. Paul says:

    Use keyboard modifiers to handle the alt, shift, ctrl and windows keys.

    The PHUKD lib has some examples.

  6. Grey Drifter says:

    “… an attacker would need to gain access to the hardware after the data he’s targeting has been typed.” Would (s)he? I’ve been toying with a similar idea. Mr. Adrian has already posted a proof of concept on a facebook post and also photo resistor. While it increases the risk of discovery, a dial home function would not be difficult to implement. During an idle period, keystrokes have not been entered for a period and / or photo resistor is dark. Launch a browser, login to a disposable email account, recall / replay the contents of the sd card. If interrupted by a keystroke or change in light kill the task. Upon completion wipe the sd card. Granted a locked machine may hinder this approach.. and depending on security settings may lock the machine. A keep live of something innocuous of something like a shift key sent every 299 seconds. (Sticky keys…) (Plug one hole another will open up winkey+L.)

  7. Shawn says:

    I’m not having a issue sending out strokes, just receiving them.

  8. Anonymoose says:

    I wish you luck. Even the commercial adapters can be somewhat flaky. I have one that doesn’t send anything for the macro key, and one that sends F12 for F11 and F5 for F6. I’m still looking for one that works properly, and building my own has come to mind a few times.

  9. crankmeup says:

    Very nice job. This is certainly different than Adrian’s. Yours is much better. Keep it up.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,114 other followers