November 6, 2026
Updated: November 6, 2026
How keyloggers capture your typing, which check finds which type, and what to do, in order, if you suspect one.
Mohammed Khalil

What is a keylogger? It is software or a small hardware device that secretly records what you type, so someone else can read your passwords, card numbers and messages. Software keyloggers usually arrive through phishing emails or unsafe downloads, while hardware keyloggers are physically attached to a computer. If you suspect one, stop signing in on that device, scan it, inspect the keyboard connection, and change your passwords from a different, clean device. This guide explains how keyloggers work, how to find and remove them, and how to prevent them, using FTC, CISA and MITRE guidance.
A keylogger, short for keystroke logger, records keyboard activity. NIST says it "monitors and records keyboard use," and notes that some require the attacker to retrieve the data while others send it out by email, file transfer or similar means.
The goal is usually your logins. MITRE ATT&CK, the public catalog of attacker techniques, lists keylogging as technique T1056.001 and calls it the most prevalent type of input capture. Once someone has a password, they can reach the email, bank or work accounts behind it.
Not all keystroke logging is criminal. It can be legal when the person being monitored knows and agrees, as Microsoft explains. The trouble starts when it happens secretly on someone else's device.
These terms overlap, and one piece of malware can fit several of them. Our guide to the types of malware covers the wider family.
| Term | What it does | How it relates to keyloggers |
|---|---|---|
| Keylogger | Records what you type | Can be a program or a physical device |
| Spyware | Secretly gathers information from a device | Keylogging is one common spyware feature |
| Stalkerware | Spyware someone you know installs on your phone or computer | May read messages and location as well as typing |
| Infostealer | Grabs saved passwords, cookies and wallets in one sweep | Takes stored data; a keylogger waits for you to type |
| Remote access trojan | Gives an attacker remote control of a device | Many include a keylogging module |
Our infostealer guide explains how stolen logins are packaged and sold, and our compromised credential statistics show the scale of the problem.
Most keyloggers follow the same three steps:
The capture point decides which type you are dealing with and which check can find it.

Why HTTPS does not help. The padlock in your browser protects data on its way to the website. A keylogger on your device reads your typing before that encryption applies, so a secure website does not stop it.
| Type | Where it sits | How it gets there | What finds it |
|---|---|---|---|
| Inline hardware | Between the keyboard and the USB port | Someone plugs it in | Looking at the connection |
| Keyboard-embedded hardware | Inside the keyboard | Tampering or a swapped keyboard | Replacing the keyboard; sometimes a close look |
| Wireless sniffer | Near a wireless keyboard, within radio range | Someone places it nearby | Noticing an unfamiliar device; using a wired keyboard |
| Kernel or driver software | Deep inside the operating system | Malware with high privileges | Offline scan, or a full reset |
| API or hook software | Listens to keyboard events | Phishing, bundled downloads | Security scan |
| Form grabber or browser script | Inside the browser or web page | Malicious extension or compromised page | Extension review; the site owner, for a compromised page |
| Mobile keyboard or accessibility app | Replaces the keyboard or watches text fields | A permission you, or someone else, approved | Permission review |
A hardware keylogger does not rely on your operating system, so a software scan cannot see a separate physical device. It needs physical access, which makes shared and public computers and open offices the common settings. MITRE tracks this wider category as Hardware Additions (T1200).
Wireless keyboards can be targets too. In 2016, Help Net Security reported an FBI notice about KeySweeper, a device built to look like a working USB wall charger that could capture typing from certain wireless keyboards. The notice did not say when or where any had been found. The FBI suggested wired keyboards or wireless ones with strong encryption.
Software keyloggers are programs. MITRE lists several methods, including hooking keyboard functions and using custom drivers, and some work inside the browser, recording form entries before they are submitted. Many are not standalone tools. ATT&CK lists keylogging as a feature of remote access tools and stealers such as AsyncRAT and Agent Tesla, so finding a keylogger often means something broader is on the device.
Phones can be affected. MITRE's mobile entry (T1417.001) describes malicious apps posing as third-party keyboards, and on Android, apps abusing accessibility services to read typed text. Both routes need a permission that a person granted. On iPhone, Microsoft notes that jailbroken devices are especially exposed because they bypass Apple's built-in protections.
These cases come from court records and official sources.
| Date | Setting | Type | What happened | Lesson |
|---|---|---|---|---|
| 2001–2002 | Copy shops, New York | Software | Keylogging software on public terminals collected customer logins, used to access or try to access bank accounts; 27-month sentence in 2005 | Avoid sign-ins on public computers |
| March 2012 | Cal State San Marcos | Hardware | Devices on 19 campus computers captured logins of nearly 750 students to rig a campus election; a year in prison | Shared computers need physical checks |
| March 2015–November 2016 | University of Iowa | Hardware | Devices captured professors' logins, used to change grades; four months in prison and $67,900 restitution in 2018 | Two-factor authentication would likely have stopped stolen passwords alone |
| 2015 | Ukrainian power companies | Software | The Sandworm group gathered credentials through a BlackEnergy keylogger plugin | Keylogging also appears in major attacks |
| February 2017–April 2018 | Two New Jersey companies | Both | An intruder planted hardware keyloggers and software, then stole more than 15,000 files; 94 months in prison in 2020 | Physical security is part of cybersecurity |
| December 2023–February 2024 | Ivanti VPN appliances | Web script | Attackers altered a VPN login page's JavaScript to capture credentials | A clean device cannot help when the login page itself is compromised |
Sources: the DOJ on the copy shop case, the FBI on the Cal State election case, the DOJ on the University of Iowa case with BleepingComputer's report on the missing two-factor authentication, MITRE ATT&CK for the Ukraine attack, the DOJ charging document and sentencing release for New Jersey, with the file count from Ars Technica, and MITRE's Cutting Edge campaign page.
Keylogging has a long history. In the 1970s, Soviet spies bugged IBM Selectric typewriters in US diplomatic buildings in Moscow.
Many keyloggers show no signs at all, so a quiet device is not proof of a clean one. These signs can also have ordinary causes. The FTC lists these signs of malware:
For phones, the FTC's stalkerware guidance adds faster battery drain, unexplained data use, overheating and unexpected restarts. It also points to a human sign: someone who knows your location, private conversations or browsing without being told, and who has had unsupervised access to your phone.
No single check finds every type, so combine them. A clean result is good news, not proof.

| Keylogger type | Security scan | Offline scan | Permission review | Hardware check | Device reset |
|---|---|---|---|---|---|
| Malicious app or program | Often | Often | Sometimes | No | Often |
| Deep, hidden malware | Sometimes | Often | No | No | Sometimes |
| Malicious browser extension | Sometimes | Sometimes | Often | No | Often |
| Rogue phone keyboard or accessibility app | Sometimes | Not applicable | Often | No | Often |
| Inline USB device | No | No | No | Yes | No |
| Device hidden inside a keyboard | No | No | No | Sometimes | No |
This matrix is DeepStrike's editorial guide to typical results, not a guarantee.
Microsoft's advice is to "look for anything odd between your keyboard and computer," and to check the keyboard itself, especially on public or shared devices. In practice:
Order matters, because changing a password on an infected device can hand over the new one. This sequence combines the FTC's malware steps with Microsoft's response checklist.

Safety first if someone you know may be responsible. The FTC warns that removing stalkerware could make an abuser escalate and could tip them off. Talk to a domestic violence advocate from a device the person cannot access before you change anything. The National Domestic Violence Hotline is available at 1-800-799-7233. The FTC also advises documenting the abuse before you reset or replace the phone.
Most of this list comes from CISA's spyware guidance:
On-screen keyboards can help against simple keystroke capture, but they are not a full fix. The Snake Keylogger alert notes that it also captures screenshots and clipboard data. Multifactor authentication has limits too, because stealers may grab session cookies, as our infostealer guide explains.
It depends on who installs it, on whose device, and with what consent. This is general information, not legal advice.
Secretly recording someone else's typing can lead to serious charges. The cases above involved computer fraud and identity theft, and the federal Wiretap Act restricts intercepting electronic communications. Selling spyware carries risk too: in 2014, the Justice Department announced the first-ever criminal conviction for advertising and selling a mobile spyware app, and in 2021 the FTC moved to ban the maker of the SpyFone stalkerware apps from the surveillance business.
Employer monitoring rules vary by state and country, so organizations should disclose monitoring in policy and ask counsel first.
For a business, a keylogger is a credential-theft problem. MITRE says keylogging "cannot be easily mitigated with preventive controls" because it abuses normal system features. So plan to limit what a stolen password can do, and to detect the behavior:
Then test it. On a non-production host, run an authorized emulation of T1056.001 and confirm that an alert fires and that someone responds. A social engineering penetration test measures whether staff open the lures that deliver keyloggers, while a red team exercise shows whether your team notices credential theft in progress.
DeepStrike's penetration testing services include social engineering simulations such as phishing, calling and baiting, and our red teaming services measure SOC, alerting and response workflows against realistic tradecraft. Testing shows where controls fail; it does not guarantee security. To scope a test, contact our team.
Not strictly. A virus spreads by infecting files, while a keylogger's job is to record typing. NIST classes keystroke loggers as attacker tools that malware delivers. Security software usually treats them as malware anyway.
It can often detect software keyloggers, and an offline scan helps with those that hide. It cannot see a separate hardware device, so check the connection too.
Often you can't tell from symptoms alone. Run a scan, review permissions and extensions, and inspect the keyboard connection.
Usually, yes. Scan with up-to-date security software, remove unknown hardware, change passwords from a clean device, and reset if you cannot be sure. If someone you know may be responsible, talk to an advocate first.
Most of the defense is simple: official downloads, updated software, a look at the cable, and multifactor authentication so a stolen password is not enough. If you suspect a keylogger, follow the steps in order and change your passwords from a clean device.
Mohammed Khalil is a Cybersecurity Architect at DeepStrike, specializing in advanced penetration testing and offensive security operations. With certifications including CISSP, OSCP, and OSWE, he has led numerous red team engagements, focusing on cloud security, application vulnerabilities, and adversary emulation. His work involves dissecting complex attack chains and developing resilient defense strategies for clients in the finance, healthcare, and technology sectors.
MITRE ATT&CK: Input Capture: Keylogging (T1056.001)
MITRE ATT&CK Mobile: Input Capture: Keylogging (T1417.001)
MITRE ATT&CK: Hardware Additions (T1200)
MITRE ATT&CK: Cutting Edge campaign (C0029)
NIST SP 800-83 Rev. 1: Guide to Malware Incident Prevention and Handling (2013)
FTC: How To Recognize, Remove, and Avoid Malware (updated April 2025)
FTC: Stalkerware: What To Know (June 2026)
FTC: What To Know About Identity Theft (updated September 2024)
FTC and US government: IdentityTheft.gov
FBI: Internet Crime Complaint Center (IC3)
CISA: Protect Yourself from Tracking Technologies and Spyware
CISA: Next Level MFA: FIDO Authentication
NJCCIC: 404 Keylogger alert (May 22, 2025)
FBI: Election Hack: Stealing Votes the Cyber Way (August 5, 2013)
US Department of Justice: Queens man sentenced in Kinko's keylogging case (February 28, 2005)
US Attorney's Office, S.D. Iowa: Former student sentenced (August 23, 2018)
US Attorney's Office, D.N.J.: Information, United States v. Agarwal (2019)
US Attorney's Office, D.N.J.: Sentencing release (September 1, 2020)
US Department of Justice: StealthGenie spyware app guilty plea (November 25, 2014)
FTC: FTC bans SpyFone and CEO from surveillance business (September 1, 2021)
Microsoft Security: What Is a Keylogger?
Microsoft Support: Microsoft Defender Offline
Microsoft Support: Recovery options in Windows
Apple Support: Control access to Input Monitoring on Mac
Apple Support: Add or change keyboards on iPhone
Apple Support: How Safety Check works
Google Play Help: Google Play Protect
Android Help: Reset your Android device to factory settings
Cornell LII: 18 U.S. Code 2511
Help Net Security: FBI warns about keyloggers disguised as USB device chargers (May 24, 2016)
BleepingComputer: Student arrested for using keylogger to change grades (November 4, 2017)
Ars Technica: Man planted keyloggers in companies' networks (October 24, 2019)

Stay secure with DeepStrike penetration testing services. Reach out for a quote or customized technical proposal today
Contact Us