Cybersecurity Glossary

What is Keylogger?

Written by IRONSCALES | Nov 18, 2025 10:19:22 PM

Keyloggers Explained

Modern keyloggers are stealthy, lightweight, and built for one purpose: covert data capture. They quietly collect usernames, passwords, credit card numbers, email content, and other confidential inputs, often without any visible signs of infection.

Credential theft is now one of the most common breach vectors. Lost or stolen credentials took an average of 328 days to identify and contain in 2024 and cost organizations an average of $4.88 million per breach. A single keylogger infection can give attackers everything they need to infiltrate email accounts, internal systems, cloud platforms, and financial applications.

This page focuses on keyloggers as a cyber threat and how to detect and prevent them in enterprise environments.

Key Characteristics:

Keyloggers are typically defined by several core capabilities:

  • Silent, background operation
  • Recording of keyboard input across applications
  • Ability to capture complete credentials, email content, chat logs, and financial data
  • Optional add-ons such as screenshot capture or clipboard monitoring
  • Exfiltration of stolen data to attacker-controlled servers (SMTP, FTP, HTTP/S, messaging bots, etc.)

Types of Keyloggers

Keyloggers fall into two categories: hardware and software.

Hardware Keyloggers 

Physical devices installed between the keyboard and the computer to intercept keystrokes.

Common examples:

  • USB keylogging adaptors
  • PS/2 inline interceptors
  • Wireless signal interceptors
  • ATM/terminal keyboard overlays

Why they're uncommon: They require physical access and are difficult to deploy at scale, making them less relevant for email-based attacks or broad malware campaigns.

Software Keyloggers

Software keyloggers are far more common and are often delivered via phishing, drive-by downloads, or malicious software bundles.

Major software keylogger types:
  • API-based: Intercept operating system keyboard API calls.
  • Kernel-based: Operate at the OS kernel level like rootkits for deep stealth.
  • Form grabbers: Capture entire login forms before encryption (e.g., username + password pairs).
  • JavaScript keyloggers: Malicious scripts injected into webpages or webmail login pages.

How do Keyloggers Work?

While implementations vary, most keyloggers follow a predictable workflow.

Installation

Keyloggers are delivered through:

  • Phishing attachments
  • Malicious links
  • Drive-by downloads from compromised or malicious sites
  • Exploitation of unpatched vulnerabilities
  • Fake utilities or software bundles
  • Social engineering (“IT support” or vendor impersonation)

Keystroke Capture

Once active, the keylogger collects:

  • Every key pressed, including timing and sequence
  • Application context (which program received the keystroke)
  • Additional data such as screenshots, clipboard contents, and active window titles
  • Recognizable patterns (for example, detecting “@” plus typical password lengths)

Storage

Captured data may be stored:

  • In hidden system folders
  • As encrypted log files disguised as system files
  • In registry entries or alternate data streams
  • Temporarily in memory only (to avoid disk forensics)

Exfiltration 

Stored data is sent to the attacker via:

  • Email: Logs sent as attachments to attacker-controlled inboxes
  • FTP: Uploads to remote servers
  • HTTP/HTTPS: Posts to command-and-control (C2) servers
  • Telegram or Discord Bots: Near real-time credential delivery via messaging apps
  • DNS Tunneling: Data encoded in DNS queries to bypass traditional firewall rules

Persistence

To survive reboots and maintain access, keyloggers may use:

  • Run keys or scheduled tasks
  • Service installation to run as background system process
  • DLL injection into legitimate processes
  • Process masking or renaming to blend with system services

How Are Keyloggers Are Delivered?

Keyloggers use many of the same delivery methods as other malware, but email remains the primary vector. Understanding these distribution methods helps organizations strengthen their defenses. 

Phishing Emails (Primary Vector) 

Attackers send emails containing malicious attachments or links designed to install keyloggers on victim systems.

Common Phishing Tactics:

  • Payment notifications: Fake bank transfers, invoices, or payment confirmations with malicious Excel/PDF attachments
  • Credential harvesting: Fake "verify your account" emails leading to keylogger downloads
  • Shipping updates: Spoofed FedEx, UPS, or DHL notifications with attached “shipping labels” containing malware
  • HR/payroll document lures: Spoofed internal documents claiming to contain salary updates or tax forms

Other Distribution Methods

  • Malicious websites: Drive-by downloads exploiting browser or plugin vulnerabilities
  • Software bundling: Keyloggers hidden in cracked software, pirated games, or fake system utilities
  • Social engineering: Attackers impersonate IT support, vendors, or colleagues to trick users into installing malware
  • USB devices: Infected USB drives configured to auto-run keylogger installers
  • Exploit kits: Automated tools that scan for and exploit unpatched vulnerabilities

Real-World Examples of Keylogger Attacks

Keylogger attacks continue to evolve in sophistication. These examples show how threats appear in real email inboxes and why they are effective.

Example 1: Agent Tesla in Banking Notification Phishing

Target: Finance Teams
Subject: Bank Handlowy w Warszawie - Payment Confirmation
From: "Accounts Payable" <accounts@bank-notification[.]eu>
Email Body excerpt:

Dear Finance Department,

Please review the attached payment confirmation for transaction #PLN-482-2024. The funds have been transferred to your designated account.

Attachment: Bank_Handlowy_w_Warszawie_dowod_wplaty_pdf.tar.gz

How it works:
The compressed archive contains an obfuscated loader that evades basic detection. Once opened, it patches Windows AMSI (Antimalware Scan Interface) and deploys Agent Tesla, which begins logging keystrokes and exfiltrating credentials via SMTP.

What to look for:

  • Compressed TAR.GZ file disguised as a PDF
  • Suspicious or look-alike sender domain
  • Unsolicited banking notification

Example 2: Snake Keylogger via Malicious Excel

Target: Accounting/Finance
Subject: URGENT: Outstanding Balance Payment Details
From: "Payment Processing" <noreply@payment-swift[.]com>
Email Body excerpt:

We have successfully transferred the outstanding balance to your account. Please open the attached Swift Copy document to review transaction details and confirm receipt.

Attachment: swift_copy.xls

How it works:
The Excel attachment exploits Office vulnerabilities to download an HTA file, which then fetches and executes Snake Keylogger. The malware collects credentials from multiple applications (browsers, email clients, FTP tools) and logs all keystrokes before emailing data to attackers.

What to look for:

  • Generic sender identity
  • Unsolicited payment notification
  • Macro-enabled Excel file
  • Sense of urgency

Example 3: JavaScript Keylogger via ProxyShell/ProxyLogon

Target: Enterprise Email Users
Tactic: Attackers exploit vulnerable Microsoft Exchange servers and inject JavaScript keyloggers directly into Outlook Web App (OWA) login pages. When employees log in via a web browser, the compromised page captures their credentials in real time.

How it works:

  • Attackers scan for Exchange servers vulnerable to ProxyShell (CVE-2021-34473) or ProxyLogon.
  • Once compromised, they modify logon.aspx to include malicious JavaScript.
  • The script captures login form data and stores it locally or sends it via Telegram bots or web requests.

What to look for:

  • Modified logon.aspx files
  • Unexpected .txt or .log files in web directories
  • XHR requests to unusual endpoints
  • DNS queries with encoded data

Example 4: VIP Keylogger via Spear Phishing

Target: Finance Executives
Subject: Payment Receipt - USD 86,780.00
From: "Accounts Receivable" <ar-dept@globalvendor[.]com>
Email Body Excerpt:

Dear Executive Team,

Please review the attached payment receipt for invoice #INV-2024-8678. This confirms successful wire transfer processing.

Attachment: payment_receipt_USD_86780.00.pdf.zip

How it works:
he ZIP attachment contains a disguised executable that uses AutoIt obfuscation to bypass antivirus. It uses process hollowing to inject VIP Keylogger into legitimate system processes (such as RegSvcs.exe), then captures credentials from major browsers and clipboard data before exfiltrating via SMTP.

What to look for:

  • Double extension filenames (e.g., .pdf.zip)
  • Executables masquerading as documents
  • Unsolicited payment confirmations
  • Large, attention-grabbing dollar amounts

How Dangerous are Keyloggers?

Keyloggers enable account takeover, financial fraud, and long-term intrusions without obvious alerts.

Complete Credential Exposure

Keyloggers capture everything typed, including:

  • Email, VPN, SSO, and admin credentials
  • MFA backup codes
  • API keys and tokens
  • Sensitive communications and messages

Impact: A single compromised account can give attackers a gateway into the broader organization.

Long Dwell Time

Keyloggers often run undetected for months, providing attackers ongoing access.

Impact: Breaches involving stolen credentials take an average of 328 days to identify and contain—nearly 11 months of potential abuse.

Enabler for Major Attacks

Stolen credentials from keyloggers form the basis of more advanced attacks:

  • Business Email Compromise (BEC): Hijacked accounts used to authorize fraudulent wire transfers.
  • Lateral movement: Compromised credentials used to pivot deeper into networks.
  • Data Theft: Access to file shares, databases, and cloud storage.
  • Supply chain compromise: Vendor or partner credentials abused to access third-party environments.
  • Account Takeover at scale: Credential stuffing using harvested passwords.

Significant Financial and Reputational Damage

Costs include:

  • Direct financial theft and unauthorized transactions
  • Wire transfer fraud via compromised email accounts
  • Regulatory fines for exposing customer or patient data
  • Incident response and forensic investigation
  • Legal fees and potential lawsuits
  • Mass customer notifications and credit monitoring
  • Brand damage and long-term trust erosion

Difficult to Detect

Modern keyloggers use sophisticated evasion techniques:

  • Rootkit-style components that hide from security tools
  • Polymorphic code that changes with each infection
  • Process injection into legitimate applications
  • Memory-only operation with minimal disk artifacts
  • Encrypted C2 communications that resemble normal traffic

How to Detect Keyloggers

Protecting against keyloggers requires a multi-layered strategy that combines email security, endpoint protection, identity controls, and user awareness. This section focuses on detection, while the next section outlines prevention strategies.

Behavioral and Link Analysis with Adaptive AI

Because many keylogger campaigns start with phishing, detection often begins at the inbox.

Effective email security should include:

  • Behavioral email analysis (sender identity and relationship patterns)
  • Detection of language anomalies, sentiment shifts, and urgency cues
  • Real-time link inspection at click-time
  • Sandbox analysis of suspicious attachments
  • Post-delivery scanning of messages already in user mailboxes attacks.

This dynamic approach helps detect phishing lures used to deliver keyloggers—even personalized, targeted attacks.

Advanced Email Security with Integrated Endpoint-Level Detection and Anti-Malware Controls

Email stops malicious content from reaching users; endpoint tools detect and block execution when something slips through.

Recommended measures:

  • Application whitelisting (allow only approved executables)
  • Blocking Office macros by default
  • Enabling exploit protections (for example, Windows Defender Exploit Guard)
  • Monitoring registry changes, scheduled tasks, and process injection activity
  • Enforcing strict PowerShell policies
  • Keeping operating systems and applications fully patched

IRONSCALES integrates with EDR/XDR platforms such as Bitdefender and others to correlate phishing indicators with endpoint detections and speed up investigations.

Identity and Access Monitoring

Because keyloggers steal credentials, unusual authentication patterns are often an early warning sign.

Watch for:

  • “Impossible travel” logins from geographically distant locations
  • Logins from new or untrusted devices
  • Repeated failures followed by successful logins
  • MFA push fatigue or bypass attempts
  • Unusual privilege elevation or access to sensitive resources
IRONSCALES integrates with SIEM and Next-Gen SIEM tools such as CrowdStrike Falcon Next-Gen SIEM, Sumo Logic, Splunk, and Microsoft Sentinel to correlate identity anomalies with email-borne threats.

Prevention Strategies

User Education and Real-Time Coaching

Human behavior is often the deciding factor in whether a keylogger lands.

Modern phishing awareness should be:

  • Real-time: Guidance delivered directly inside the inbox
  • Contextual: Training that reflects real threats a user encounters
  • Adaptive: Reinforced through short, targeted “micro-trainings”

IRONSCALES supports:

  • Real-time warning banners powered by GenAI
  • One-click “Report Phishing” buttons
  • Targeted, role-specific phishing simulations

Automated Incident Response (AIR + SOAR Integrations)

Stopping keyloggers early requires rapid, consistent response.

IRONSCALES Agentic AI Autonomous Remediation provides:

  • Autonomous mailbox-level threat removal
  • Post-delivery scanning and remediation
  • Clustering to identify and remediate campaign-wide attacks
  • Escalation workflows to SOC teams when human review is needed

Through integrations with SOAR, EDR, and XDR platforms (including CrowdStrike, SentinelOne, Microsoft Defender, and Cortex XSOAR), organizations can automate cross-system containment actions:

  • Quarantine affected endpoints
  • Suspend compromised accounts
  • Block malicious domains, URLs, or IPs
  • Trigger password resets and MFA re-enrollment

Credential Protection and Hardening

Even if keystrokes are captured, strong identity controls can limit what attackers can do.

Best practices:

  • Enforce MFA or hardware-based FIDO2 security keys, especially for privileged accounts
  • Use password managers to reduce manual credential entry
  • Enable Windows Credential Guard on enterprise devices
  • Regularly rotate passwords, particularly for admin and service accounts
  • Use virtual keyboards for specific high-risk login workflows, where appropriate

Network Segmentation and Zero Trust

If a keylogger does compromise credentials, segmentation can limit the blast radius.

Implement:

  • Least-privilege access controls
  • Micro-segmentation of critical network zones
  • Lateral movement detection and alerting
  • Conditional access and re-authentication for sensitive operations
  • Continuous logging and alerting on anomalous access patterns

A Zero Trust approach ensures that stolen credentials alone are not enough for an attacker to freely move across systems.

Summary

Defending against keyloggers requires coordination across:

  • Advanced Email security (IRONSCALES Adaptive AI)
  • Endpoint detection and response Endpoint detection and response (for example, CrowdStrike, Defender, SentinelOne)
  • Identity and MFA-based protection
  • User education and real-time coaching
  • Automation and SOAR/XDR integrations
  • Zero Trust and network segmentation

With this layered strategy, even if keystrokes are captured, attackers face significant barriers to using stolen credentials to infiltrate critical systems.