Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[Project] [DIY/WIP] Hardware Keylogger (with Arduino)

#1
Okay I lied.
I'm not actually using an Arduino board this time.
Why?
Because they're bulky. 
And if you're going to try to do something questionable that might end up pissing off the person you're doing it to, then you want to be as discreet as possible, and fitting a MEGA2560 to the back of someone's computer isn't really the way to go about that.

Note:
This is a Work-In-Progress, basically a project journal that I'll be updating hopefully over the next week until I have a working prototype.
When it's complete, it'll probably look a lot more like my hash-cracking guide in terms of formatting and style.
For now, these are all ideas that I have in my head on how it will work and how I'm going to make it work.

So, without further ado, let's get into it.

Keyloggers:
What is a keylogger?
The short answer is, something that logs all the keys you press on your computer, in an attempt to grab sensitive data that might be unobtainable by any other means, due to encryption and whatnot. You might grab someone's email password and screw their life up from there, or maybe you just want to see what kind of 'videos' they watch in their downtime. 

Typically, keyloggers are pieces of software that just run silently in the background. The only problem with this is that antiviruses exist and keylogger detection rates are pretty high nowadays if you don't have code-signing certificates or driver-level execution. Both are relatively hard to pull off, so keyloggers aren't as popular as they used to be.

Background:
A couple years ago, one of my internet friends (in the security field) was recruiting people involved in electronics manufacturing and embedded development to come up with an undisclosed product. A year later, he came out with a Hardware Keylogger, with a nice shopify site and everything.

The cost was probably what a Rubber Ducky from Hak5 costs, about 50$ or so, and as we all know, Hak5 products are scams if you have the capability to make them yourself. I mean, you can basically create a Rubber Ducky using a 1$ digispark which already comes with a USB connector anyway so it's more or less just as discreet (if you're willing to 3D print a case for it or something to make it look like a normal USB drive.)

So, that got me thinking if there was a way for me to also recreate that product for 50x less cost and a little elbow grease. In the spirit of cyberpunks being hi-tech lowlifes, and without wanting to give up my hard-earned dollars on something I can probably make myself, I came up with the general idea of what the device did.
But, as that was years ago before I actually got decently good at embedded development, I put it off for a while.

So here I am now, with the general planning done and the materials acquired (rather, they were sitting around gathering dust and I figured I should probably put them to use and make something cool.) Here they are:

[Image: ddYjNHn.jpg]
  • 1 x Teensy 2.0 (AtMEGA32u4 16MHz)
  • 1 x Female USB header/connector/port
Very minimal.

I had USB headers lying around from that time I got increasingly paranoid about public charging stations and wanted to make myself some USB condoms. Still haven't gotten around to it though because I'm scared of breaking everything while soldering, even though it's probably the easiest thing to make. Maybe sometime in the Summer when I can take my soldering iron outside or into the garage without freezing to death so I don't carbon monoxide myself from the flux fumes.

Now, the Teensy (by PJRC but primarily sold by Adafruit) isn't exactly the cheapest device you can get, sitting at around 16$USD + shipping, but I snagged one on AliExpress a while ago for about 7$ and free shipping, so I'm still keeping the price at bay by being about 5-6x cheaper.

USB headers are pennies each, but you usually need to buy 5 minimum or something so it'll be a dollar (way cheaper in bulk, but how many times are you going to have to resolder a USB port?)

So under 10$. Not bad.


USB 3.0
When I received my USB3.0 ports, I had no idea how to use them.
This is because typical USB3.0 ports you buy have a generic pinout on the back.
See here:

[Image: USB-3.0-Connector.jpg]

Note how all the connectors on the back are basically aligned nicely?
Mine looks more like this:

[Image: USB-3.0_A_Connector_and_Receptable.jpg]

Except directly on the back, not the bottom.
But, in short, five on top, four on the bottom.
Code:
X X X X X
 X X X X

And every visual pinout picture I saw online only looked like this:
[Image: usb3-Apinout-300.jpg]

No good. I didn't want to short everything on day one and screw up my boards, so I decided to 'verify' which pins connected to which, uh, err, pins?
So, I used a little bit of brute force and ripped one of the ports apart:

[Image: Gt2xq6a.jpg]
And sure enough, the four on the bottom turned out to be the ones I was most interested in, VCC, GND, D-, D+

The header still works, I guess, but I probably won't be using it in this case unless I really need to to save space.

Side Notes: Why only those four pins?

Those pins are universal in the USB standard. All the way from the first USB devices to the new ones, those four pins are present, and are still the most commonly used for everything from serial communication, PS/2 or RS232 emulation, etc.

To ensure that devices would work with older hardware, most peripherals like keyboards and mice will transmit most of their data over these pins, using the D+ and D- pins.
The power pin is, to, well, power the device being connected. That should be self explanatory, and if I need to explain what GND is used for you might want to look up how electricity works first.

How is it going to work?
Like this, I hope:
[Image: nUxrPxR.jpg]
The main idea is that the keyboard connected to the computer (a USB device) will first send its data to the Teensy which will read and store the data, then the Teensy will also forward the data to the computer with (hopefully) minimal interruption or delay.

Now, if you're familiar with Arduino programming, you're about to say that doing keyboard operations is pretty hard or downright impossible with most Arduino devices.
The keyword is MOST.
The Teensy uses the AtMEGA32u4 which does actually support keyboard emulation to an extent. I'm not too sure about all the pitfalls and benefits of using Keyboard.h, but it's possible on the 32u4 at the very least. We'll see how it goes later on, maybe I'll need to make a modification to allow function keys or holding keys.

Who knows, maybe it'll be perfect out of the box. I know people use the Teensy to build custom keyboards so there's hope in the statement.

So this is probably going to eat my free time for the next week or so. 
I'll be writing everything in Arduino's language if I can help it because I don't feel comfortable enough writing C and using avrdude or butterfly or whatever the 32u4 compiler/uploader is called. I'd be rewriting my hash cracker before I try to write this.

Since I don't have actual headers on this Teensy board (never got around to soldering, again) I might need to pick up the iron later on. Would have been way easier to prototype with the use of some F-F dupont jumpers, but who knows.
Reply


Messages In This Thread
[DIY/WIP] Hardware Keylogger (with Arduino) - by Lain - March 1st, 2020 at 6:19 AM
RE: [DIY/WIP] Hardware Keylogger (with Arduino) - by Lain - March 1st, 2020 at 11:58 PM
RE: [DIY/WIP] Hardware Keylogger (with Arduino) - by Lain - March 2nd, 2020 at 6:09 AM
RE: [DIY/WIP] Hardware Keylogger (with Arduino) - by Lain - March 2nd, 2020 at 6:18 AM
RE: [DIY/WIP] Hardware Keylogger (with Arduino) - by Lain - March 3rd, 2020 at 5:01 AM
RE: [DIY/WIP] Hardware Keylogger (with Arduino) - by Lain - March 4th, 2020 at 3:08 AM
RE: [DIY/WIP] Hardware Keylogger (with Arduino) - by Lain - March 4th, 2020 at 4:50 AM
RE: [DIY/WIP] Hardware Keylogger (with Arduino) - by Lain - March 4th, 2020 at 7:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Software] Benchmarking some machines. WIP. Lain 8 4,668 May 27th, 2020 at 12:42 AM
Last Post: Lain
  DIY Multi-unit stereo system SpookyZalost 5 3,543 March 1st, 2020 at 9:06 AM
Last Post: SpookyZalost
  [Project] Cracking Hashes with Arduino Lain 3 3,327 October 22nd, 2019 at 5:18 PM
Last Post: SpookyZalost
  PC won't boot USB? Using 10 year old hardware? try PLOP! SpookyZalost 0 1,938 March 12th, 2019 at 5:09 AM
Last Post: SpookyZalost



Users browsing this thread: 1 Guest(s)

Dark/Light Theme Selector

Contact Us | Makestation | Return to Top | Lite (Archive) Mode | RSS Syndication 
Proudly powered by MyBB 1.8, © 2002-2024
Forum design by Makestation Team © 2013-2024