Picture of How to build your own USB Keylogger
Cause I've searched a lot for a project like this, and I haven't find anything around the Web, I would share my experience of my personal USB Keylogger.
It's not really a pure "USB" Keylogger (cause USB HID protocol is much more difficult than PS/2 protocol), but it adapt an USB Keyboard to PS/2 port, while (of course) recording the keys pressed.
In this way, even if it's discovered by anybody, it should be confused with a normal PS/2 Adapter.
That's the final result:

It need just a few component (SOIC PIC and EEPROM can be freely ordered as a sample from http://www.microchip.com/samples/ ):
-PIC 12F1822  (SOIC Version)
-EEPROM 24XX1025 (Any 1Mb version will be ok)  (SOIC Version)
-2 * 4k7 Resistor 1/8 W (Or any resistor of the same value as small as you can solder in the adaptor)
-Pickit 2 / 3 (For programming the pic and reading the eeprom)
-An USB to PS/2 Adapter that can be opened.

And, very important:
-A GOOD solder and VERY GOOD soldering abilities.

Let's Start.

EDIT (in reply to comments):
Some weeks ago, a friend of mine asked me to help him, cause his computer seamed blocked, indeed, he couldn't either type his password to login with his account..
I know that he is almost a novice and couldn't just change the keyboard instead of asking me help, anyway, i changed his keyboard, but I wanted to know why it wasn't working, I tried it on another computer without any result, except that the keyboard's leds blinked, so, I wanted to go deeper; I take a Logic Analyzer and i have analyzed the PS/2 protocol, I have discovered that the keyboard was switching off whenever the PC sends 0xFF (Reset) command.. I then solved it simply replacing a capacitor that has blown up.

This is WHY I build it (for any similar case), I'm NOT responsible of ANY aim you use this Keylogger.
Illegal is the WAY you use a Keylogger, not the Keylogger by itself.
I didn't want to make anything "immoral" or "illegal"

Remove these adsRemove these ads by Signing Up

Step 1: Circuit

Picture of Circuit
This is the complete circuit of the Keylogger, it can seems complex, but in real, it isn't.. we'll see why..
It is divided into two "zones":
One is the Adapter, which connect GND and VCC pin of PS/2 connector with their respective pins on the USB Connector and CLK and DAT pin to, respectively, D+ and D- pins.
The other zone is composed by the PIC and the EEPROM (and the I2C required pull-up resistors). The PIC take care of detecting incoming Data from PS/2, decode, and then writing it to the EEPROM.

Step 2: Open up

Picture of Open up
Open up your USB to PS/2 Adapter, it should look like this.
It simply connect pins from USB female to the PS/2 male connector.
All the wires are glued together with some kind of silicone or something similar, so you have to carefully remove that with a diagonal pliers or anything similar.
You should remain with the separated Female USB and the Male PS/2 connector and the plastic holder.

Step 3: Solder First "Zone"

Picture of Solder First
This shouldn't be too hard, just join:
D+    -> CLK
D-     -> DAT

See here  for USB Pinout.
See here  for PS/2 Pinout

It will look like this:

Step 4: Solder PIC and Program It

Picture of Solder PIC and Program It
You need to temporarily solder your PIC onto a small piece of surface-mount board or by solder a wire to each pin, one by one.
No matter which way you have chosen, you need to be able to connect your PIC to Pickit 2 or any other PIC programmers that support PIC 12F1822.
I've written the code using PCW from CCS, so, if you want to modify the code, feel free to modify or distribute it as you wish, just mention this guide if you want to redistribute it :)
I've attached also the .hex if you want to simply copy what I've done :)
I don't i enter into details of programming, because I expect that you already know how to do that.

Step 5: Solder PIC and EEPROM

Picture of Solder PIC and EEPROM
Here the bad step.
Here you need to take all you soldering abilities to correctly solder the PIC with the EEPROM, and the two Pull-Up resistors..
It's REALLY not so easy, so, if you aren't an expert of soldering, I advice you to leave this project, or to ask a friend of you to make that for you.. 
After some days of working, this is my result:

Step 6: Read EEPROM after logged

Picture of Read EEPROM after logged
Read EEPROM.png
After the soldering process and re-assemble you Keylogger, you should connect to the keyboard that you want to log and wait for the information, "legal" data, or anything you want to get from this Keylogger..
Then, unplug the Keylogger and re-plug the keyboard ;)
Now, you have to read from the eeprom, so, If you have soldered also the SDA and SCL pin to the two N/C pin of PS/2 (like it was on the circuit) you can now build a simple converter from PS/2 to ICSP connector of your EEPROM-reader (In my case, Pickit 2).
See the documentation of your programmer to see exactly how to build it.
Mine, look like this.
After read the eeprom memory, you should save it to a file for better usage. You can do this with a simple Hex Viewer.
Remember that the data collected from PIC are pure "keyboard scancodes", so you need to convert to a readable version.
You can do this by hand, basing your conversion process to this link .
Another way is to use my homemade program, made for make this process easier.
I've attached it, but BE AWARE, IT'S A ALPHA VERSION, it's FULL of bug and REALLY not optimized.
By the way, it make his work quite well..
It's an Italian Version 'cause I'm Italian ;)

Step 7: Conclusion

Picture of Conclusion
Here we are. 
I don't know how many will have the bad idea of make this Keylogger, but, if you really want an homemade (and almost free) solution to log a keyboard, this is what you're searching!
Feel free to comment and ask question about this project :)
Here's a summary video of this project:
1-40 of 117Next »
monoverde4 years ago
One great use for a hardware Key logger is for additional backup during a big writing project. Can save a lot of time after a big crash.
wthit564 years ago
Wow. Controversy! ;P

I'm not a paranoid crazy who wants to ban kitchen knives and prescription drugs. I'm even fine with jump ropes and aspirin.

I realize there are legitimate uses for such technology, but some (employee/child monitoring, etc.) do not require any covert operation, and therefore can simply be done using software... and others (police use, etc.) would have their official ways of doing such things, and wouldn't be looking around the internet for a solution to their problem.

I'm not entirely sure why people are giving reasons for legitimacy including things like "making sure my children's internet browsing is safe", or "emergency back up of your work in case of hardware failure". These things can be done very easily with numerous software suites out there. A keylogger is to log a computer's activity, and not much else. Software on the other hand, can backup files, stop a user browsing unwanted sites, and all number of things - none of which require any secrecy or underhandedness in any way.

And the "it's only illegal if you don't ask the victim's permission" makes no sense. The whole point of making this kind of hardware is to log secretly, with the victim being any the wiser.

I think we all know this kind of tech is used for illegal acts far more often than legal ones. Whilst the people commenting on this item may not be interested in it for hacking/cracking purposes, there's a lot of people out there who would use it that way.

Which brings me onto "freedom of speech". People have commented that it's like going onto a gun forum and telling the people on there to not post stuff on guns, which is an interesting point. However, if someone posted a "how-to" on building your own bomb, how would you react? Whilst bombs may be used to stop terrorism, or save lives in some way, there are lots of people out there wanting to just make bombs. And kill people. Innocent people. If someone has a legitimate use for a bomb, then they would presumably be in the army, etc., and so have authorization to use such things. People looking on the internet for ways to make bombs aren't going to be making them for the army. They're going to be making it for themselves - to use it for their ends, which is usually not a good thing.

Now a keylogger isn't a bomb. I am aware of this. But I hope you can see the parellels. People looking online for how to make a keylogger aren't usually going to be the kind-hearted concerned about a friend type. They're the hackers and crackers who want to steal your information, passwords, etc., or to hack into your system.

Let's go back to the guns analogy for a moment. Gun sales and distribution is heavily regulated and monitored. Anyone who wants to carry a gun must be certified and each gun they purchase must be registered to the owner. If someone put up a "how to make your own 9mm hand gun" on instructables, then this system would be completely disrupted. Anyone could make their own gun, and therefore, anyone, no matter how trustworthy or mature, would be able to fire a weapon at whatever the like, whenever they like. "But it's freedom of speech. It's the usage of it that's illegal." I'm fairly sure the police would disagree.

For these reasons, it's not a good idea to post things of this nature on the internet. If you have a case for legitimately monitoring a PC's activity, then look into the wide array of other, less dubious options, or if it's serious, talk to the police or someone of authority abot it. I'm sure you can find another option.
Jamby (author) 4 years ago
Some weeks ago, a friend of mine asked me to help him, cause his computer seamed blocked, indeed, he couldn't either type his password to login with his account..
I know that he is almost a novice and couldn't just change the keyboard instead of asking me help, anyway, i changed his keyboard, but I wanted to know why it wasn't working, I tried it on another computer without any result, except that the keyboard's leds blinked, so, I wanted to go deeper; I take a Logic Analyzer and i have analyzed the PS/2 protocol, I have discovered that the keyboard was switching off whenever the PC sends 0xFF (Reset) command.. I then solved it simply replacing a capacitor that has blown up.

This is WHY I build it (for any similar case), I'm NOT responsible of ANY aim you use this Keylogger.
Illegal is the WAY you use a Keylogger, not the Keylogger by itself.
I didn't want to make anything "immoral" or "illegal"

Ploopy9 days ago


I don't have a pic or a pic programmer, so I might try this on attiny85.

hitech4441 month ago

It seems strange to me that noone noticed - 4 years now - the other 2 little mistakes on the circuit (along with ematiss' comment on the 2 Vcc chip pins that should be connected to connector Vcc line):

The pin numbers from pin 5 to pin 8 are shown wrong... For U1: SDA is pin 5, SCL is pin 6, WP is pin 7 and Vcc is pin 8.

Same for U2: RA2 is pin 5, RA1 is pin 6, RA0 is pin 7 and GND is pin 8.

My congrats to Jamby: Simple and elegant

pablo78908 months ago
Hi! I'm wondering if it is possible to replace PIC 12F1822 with avr unit like an ATTiny85 or something similar. Thanks!

The ATtiny85 is good, but is not very good at storing information as it has limited space. Other ATtinys have more space and can even store to miniSD cards.

Jamby (author)  pablo78908 months ago
Oh, yes! I think it should work without problem.
Unfortunately, I've very few experiences with AVR, so I can't indicate you the best AVR (while ATTiny85 looks indeed really nice). The only particular feature I've used for this project is the interrupt on low-to-high transitions, in order to easily sync with the PS2 protocol; btw, it could be done even with correctly timed timers with little effort.
pablo7890 Jamby8 months ago
Thank you for replying and those tips! I'll try it, maybe I'll find the way to make it working :)
obrubov1 year ago
I want to present their implementation of USB keylogger. In contrast to the presented here is a pure USB keylogger that analyzes the protocol USB. Unfortunately, this is only the layout, not the final product. And unfortunately article in Russian. http://obruboff.ru/usb-keylogger-avr/
ematiss2 years ago
In the schematic vcc is connected between the chips, but not to vcc itself. Is this connection implied?
Jamby (author)  ematiss2 years ago
Yeah! You're right! Congrats to have discovered that huge mistake. UC VCCs must be connected to USB VCC.
JamesHurst2 years ago
Thanks for sharing your project. The schematic looks nice and clear, but.. what code did you program your PIC microcontroller with? I would think this is incomplete without the code that drives the microcontroller, no?
Jamby (author)  JamesHurst2 years ago
Source code can be found in step 4.
mtnchrismtn4 years ago
There are many reasons that this keylogger would need to be disguised....

Example A: A parent wanting to know what their children are doing online and don't want their child to discover said keylogger....

Example B: That pesky room mate always on your computer? Yeah well now you know what they are doing on your stuff...

Example C: A cheating spouse????

I can do this all day, and with an equal number of illegal reasons on might need such a keylogger.....

The point is, Not everything is or should be illegal.. There are many instances where ownership of an item is NOT illegal...

Example A: It is COMPLETELY LEGAL, to make and own your own gun, (called garage guns), yep legal.....

Example B: Did you know you can buy a grenade launcher? http://www.autoweapons.com/products/destructivedevices.html, yep legal..

There are numerous items that CAN do serious damage to anyone with the right person using them... And are completely legal to get or make yourself....

That being said, this small keylogger, yeah it could be used to steal your personal information in the right hands, and it could also be used to protect yourself from that pesky room mate using your computer to find kiddy porn....

And on that Note, Jamby I give you props for this awesome idea...

And all the critical people bashing on this cause it conceals itself, get with the times, this is the last thing I am worried about in my life.... Try worrying more about your neighbor and his grenade launcher.........
also on the grenade launcher (common household item right?.... well in my house at least) tactical gear commando, check the site out i found a mounted fifty cal machine gun for sale, lol sooo on my christmas list.
Guess I made it quite obvious, the wonderful things I take interest in, haha... Thanks man, I will check it out...
And also I would like to add, you can "BUY" keyloggers that conceal themselves.... Yep totally legal......
N4CRLucky Nibs4 years ago
I don't think it's fair of you to pick on this Instructable. I clicked on this in my e-mail because of the Idea of using it for my personal computer security, records, and as a diagnosis tool for computer problems. I also believe if you went around flagging every post that 'facilitates illegal activity', there would be none left.

The item isn't illegal, neither are the components. So, as with everything else on this site, it is up to the end user to decide whether it will be used legally or not.

The reference that just jumps out of my mouth is..
Do people go to gun stores demanding they stop selling ammunition because it 'facilitates illegal activity'?

Just my honest opinion.
More importantly: Should we go to the home improvement store and demand they stop selling hammers because someone might bash someone's skull in with it?

Should we demand they stop selling reciprocating saws because I might use it to cut someone up after taking the recip saw to them?

Should we demand they stop selling wood-chippers because I'm ultimately going to feed the body bits into the chipper after bopping them with a hammer and sawz-alling them up?

Should we demand they stop selling welding rod because I'm going to build a carbon arc furnace to dispose of the evidence?

What about that titanium spork that ThinkGeek sells? That looks like an Assault Spork to me. Go into Target and demand they stop selling cheap dinnerware, 'cause someone might stab someone in the throat with that $0.49 fork.

Oh, and 2x4's. Sure, they're critical building material. But people have been bashed in the head with a 2x4.

And then encased in concrete. Ban that too.

We could go on forever, because a nannystate knows no boundaries and knows no end.

Can we just ban banning stuff? I'm all for that. ;)

Seriously, though: It's illegal to use a hammer in the commission of a crime. It becomes a weapon. It's illegal to use lock-picks in the commission of a crime; they become "burglary tools" at that juncture. And it's illegal to use a keylogger in the commission of a crime.

But it's not illegal to own a hammer, a spork, or a keylogger. The kids here that need their hands held so they're not exposed to anything potentially objectionable to their tiny little world-views should probably delete their accounts post-haste.
i have to agree with adrenalyn on this. now if i get chased down by a crazy spork-wielding lunatic i might change my mind. (nobody get any ideas now.)
"What about that titanium spork that ThinkGeek sells? That looks like an Assault Spork to me."

lolocaust =P
Hahaha .. I bought that titanium spork for my bf for his b-day because I had no idea what to get him.
bahaha sweet
Ack! You might have aided and abetted by providing him with a Utensil of Mass Consumption! You're sooo toast now!
mrsplooge Nibs4 years ago
Hey, you know a potato cannon facilitates illegal activity too and those things CAN KILL. I don't see you commenting as such on those instructables.
"a potato cannon facilitates illegal activity"

OMG, I made one, had fun with it and sent it to a kid I know for Christmas years ago. Possession and responsible use of a device shouldn't be prohibited. Now, if he uses it to steal your credit card codes or shoots your momma with his potato gun, we have Illegal Behavior and let's call the law.

Lighten up
or instead of a potato he/she loads it with i dunno say a couple cups of black powder and some aluminum oxide and fused it with a sparkler (dont ask why so specific..... WHAT?! lol)
I think you need to re-read the comment again and the argument the comment is making.
weener Nibs4 years ago
We oppose cencorship! This material has the right to be here - It does not itself violate any laws or human beings ..

Let it be
look this guy is just shareing his knowledge. never did he say that he or anybody was going to use this for illegal purposes, to say the maker of this instuctable did is a lie. i could see if he said you should steal passwords and personal information. it is a personal choice on how to use technoligy. should the makers of knives be stopped because it facilitates the illegal act of murder? NO!
YngJoe Nibs4 years ago
Key loggers are sold on the net in the US legally, it's only how you use them that determines if they are illegal or not.
actually, i just flagged your comment

eric, you are not a very good instructable member

brycem Nibs4 years ago
Legality of these devices varies by location, and time of day. It may be illegal to use this is some locations on anything other then your personal machine - in the U.S. if you used one in most (not all) circumstances it would be a problem.

That said, you used to be able to buy one that doesn't change from PS/2 to USB on ThinkGeek. There are still a log of places you can get them.

MaXoR Nibs4 years ago
You realize the freedom of information act covers this completely, and only if you choose to USE this device, on someone else, does it constitute an illegal action. Keylogger's are SOLD legally to businesses, and the like for use on THEIR systems.

Shame on you for assuming this was meant for negative purposes, shows where you mind is when you see things like this, doesn't it!

Gosh, between the "animal Abuse" people, and your type.... Our internet is becoming something pathetic!

MaXoR MaXoR4 years ago
sadly, I do agree that the owner of this ible should remove the "victim" from the sentance "Then, unplug the Keylogger and re-plug the victim's keyboard ;)"

That does imply miss use, and sadly that IS illegal. Just change victim to, "recipient's", or "client's"
Oh, and you have to be the copyright holder or an agent of the copyright holder in order to file a DMCA complaint.

Filing a DMCA complaint without meeting these criteria would be, technically speaking, filing a false claim, which is illegal and opens the false claimant up to civil and criminal liability. Tch tch.
It's completely legal to keylogger yourself. Just as it is to pick your own locks or graffiti your own house.

Shame on you for encouraging DMCA claim abuse! Shame shame! People like you encourage the removal of websites for ideological or political purposes, and clutter the DMCA claims handling system.
kityuen3 years ago
Thank you for sharing the knowledge. Honestly I sell USB products for around 3 years (hkcolordigital) but it is my first time to see this kind of product here. I would recommend our manager to consider adding the keylogger into our store.
1-40 of 117Next »