Sonsivri

Electronics => Projects => Topic started by: DarkClover on April 13, 2011, 10:21:14 22:21



Title: Looking for USB keyboard logger
Post by: DarkClover on April 13, 2011, 10:21:14 22:21
Hy there,

I want to build a USB keyboard logger. I know there are thousands of devices out there
but I wanna build my own one.

It's planned to save the data onto a SD-card but the problem is, how should I create
the connection between PC-USB and Keyboard.

PC <----USB----> Keyboard.

The communication shouldn't be interrupted. For host I thoughtabout a Vinculum from FTDI
but hoe to make the HID thingy with the computer ?


Title: Re: Looking for USB keyboard logger
Post by: elecgreg on April 14, 2011, 05:33:01 05:33
Hello,

You could host the keybord, strip the data from the packets and then emulate a HID device and re transmit the data, you would in effect be creating a new device on the PC. This may or may not be desirable. A work around would be to power up the micro (your host and device?), enumerate the keyboard and then masquerade your new "keyboard" as the orginal keyboard using the descriptors of that device (the one you're now hosting).

An alternative would be to snoop the data lines and write code to strip out the payload, your device would not be visible to the host PC. You would need to strip out enumeration / control characters and find the data packets, remove the headers, CRC and do what you wish with the data.

Attached is a picture of what it looks like to enumerate a HID device, you can see the enumeration and then the sucessive in transactions that get data from the device.
You could look for In transaction signatures and then grab the data.
This trace was made with an Ellisys USB tracker, very helpful for understanding / developing USB devices.

elecgreg


Title: Re: Looking for USB keyboard logger
Post by: DarkClover on April 15, 2011, 12:35:46 12:35
Well,
I'm pending between the sniffing and the host emulation. I think it's not a problem if the system doesn't show the right keyboard
since nobody really is interested in the keyboard type as long as it works correctly.
More it is to emulate HID. I've found some interesting articles about HID and USB on the net which I'll look over this weekend.

And thanks for the hint with Ellisys USB tracker, it really is very helpful. With it I found a problem on another project
which I've searched for the last two weeks.