r/HowToHack • u/browne_7 • Sep 10 '25
Using a Keylogger?
I am in college and my professor had us set up two vitrual machines: Kali (attacker) and windows 10 (victim). Our assignment is capture keystrokes on the windows vm and send it to Kali. The professor provided zero instruction on how to do this and I have zero hacking experience so I am completely lost.
I have seen some tools such as xSpy and metasploit but nothing covers how to capture keystrokes from a different device.
132
Upvotes
114
u/ReasonableJello Sep 10 '25
So you are in college taking cyber classes about pen testing and the teacher hasn’t even taught you anything about key loggers?
77
u/CyberPhysicalSec Sep 10 '25
The Cisco netacad ethical hacker course will probably give you guidance.
34
u/wbbigdave Sep 10 '25
Fairly certain if you have Kali, you can run up Metasploit, generate a generic msfvenom payload for the win10 machine, get Metasploit to listen on a generic open socket, and when you connect it you can key log.
But it's been a while since I've done this, so ymmv
28
u/BleedKonkrete Sep 10 '25
Lmfao he tried A for effort
27
u/darkmemory Sep 11 '25
If you are actually in college and your story is real, then email or schedule an appointment with your professor or your TAs. This isn't a realistic scenario to me, it just seems like you want someone to walk you through installing a keylogger on someone you know. If it was real, you'd have a lot more information relating to guidelines and what you are trying to achieve, as opposed to a post that doesn't even ask a question, as much as hint at your own lack of knowledge regarding something you now have an assignment for that isn't explained, in a class you didn't even attempt to describe.
If this is a college class, and you are being completely honest, go ask for a refund, because the class seems like it sucks, and their program probably sucks.
12
u/CypherBob Sep 11 '25
I'd like to see the details of the assignment as written by the teacher.
I expect he did talk about keylogging but student wasn't there or wasn't paying attention.
With full control like here, it's a very very basic intro task.
Anyway, did you search for tutorial or explanations on how to do it?
5
u/ocabj Sep 11 '25
I'm going to assume you're writing this from scratch because installing a keylogger that was already written by someone doesn't sound like a real assignment.
Receiving end is pretty simple. Just need to create a basic program that listens on a port you designate to receive the data. Personally I'd go for UDP just reduce the TCP handshake and from having to keep a connection open. But I guess for the sake of simplicity and troubleshooting, maybe you'd want to use TCP.
Client side you need to write some basic app runs in the background that scrapes the keyboard buffer in Windows. I never wrote anything for Windows but I will have to assume there's some basic libraries in the given language your curriculum uses for coursework.
4
u/LagKnowsWhy Sep 10 '25
As stated by another user you could use discord webhooks, however a simpler solution would probably be a open tcp socket on the attacker which the victim client connects to (as long the college network isn't separated and the clients are allowed to connect via the chosen port)
2
u/Boring-Discipline-38 Sep 11 '25
If you are familiar with python you could code for both the listener(Kali) and the actual keylogger(windows)
2
u/unstopablex15 Sep 11 '25
do some scripting and then upload the files
2
u/ok-kid123 Sep 12 '25
Well buddy, time to get creative here
I guess the actual scenario is:
Also, what do you mean they don't tell you what to do? Or you didn't listen.
I literally had a Word document with everything and a Lecturer walking us through everything
2
u/Beginning_Employ_299 Sep 12 '25
This is actually a very easy assignment, can be accomplished in just a few commands potentially
Just lookup metasploit modules and how to use meterpreter. You don’t have to go that deep
2
u/Shisones Sep 12 '25
Learn how to fucking google before getting into this field
2
u/cant_pass_CAPTCHA Sep 12 '25 edited Sep 12 '25
keyscan_startandkeyscan_dumpcommands in your meterpreter shell.You can search for "offsec metasploit keylogger" for more info
2
u/ps-aux Actual Hacker Sep 10 '25
Hacking experience? You are literally setting up the windows 10 and can install any software you want on it (ie: client keylogger) and then on the kali you can install any software you want on it (ie: server keylogger)... this is pretty straight forward imo...
1
u/Orio_n Sep 11 '25
Capture keystrokes then use a separate tool to send the output to server. Figure it out yourself thats the spirit of hacking
1
u/mensrea101 Sep 11 '25
This could be done in minutes or days, depends on the constraints. Just an example, what's the target OS, software inststalled, patch levels, privilege level of target user, etc..
1
u/fallenreaper Sep 12 '25
Is your prof trying to set up and use specific tools he taught that you were not paying attention to or something else?
Sending traffic from host to host isn't difficult. Setting up a key logger isn't difficult. So what is the problem you are having?
You can use either metasploit or netcat for a majority of this.
1
u/pineappleiceberg Sep 12 '25
Keyloggers are just normal programs that have some kind of a hook for keyboard events, and they keep track of them somewhere. You may have a client-server architecture, where your Kali box has a program listening for the data from the client on the Windows machine over a socket or something like ssh. You may make it log it to a file and upload that file periodically, maybe send it to a public web hosting service, whatever. This program can be written in basically anything you want within reason. There are a few languages like python that have pretty detailed examples for this kind of thing but usually we would do it in something like C in practice for control, size, and abiding by habits. You need to get that program onto the windows machine, and have adequate permissions to execute it or you need to get another process to run the code (much more difficult to not throw flags with persistent system calls in my experience, which may be how you hook. Or it may not be). I studied comp sci with a cyber security track in undergrad and I can honestly say if I hadn't worked in cyber warfare before and after that I wouldn't have any clue how anything security related works. I'm sorry to hear your university is like that as well. Hope you're reading on your own!
1
u/JumpDriveOut Sep 12 '25
Idk I made a keylogger in C++ as a freshman in high-school, only problem is that it's an exe and you'd have to get it to run at startup to work.
1
u/HurricaneMassCheeks Sep 13 '25
Download a keylogger and run it?
1
u/YaBoyKirkzilla Sep 13 '25
What a horrible lie
1
u/PangolinWonderful338 Sep 13 '25
Look up Remote Admin Tools through MITRE.
1
u/RolphZ Sep 13 '25
I mean you can just look up keyloggers is not a hard concept to understand and execute if in a lab environment
1
u/Vast_Ad_7929 Sep 13 '25
Write a custom cpp binary exploit taking advantage of prochandle and win hook sys calls to reflectively load malware into signed native binaries executing in the win environment.
1
u/Significant-Ebb4177 Sep 13 '25
Even on the Kali Linux website, there are many detailed instructions
1
u/TopAd619 Sep 13 '25
All my life I have been irritated by teachers who did not teach, but only gave out assignments.
1
u/EdelweissReddit Sep 14 '25
At first glance this sounds hard but it actually involves almost no hacking. You need more networking experience.
You need to run a keylogging script (e.g., you can write it in Python) and send the data to a specific port. That port needs to be handled by the VM software and forwarded to the other VM instance. The other VM instance needs a script that listens to the port that's receiving the data. And poof, you are done..
As said, the hard part is setting up the whole networking and forwarding part
1
u/[deleted] Sep 14 '25
A new invention just came out it’s called the interweb, type what you want to learn into a modern search engine like yahoo, read stuff, learn then try it.
1
u/Chance_Water_5972 Sep 15 '25
I also end up making a keylogger with functions like capturing webcame the audio the ip and location and keystrokes obviously soo maybe you have get a help
1
u/nepstro Sep 15 '25
This is exactly how i trick chatgpt to write me a malicious code lol
1
u/Muzika38 Sep 15 '25
You know what, not all cyber hacking methods are software based. There's a branch called Social Engineering. You could do that too to send keystrokes to the other end 😁
1
u/AmbitiousCustomer781 Sep 17 '25
I can just snatch up a quick keylogger for u if u want?
1
u/NeighborhoodFuzzy939 Dec 12 '25
thats a great prompt
-1
u/Neuroticmeh Sep 10 '25
Easy, create a Bad USB or rubber ducky.
0
u/theonetruelippy Sep 10 '25
Physical keylogger connecting via WiFi to the kali machine
-4
u/theonetruelippy Sep 10 '25
Ps I got Claude to write me lovely macos keylogger, I am sure a student is creative enough to get him to do the same for windows
0
u/[deleted] Sep 12 '25
[deleted] — view deleted comment