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

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

#8
Update 2:
The ground pin on the USB header broke off because I suck at soldering.
To be fair, I use a really cheap (<10$) iron from china with a really thick tip that somehow makes the flux flow upwards on the tip somehow.
I need to just invest in a heat gun and some paste, smh. Probably exponentially safer to use indoors as well.

So instead I decided to start playing around with the programming part of things.
First, I want to make sure that the Teensy can actually send keystrokes, so I hooked up my breadboard with a pushbutton and used the builtin LED on the board to make sure that I was writing my pushbutton logic correctly (d*** pullup resistors always screw with me.)

That worked, using pins 10 and 11 (the corner pins that I attached the headers to.)
So now that I had pushbutton logic, now I need keyboard logic. I don't actually need to import anything fancy, luckily:
Code:
void setup() {
    pinMode(10, INPUT_PULLUP);
}

void loop() {
    if(!digitalRead(10) == HIGH) {
        Keyboard.print('a');
    }
}

My one gripe is that it was a little too fast.
At least now I have a cool autoclicker or I can fill up a megabyte of 'a''s in under a minute by literally holding down a button.

So, now that keyboard logic works, I should start setting up the rest of the board for general logic I'm just going to need to implement later anyway.
Code:
char *keyBuffer;
void setup(){
    keyBuffer = (char *) malloc(2048);
    pinMode(10, INPUT_PULLUP);
}

void loop() {
    input.readAvailableBytes(keyBuffer, 32) //Generic, haven't figured out the USB interfacing part.
    if(keyBuffer){
        for(int i = 0; i < 2048; ++i) {
            Keyboard.print(keyBuffer[i])
        }
    }
}

That won't compile. Don't try.
It's also going to be ridiculously slow for that loop. I'll come up with a better solution, since malloc() returns a pointer to the allocated memory, so maybe I could make a function that returns the pointer + 1 for iterating over each byte, and the readAvailable() or whatever can also write to memory that way as well.
I wonder if Arduino supports lambdas, might be a good opportunity to practice...

The important part is that I need to store keyboard data somewhere, and simple local variable memory (and flash memory) simply isn't enough. I need to be using malloc() to directly make some space in RAM instead. I mean, I have 256KB available there, might as well use a bit of it.

Realistically, that's going to be prone to change. If you unplug the device, you lose the data in RAM. You can't access it any other way than, like, using the serial monitor or something. I'll need to find a way to connect a microSD to the device and write to a file.



So after some more review of tech specs, I was wrong about the power issue. Teensy 2.0 does in fact support 5V. No worries about shorting and frying. Only the 3.1 and LC had the 3.3V limit.

I've also been researching how I could connect a USB device and be able to interpret it. Teensy does actually have separate serial channels available as another built-in, full UART control (USB without the annoying/bulky port) so maybe I could try to make use of that.
Unfortunately that would also mean more soldering...

So I won't be adding a microSD card to this, as I don't have a shield for it surprisingly enough. That could be one of your own mods if you decide to make this (or at the very least until I get the funding I need for New Breakthroughs in Technology™ ).

I have keyboard output working, now it's time for interfacing.
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 6,921 May 27th, 2020 at 12:42 AM
Last Post: Lain
  DIY Multi-unit stereo system SpookyZalost 5 5,481 March 1st, 2020 at 9:06 AM
Last Post: SpookyZalost
  [Project] Cracking Hashes with Arduino Lain 3 4,950 October 22nd, 2019 at 5:18 PM
Last Post: SpookyZalost
  PC won't boot USB? Using 10 year old hardware? try PLOP! SpookyZalost 0 2,339 March 12th, 2019 at 5:09 AM
Last Post: SpookyZalost



Users browsing this thread: 3 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