pwn3d.es

TECHNICAL SHEET · Red Team

LIMITED DEMO

Keylogger Script

Keystroke capture and how to detect it.

Pythonpynputkeyboard
Language
Python
Platform
Windows / Linux
Type
Client-server pair
Web demo
No

What it is

capture_victim.py uses pynput in a graphical session or keyboard in a terminal to record keys and send them to server_host.py, which prints them to the console. The repository includes a dependency script and documents adding a msfvenom reverse shell plus a Metasploit handler.

What it is for

The sheet helps recognise the pattern defensively: a resident process, a keyboard hook, an outbound connection and persistence. It is more useful for designing detection than for running the capture.

How it is used

Windows or Linux with Python 3, pynput, keyboard and colorama; the original README installs them with root permissions.

This sheet publishes no operational commands; the flow is explained above.

Workflow

  1. The client records keys through a keyboard hook.

  2. It batches and sends the events to the server over the network.

  3. The server writes them to the console or a log.

  4. Persistence and the outbound connection are the EDR clue.

Sheet built from the repository README and public code. Figures and commands are limited to what the project documents.

git · repository code

Explore the repository

$ git ls-tree -r keylogger_scriptLoading the repository tree…