Malware & ransomware

What Is a Payload in Cyber Security? Types, Delivery and Defense

The exploit gets in. The payload does the damage. Here is how payloads work, from ransomware and keyloggers to staged loaders and logic bombs.

Cysoro Security TeamPublished · 9 min read
PAYLOAD Delivery ≠ damage Ransomware MALWARE & RANSOMWARE Payloadexplained The code that does the damage.
Quick answer

A payload in cyber security is the part of malware or an exploit that performs the malicious action, such as encrypting files, stealing passwords, opening a backdoor or spying on keystrokes. The delivery method, such as a phishing email or a vulnerability, gets the payload onto a system, and a trigger, such as opening a file or a set date, runs it.

Key takeaways

  • A payload is the harmful code inside malware, not the email, link or exploit that delivers it.
  • Common payloads include ransomware, keyloggers, backdoors, remote-access trojans, wipers and cryptominers.
  • Payloads often arrive in stages, stay dormant until triggered, and are stopped by patching, least privilege and runtime detection.

When a phishing email infects a computer with ransomware, the email is not the payload. The ransomware is. That distinction matters, because it tells you where to defend: stop the delivery, block the trigger, or catch the payload when it runs.

What is a payload in cyber security?

A payload in cyber security is the part of malware or an exploit that performs the malicious action. It is the code that encrypts files, steals passwords, records keystrokes, opens a backdoor or wipes a disk.

The word comes from networking, where a packet's payload is the data it carries and the headers are the envelope around it. Attacks have the same two layers. An exploit, a phishing attachment or a malicious package is the envelope. The payload is what arrives inside it.

MITRE ATT&CK puts it simply: a payload is the part of the malware which performs a malicious action. Cloudflare uses the Trojan Horse image: like the Greek soldiers hidden inside the wooden horse, a malicious payload can sit harmlessly for some time until it is triggered.

What is the difference between a payload, an exploit and malware?

These three terms are often used as if they mean the same thing. They do not, and the difference decides which defense works.

TermRoleExample
ExploitGains access or triggers a vulnerabilityA flaw in unpatched software, or a macro that runs code
DeliveryGets the payload onto the systemA phishing email, a drive-by download, a USB drive
PayloadDoes the damageRansomware, a keylogger, a backdoor
MalwareThe whole malicious programThe exploit, delivery and payload together

Here is a typical example. An attacker sends an email with a malicious macro in a spreadsheet attachment. The victim opens the file, the macro runs, and the system is infected with ransomware. In that case, the email and the spreadsheet are not the payload. The ransomware is.

The same split applies to software packages. A malicious package may run a small dropper when it is installed, and that dropper then downloads the real payload. The dropper is the delivery; the credential stealer or remote-access trojan it fetches is the payload.

How does a payload work?

A payload follows three stages: delivery, execution and action. Each stage is a chance to stop it, and each stage needs a different defense.

The payload lifecycle1DeliveryPhishing, exploit,drive-by, USB2ExecutionOpened, triggered,or staged3ActionEncrypt, steal,spy, or wipeStop it at any stage, and the attack fails.
Delivery, execution, action — three chances to stop a payload. Illustration by Cysoro.

Delivery. The attacker must first get the payload onto the victim's computer. Common methods are phishing emails, malicious links, infected attachments, drive-by downloads from compromised websites, exploit kits that target unpatched software, and infected software packages.

Execution. Once delivered, the payload executes automatically or waits for a trigger. It may run when a file is opened, when a user clicks a link, at a scheduled time, or when a condition is met. Some payloads are staged: a small stub first creates a connection, then downloads the larger payload.

Action. The payload then does what the attacker wants: encrypt files, steal credentials, record keystrokes, open a remote shell, download more malware, mine cryptocurrency, or wipe data. Some payloads also try to spread to other systems.

Attackers keep payloads separate from delivery for a reason. A small, harmless-looking file is easier to distribute than a large malicious program, and a payload that arrives later is harder for antivirus to catch at the door.

What are the main types of payloads?

Almost any kind of malware can be a payload. The type tells you what the attacker wants, and what damage to expect.

Payload typeWhat it doesAttacker's goal
RansomwareEncrypts files and demands paymentMoney
KeyloggerRecords keystrokesPasswords and card numbers
Backdoor / RATOpens remote accessControl and persistence
Credential stealerSteals saved logins and tokensAccount takeover
WiperDeletes or corrupts dataDestruction
CryptominerMines cryptocurrency in the backgroundProfit from your hardware
Botnet agentJoins the device to a botnetSpam, DDoS, or further attacks

Ransomware is the most visible payload. It encrypts files and demands a ransom for the decryption key. Some ransomware also steals data first, so the attacker can threaten to publish it if the ransom is not paid.

Keyloggers monitor and record keystrokes, allowing attackers to capture login credentials, card numbers and messages. They are often part of a larger spyware payload.

Backdoors and remote-access trojans (RATs) create a secret entry point, giving attackers unauthorized access for future use. They may open a reverse shell, so the compromised computer connects out to the attacker, which is harder for a firewall to block.

Credential stealers are now the most common payload in malicious software packages, because developer laptops and CI runners hold tokens that unlock everything downstream. Wipers delete or corrupt data, and cryptominers quietly run processes in the background to mine cryptocurrency on your hardware.

How are payloads delivered?

Delivery is the attacker's logistics problem, and they have many options. The most common routes are the ones that rely on a person doing something normal: opening an email, clicking a link, or installing software.

  • Phishing emails: infected attachments, such as Word macros or PDFs, or deceptive links to a malicious download.
  • Drive-by downloads: malware installs silently when a user visits a compromised website.
  • Exploit kits: automated tools that probe for vulnerabilities in unpatched software and deliver a payload when they find one.
  • Malicious downloads: pirated software, fake updates or free tools that bundle a payload.
  • USB drives and removable media: a drive that runs code when it is plugged in.
  • Compromised packages: a malicious update to a software library or dependency that runs code on install.

Cloudflare notes that one in every 359 emails contains a malicious payload, and that the ratio is trending upward. That is why email filtering, patching and user training all matter: each one blocks a different delivery route.

Our guide to spear phishing shows how targeted phishing emails deliver payloads to a chosen person, rather than to a mass list.

What are staged, fileless and dormant payloads?

Not every payload arrives as one file, and not every payload runs at once. Attackers use staging, fileless techniques and dormant triggers to stay hidden.

Staged payloads arrive in two parts. A stager is a small stub designed to create a connection and then pass execution to the next stage. Metasploit, the open-source penetration-testing framework, separates singles, which are self-contained, from staged payloads in this way. A stager keeps the first file small and lets the attacker choose the final payload later.

Fileless payloads run in memory without writing a file to disk, often using tools already on the system, such as PowerShell. They are harder for traditional antivirus to catch, because there is no file to scan.

Dormant payloads wait for a trigger. A logic bomb is a payload that waits for a specific condition, such as a date, a user action, or an employee no longer being on a payroll list. When the condition is met, the payload runs. Other payloads wait for a command from the attacker's server.

Attackers also encrypt payloads to hide malicious code from antivirus detection. The payload is decrypted only when it runs, which makes it harder to spot in advance.

What does a payload attack look like in practice?

Here is a realistic chain, using the stages above. Each step is simple on its own, which is why the whole chain is hard to spot.

A payload attack, step by step1 Phishing email arrives with a spreadsheet attachment2 Victim opens it and enables macros — the exploit runs3 A small stager downloads the real payload in the background4 The payload waits, then encrypts files and steals credentials5 Ransom note appears — files are locked, data may be stolenFictional example. The email is delivery; the ransomware is the payload.
One click can start a chain that ends in ransomware. Illustration by Cysoro.

Notice what the payload does not do: it does not spread itself, and it does not need to be large. The delivery code handles spreading and hiding, the payload handles damage. That is why payloads are often small, encrypted and staged.

The same pattern appears in software supply-chain attacks. A malicious package runs a small dropper when it is installed, the dropper posts to a server, and the server replies with the payload. In the axios compromise in March 2026, the malicious code installed by npm was a 4,209-byte dropper, not the full payload.

How do you know if a payload is running?

Payloads try to stay quiet, but they leave signs. Watch for behavior that does not fit the device or the user.

  • Files change suddenly: files are renamed, encrypted, or a ransom note appears.
  • New processes: unknown programs run at startup, or a shell appears in a container that should never run one.
  • Unexpected network traffic: connections to unknown hosts, especially at odd hours, or large uploads.
  • Performance drops: high CPU or disk use from a cryptominer or a scan running in the background.
  • Accounts act strangely: passwords stop working, mail-forwarding rules appear, or new MFA devices are added.
  • Security tools are disabled: antivirus is turned off, or logs are cleared.

Runtime detection is the key here, because a payload that is staged or fileless may never appear as a file to scan. Our guide to cloud native security explains runtime protection for containers, and the same idea applies to laptops and servers: watch behavior, not just files.

How do you stop malicious payloads?

There is no single fix, because payloads arrive by many routes. The goal is layers, so that when one fails, the next one catches the attack.

  1. Patch promptly. Exploit kits target unpatched software, so keep your operating system, browser and apps updated.
  2. Block the delivery. Use email filtering, block macros in attachments from the internet, and be wary of downloads from unknown sources.
  3. Run updated endpoint protection. Antivirus and endpoint detection can catch known payloads and flag suspicious behavior.
  4. Apply least privilege. A payload running as a normal user can do less damage than one running as an administrator. Do not run daily work as admin.
  5. Segment and back up. Network segmentation limits spread, and offline backups let you recover from ransomware without paying.
  6. Watch runtime behavior. Log processes, network connections and file changes, and investigate anomalies quickly.

Always scan downloaded files, even if they appear to come from a trusted source. That is Cloudflare's general rule, and it applies to email attachments, software updates and files from colleagues as well.

Check the public side of your own site for common misconfigurations with our security headers checker. A site that leaks information or allows unsafe headers is easier to use as a delivery route for a drive-by download.

What should you do if a payload runs?

Act quickly, and do not pay a ransom as a first step. Speed matters, because a payload may encrypt, steal or spread while you decide.

  1. Disconnect the device from the network, so the payload cannot spread or exfiltrate data.
  2. Do not turn it off yet if a professional needs to investigate, unless you are told to. Note what you saw and when.
  3. Change passwords from a trusted device, starting with email and banking, and sign out of all sessions.
  4. Report it to your IT or security team, and in the US to the FBI's IC3 if money or data was lost.
  5. Restore from backup after the device is cleaned, and check that the backup is not infected too.
Do not pay the ransom firstPaying does not guarantee your files back, and it funds further attacks. CISA advises against paying, and recommends restoring from backup instead.

The bottom line

A payload is the part of an attack that does the damage, whether it encrypts files, steals passwords or opens a backdoor. The exploit and the delivery get it in; the payload is what you have to stop.

Patch promptly, block malicious delivery, apply least privilege and watch runtime behavior, so a payload has nowhere to run. You can start by checking your site's public security posture with the free SSL checker.

Frequently asked questions

What is a payload in cyber security in simple terms?

A payload is the part of an attack that does the damage. Think of a Trojan Horse: the horse is the delivery, and the soldiers hidden inside are the payload. In malware, the payload is the code that encrypts files, steals passwords or opens a backdoor.

What is the difference between a payload and malware?

Malware is the whole malicious program, including the code that spreads it and hides it. The payload is the specific part that performs the harmful action. One piece of malware can carry one or more payloads.

What is the difference between an exploit and a payload?

An exploit is the method that gains access or triggers a vulnerability. A payload is what happens next. For example, an exploit may open a flaw in a program, and the payload then installs ransomware or a backdoor.

What are the most common types of payloads?

The most common types are ransomware, which encrypts files; keyloggers, which record keystrokes; backdoors and remote-access trojans, which give remote control; wipers, which delete data; and cryptominers, which use your computer to mine cryptocurrency.

How are payloads delivered?

Payloads are delivered through phishing emails with malicious attachments or links, drive-by downloads from compromised websites, exploit kits that target unpatched software, malicious software downloads, infected USB drives and compromised software packages.

Can a payload sit dormant before it runs?

Yes. Many payloads wait for a trigger, such as opening a file, a set date and time, a user action, or a command from the attacker. A logic bomb is a payload that waits for a specific condition, such as a date or an employee leaving a payroll list.

What is a staged payload?

A staged payload arrives in two parts. A small stager first creates a connection and then downloads the larger payload. This keeps the initial file small and harder to detect, and lets the attacker choose which payload to send.

How do you detect and remove a payload?

Use updated antivirus and endpoint detection, keep software patched, and watch for unusual behavior such as new processes, unexpected network connections or files being encrypted. If you find a payload, disconnect the device, do not pay a ransom, and get professional help before restoring from backup.

Sources

  1. Cloudflare — What is a malicious payload?
  2. MITRE ATT&CK — Obtain or reuse payloads (T1346)
  3. Malwarebytes — Payload glossary
  4. Cymulate — What is a payload in cybersecurity?
  5. TechTarget — Payload (computing)
  6. CISA — Ransomware guidance
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against Cloudflare, MITRE ATT&CK, Malwarebytes and CISA ransomware guidance.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free