Keylogger

A keylogger is software or a hardware device that secretly records everything typed on a keyboard, including passwords, card numbers and messages, and sends it to an attacker or stores it for later collection.

BeginnerCategory: Malware

Also called: keystroke logger, keystroke logging, keylogging

What is a keylogger?

A keylogger records keystrokes. MITRE ATT&CK lists keylogging as a common way attackers capture passwords and other credentials as users type them. Some keyloggers also take screenshots or copy what's on the clipboard.

How does a keylogger work?

  • Software keyloggers are the most common. They arrive as part of a trojan, infostealer or remote access tool, run quietly in the background and send captured text to the attacker.
  • Hardware keyloggers are small devices plugged in between a keyboard and computer, or built into a fake keyboard or charging cable. They need physical access, so they're rarer but hard to spot.

Captured passwords let attackers log in to email, banking and business systems as the victim.

How to protect your business

  • Use endpoint protection that detects keylogging behavior, and limit who can install software.
  • Use MFA, ideally passkeys or security keys, so a typed password alone isn't enough.
  • Use a password manager that fills passwords in automatically, which reduces typing.
  • Check shared and public-facing computers for unfamiliar devices plugged into USB ports.

Related terms

Sources

  1. Input Capture: Keylogging (T1056.001) (MITRE ATT&CK)
  2. SP 800-83 Rev. 1: Guide to Malware Incident Prevention and Handling (NIST)

Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.