What Is a Keylogger? Definition, Types, Risks, and Detection
What Is a Keylogger?
A keylogger is a tool that records the keys a person presses and stores or transmits that record to someone else. It captures keystrokes as they pass from the keyboard to the operating system, which means it can see passwords, messages, search terms, and payment details at the moment of typing. Some keyloggers run as software on the device, and others are small hardware devices that sit between the keyboard and the computer. Either form works quietly in the background, so the person typing sees no sign that anything is recording.
Not every keylogger is criminal. Employers, schools, and parents sometimes use authorized monitoring software that logs typing, and IT teams use similar tools for troubleshooting. The same technique becomes a threat when someone installs it without consent and sends the captured data to a remote server.
The idea is old. Kaspersky’s plain-language explainer of the technique dates back to April 5, 2013, and the core mechanism has barely changed. What has changed is packaging. Modern keylogging often arrives as one feature inside a larger infostealer that also grabs browser data, screenshots, and clipboard contents. That bundling makes the threat harder to spot, because defenders may hunt for a standalone keylogger and miss a broader stealer.
Why Keyloggers Matter?
A keylogger turns every login into a stolen credential. Because it captures input before encryption protects it, a secure connection does not help. One infected laptop can leak corporate email, cloud console, and virtual private network (VPN) passwords in a single afternoon. Banking details, source code repository tokens, and private chat messages are equally exposed.
Stolen logins rarely stay with the first thief, and the downstream cost often exceeds the original theft. Recorded Future notes that stolen VPN and Remote Desktop Protocol (RDP) credentials are sold to Initial Access Brokers, who resell that access to ransomware operators. A keystroke log that began as a privacy problem can therefore end as a ransomware incident, which is why threat actors value this capability.
Recent data shows how common keylogging infostealers have become. The security vendor ESET reported that SnakeStealer accounted for almost one-fifth of global infostealer detections in the first half of 2025. The same ESET article says the family first appeared in 2019 and that underground Telegram channels began recommending it as a successor after Agent Tesla declined. It follows a malware-as-a-service model, so low-skill criminals can rent it without writing any code of their own.

Types of Keyloggers
Keyloggers fall into two broad groups—software and hardware, and the software group splits further by how deep the code sits in the operating system. The table compares the main types.
| Type | How It Captures Input | Detection Difficulty | Typical Delivery |
|---|---|---|---|
| Hook-based software | Hooks keyboard functions in the operating system | Medium | Phishing attachment or trojan horse |
| Kernel-level software | Runs as a driver or rootkit below security tools | High | Privileged malware or exploit |
| Form-grabbing and browser-based | Copies data from web forms or extensions | Medium | Malicious extension or drive-by download |
| Hardware | Sits on the keyboard cable or a computer port | Very high for software scans | Physical access by an insider |
Software keyloggers are the most common. Trend Micro explains that many Windows keyloggers use the SetWindowsHookEx application programming interface (API) to intercept keyboard events before they reach applications. Kernel-level variants are harder to remove because they load beneath the security tools meant to find them.
Hardware keyloggers need physical access, so insiders usually deploy them rather than remote attackers. Trend Micro adds that hardware keyloggers can be virtually undetectable by software scans, and kernel-level keyloggers can evade standard antivirus tools, which makes periodic physical inspection of shared and public computers worth the effort. Organizations with kiosks, lab machines, or hot desks face the highest exposure to this type.
How Keyloggers Work?
Most software keyloggers follow three stages: infection, capture, and exfiltration. Each stage gives defenders a chance to interrupt the attack.

Step 1: Infect the target
Infection usually starts with spear phishing, where a targeted email carries a weaponized attachment or link. Other routes include drive-by download from a compromised site, a trojan horse bundled with pirated software, and malicious browser extensions. Social engineering ties these routes together, because the victim usually has to open a file or approve an install. ESET says phishing attachments remain the main delivery route for SnakeStealer, with payloads hidden in password-protected archives, disk image files, and weaponized documents.
Step 2: Capture keystrokes and data
Capture comes next. The keylogger hooks keyboard input and frequently collects clipboard contents and screenshots too. It then writes the data to a hidden file. Persistence settings help it survive a reboot, and some families terminate security tools or check for analysis environments.
Step 3: Exfiltrate the log
Exfiltration finishes the job. The log travels to the operator through web requests, file transfers, email, or messaging bots, and ESET lists all four channels for SnakeStealer. Defenders can watch for unusual outbound connections and unexpected destinations from ordinary workstations, since a word processor has no reason to contact a chat bot.
Detecting and Preventing Keyloggers
Detection starts with symptoms. Unknown processes consuming computing power, delays while typing, and applications freezing at random are common signs on a single device. A hardware keylogger shows up as an unfamiliar adapter or device on the keyboard cable. Checking the back of desktop towers during routine audits takes only a minute.
Security teams should look beyond the single machine. Endpoint security alerts, new startup entries, odd outbound traffic, and credential logins from new locations all point to compromise. When one device is confirmed, the incident response team should isolate it, collect evidence, rebuild it from a trusted image, and reset every password typed on it from a clean device.
Prevention works in layers, and no single control is enough on its own:
- Enable multi-factor authentication (MFA) so a stolen password alone cannot open an account
- Patch operating systems and browsers, and block unapproved browser extensions
- Use a password manager that autofills credentials instead of typing them
- Filter email attachments and train staff to report suspicious messages
- Inspect shared computers for unfamiliar hardware and restrict Universal Serial Bus (USB) access
Antivirus tools catch many known keyloggers. Hardware devices and custom kernel-level code can slip past them, so layered controls matter.
How SOCRadar Threat Intelligence Addresses Keyloggers?
A keylogger infection often becomes visible only after stolen credentials appear for sale. SOCRadar Threat Intelligence gives security teams outside-in visibility into that exposure.
Advanced Dark Web Monitoring (ADWM) watches Dark Web forums, marketplaces, and stealer log dumps for employee and customer credentials tied to your organization, so a quiet infection does not stay hidden. Alerts name the affected account and the source of the leak, which shortens the time between theft and response for the security operations team. Attack Surface Management (ASM) maps internet-facing assets and shows which exposed logins attackers could abuse with a stolen password. Brand Protection and Digital Risk Protection (DRP) capabilities detect phishing sites and fake download pages that spread keyloggers in your brand’s name, and Takedown services help remove them. Cyber Threat Intelligence feeds supply fresh, current indicators of compromise that teams can push into blocklists and endpoint tools.
Analysts can search these sources for company domains, so the exposed account is found, reset, and investigated before an attacker uses it. Teams can also pivot from one leaked credential to related exposure. Together, these capabilities move defense from cleaning up one infected device toward finding the stolen data, the phishing infrastructure, and the access that criminals plan to resell.
Key Takeaways
- Keyloggers record keystrokes through software or hardware and capture passwords before encryption applies
- Many keyloggers now ship inside infostealers sold as a service
- Stolen credentials often pass to access brokers and ransomware operators
- MFA, patching, and email filtering cut the risk sharply
- Dark Web monitoring finds stolen credentials that endpoint tools miss
Frequently Asked Questions
Can Antivirus Detect a Keylogger?
Often yes, for known software keyloggers. Custom kernel-level code can evade detection, and hardware keyloggers are invisible to antivirus. Pair antivirus with endpoint monitoring and physical checks.
How Do Keyloggers Get on a Computer?
The main routes are phishing attachments, drive-by downloads, bundled pirated software, and malicious browser extensions. Hardware keyloggers need someone to plug them in.
How Can You Tell If You Have a Keylogger?
Look for typing lag, random freezes, unknown processes using resources, and unfamiliar browser extensions. Unexpected logins to your accounts are another strong signal.
Does MFA Stop a Keylogger?
MFA blocks reuse of a stolen password alone. A keylogger can still capture a one-time code typed in real time, so phishing-resistant methods such as hardware security keys are safer.
Is Using a Keylogger Legal?
Authorized monitoring with clear consent is often legal. Installing one on another person’s device without permission is illegal in many jurisdictions, so check local law and company policy.
Intelligence in your inbox every Thursday.
Join 30,000+ security professionals reading SOCRadar research.
Subscribe