March 1st, 2020 at 6:19 AM
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:
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:
Note how all the connectors on the back are basically aligned nicely?
Mine looks more like this:
Except directly on the back, not the bottom.
But, in short, five on top, four on the bottom.
And every visual pinout picture I saw online only looked like this:
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:
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:
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.
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:
- 1 x Teensy 2.0 (AtMEGA32u4 16MHz)
- 1 x Female USB header/connector/port
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:
Note how all the connectors on the back are basically aligned nicely?
Mine looks more like this:
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:
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:
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:
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.