Awareness

Was the Malware Sample Planted to Mislead You?

Eng. Donya Bino Published  ·  16 min read

Malware

There's a question that arrives at some point in almost every serious investigation, usually late at night, and it goes something like this, which is that we found a sample, but what if someone put it there for us to find.

Most of the time the answer is that nobody did, and the sample is exactly what it appears to be, because planting credible evidence is harder than people imagine and most attackers have no reason to bother when deleting things is easier and works better. But the question is still worth asking properly, because the small number of cases where it does happen produce consequences that are far worse than a normal breach, and because the same tests that detect a plant also detect contamination, mistaken attribution, and the ordinary mess of a real investigation.

So here is how to test whether an artefact is genuine, what planted evidence actually looks like, and why the most suspicious sample is often the one that behaves perfectly.

Important Disclaimer

This article is intended for educational and defensive purposes only, and it describes general forensic reasoning and read-only investigative practices rather than guarantees or legal advice. Forensic conclusions can affect legal proceedings, regulatory decisions, and reputational outcomes, so involve a qualified forensic examiner and your legal counsel before making assertions about attribution or intent. 

Every command shown is read-only and intended for systems you own or administer, and no evidence should be examined without preserving it first. The author assumes no liability for investigative outcomes, business outcomes, or damages resulting from the use or misuse of this information.

Why the Question Matters More Than It Sounds

Asking whether a sample was planted isn't paranoia, and it's a test of whether your investigation has provenance rather than merely findings, because those are different things and only one of them survives scrutiny.

Provenance means you can say where an artefact came from, how it arrived, who touched it, and why you believe it's connected to the intrusion rather than to something else entirely. A finding without provenance is a claim that the thing exists, which is not the same as a claim that it matters.

The question also matters because the alternatives to "an attacker planted this" are not comforting, and they include a previous unrelated incident, a penetration test nobody documented, a red team artefact that was never cleaned up, a security tool dropping its own test files, or a well-meaning colleague who ran a sample to "see what it does" and left it on disk.

Each of those produces exactly the same artefact as a plant, which is why the investigation needs a method rather than a hunch.

The Four Kinds of Planted

The word "planted" covers several different things, and they call for different responses.

  • A deliberate false flag is the version people imagine, where an actor plants evidence to shift attribution onto someone else, and it's genuinely rare because it requires the actor to anticipate your investigation and to have something to gain from misdirection. It's most plausible in state-level or long-running intrusions where attribution carries political or legal weight.
  • A deliberate plant to mislead scope is more common and less dramatic, and it involves leaving an obvious artefact in one place to draw attention away from another, so the investigator spends a week on a decoy while the real persistence sits untouched.
  • An opportunistic plant happens when an attacker finds a sample from a different campaign already on the host and uses it as cover, which requires no effort at all and produces an investigation that correctly identifies malware and incorrectly attributes it.
  • An accidental plant is the most common of all, and it involves an artefact that nobody maliciously placed, such as leftover tooling from a previous test, a sample downloaded during an earlier triage and never removed, or a scanner's own proof-of-concept file.

The practical point is that only the first two involve intent to deceive you, and all four require the same provenance test.

The Provenance Tests

The method is not clever, it's just thorough, and it depends on corroboration rather than on inspection, because a single artefact can always be explained in more than one way.

Test one: does a second, independent source agree? This is the most important test in the whole article, and it means the finding should appear in at least two systems that the attacker doesn't control together. A file on disk corroborated by a process creation record, a network connection, and an authentication event is a finding, while a file on disk with nothing else is an artefact.

A planted sample is fundamentally limited in this respect, because planting a file is easy and manufacturing matching telemetry across an endpoint agent, a proxy, a firewall, and an identity provider is not, which means the absence of corroboration is the single strongest signal you'll get.

Test two: does the timeline hold together? Filesystem metadata, event logs, and network records all carry times, and they should tell a coherent story, so a file with a modification time last Tuesday and a process execution from three months ago is a contradiction that needs explaining.

The specific check is comparing the modification time, the inode change time, and the access time, because a file's contents can be timestamped by anyone with write access while the inode change time is set by the filesystem and is far harder to forge without altering the disk itself.

# Compare mtime, ctime, and atime for a suspicious file
stat /path/to/suspect.bin

# Files with a recent ctime but an old mtime are worth explaining
find / -type f -newerct "-7 days" ! -newermt "
-30 days" -ls 2>/dev/null | head -40

Test three: does the sample behave like it belongs? A piece of malware exists to do something, which means it should contain configuration, connect somewhere, persist somehow, or execute something, and a sample with no capability at all is either a decoy or a mistake.

The check is execution in an isolated environment with full network and process monitoring, because a sample that reads nothing, contacts nothing, and installs nothing is not doing what malware does, and that inconsistency between appearance and behaviour is a strong indicator.

# Static triage first, then dynamic in an isolated network only
file /path/to/suspect.bin
strings -n 8 /path/to/suspect.bin | head -60

Test four: does the artefact have a build history? Genuine malware is compiled, which leaves artefacts such as compiler metadata, linked libraries, import tables, and section characteristics, and a hastily planted sample is frequently a copy of something else or a script wrapped in a binary.

# Compiler and build hints
readelf -p .comment /path/to/suspect.bin 2>/dev/null
readelf -d /path/to/suspect.bin 2>/dev/null | head -20

Test five: does the file exist in more than one copy? Real campaigns produce the same sample on multiple hosts or the same sample in multiple stages, while a plant is usually a single instance placed deliberately, so a sample that exists exactly once, in exactly one directory, with no related files, is a sample with a provenance question.

# Search for identical files by hash across the estate
sha256sum /path/to/suspect.bin
find / -type f -exec sha256sum {} + 2>/dev/null | 
grep "<hash>" | head -20

What a Plant Usually Looks Like

Planted evidence has characteristics, and they're consistent enough to be useful even though no single one is decisive.

It tends to be discoverable rather than found, which means it sits in an obvious location, has an obvious name, or appears in the place an investigator would look first, because the point is for it to be found rather than for it to work.

It tends to be isolated, with no related files, no staging directory, no configuration, and no logs of anything it supposedly did, because the planter created one artefact rather than an intrusion.

It tends to be inconsistent with the rest of the intrusion, which means the toolchain, the language, the infrastructure, and the tradecraft don't match what else you've found, and a sample written in a different language from everything else on the host is a question worth asking.

And it tends to be too on the nose, which means the sample contains strings, comments, or naming that points at a specific actor or country more clearly than real malware ever would, because real operators don't label their work for your benefit.

The Paradox of the Perfect Sample

There's a specific trap worth naming, which is that the more thoroughly a sample appears to confirm your hypothesis, the more carefully you should check its provenance.

The reason is confirmation bias, which is that an investigator under pressure will accept evidence that resolves the ambiguity, and a plant exploits that by providing exactly the clarity the investigation was missing. A sample that arrives with a clear signature, a clear attribution, and a clear motive is a sample that has answered your questions for you, and answering your questions is not what evidence does.

The disciplined position is to treat a convenient finding as a finding that requires more corroboration rather than less, and to write down what you expected to find before you look, so you can notice when the evidence matches your expectation too neatly.

Contamination: The More Likely Explanation

Before you conclude that someone planted evidence, rule out the ordinary explanations, because they account for the overwhelming majority of suspicious artefacts.

  • Unlogged testing is the first, and it means a penetration test, a red team exercise, a phishing simulation, or a purple team drill that was documented somewhere you haven't looked, which is why the first question to ask is who else has access and what have they run recently.
  • Leftover tooling from earlier response is the second, and it's extremely common, because an analyst who downloaded a sample during a previous incident and left it on a share is functionally indistinguishable from a planter.
  • Security tool artefacts are the third, and it means an EDR agent's test file, a scanner's proof of concept, a honeypot's captured payload, or a detection engineering exercise, all of which produce malware-shaped files that exist for legitimate reasons.
  • A previous, unrelated intrusion is the fourth, and it means the sample is genuine, real, and connected to someone else entirely, which is not a plant at all and produces a wrong attribution if you assume continuity.
# Who has been on the box, and what did they run
last -a | head -20
journalctl --since "-30 days" | grep -iE 'sudo|su:' | tail -40
ls -la /home/*/.bash_history /root/.bash_history 2>/dev/null

What Attribution Actually Requires

The question of whether a sample was planted is really a question about how much you can claim, and the honest answer is that attribution requires more than one artefact.

A defensible attribution typically rests on infrastructure overlap, which means the same command-and-control or staging infrastructure appearing in multiple incidents, code or tooling reuse, which means binaries, libraries, or build characteristics that match across cases, and operational pattern, which means tradecraft, timing, targeting, and victimology that match.

A single sample found on a single host supports a claim about that host and nothing more, and an investigation that leaps from a sample to a named actor has skipped the corroboration that would have detected a plant.

Two Scenarios

Scenario 1: The Sample That Was Too Helpful

The Setup

An organisation investigates a suspected intrusion, finds a single binary in a temporary directory, and the binary contains strings referencing a well-known actor, a command-and-control domain, and a distinctive build marker, and the report is drafted within a day naming the actor.

What Happened

The binary had no process execution record, no network connection, no persistence, and no matching file anywhere else in the estate, and the domain it referenced had never been resolved from any monitored system, and the build marker matched a publicly available sample rather than anything unique.

The Result

A second reviewer runs the provenance tests, the timeline contradiction is found within an hour, and the investigation establishes that the binary was downloaded during an earlier triage session by an analyst who had left it in /tmp and forgotten it, which means the intrusion was real, the attribution was wrong, and the report had to be withdrawn after it had already been shared with a regulator.

The Lesson

The single artefact was treated as the finding rather than as one input, and the corroboration test that would have caught it takes less time than writing the report.

Scenario 2: The Decoy

The Setup

Another organisation finds a genuine, functioning implant on a workstation, with process execution, a scheduled task, and outbound connections to a domain, and the evidence is coherent and corroborated across four systems.

What Happened

The team treats it as a real finding and then asks the provenance question anyway, which is whether anything else in the estate corroborates the same actor, and the answer is nothing, and a wider hunt finds a second, quieter mechanism on a server that has no malware at all and is using stolen credentials instead.

The Result

The implant is understood as a decoy placed to draw attention to the workstation while the credential-based access continued, and the containment work shifts to session revocation and credential rotation rather than to cleaning endpoints.

The Lesson

Asking the question doesn't require suspecting a plant, and it regularly finds the thing that the obvious finding was hiding.

Tools Worth Having in Place

Purpose

Tool

What It Gives You

Filesystem metadata

stat, debugfs, xfs_db

mtime, ctime, atime, and journal history

Timeline building

fls, istat, mactime (Sleuth Kit)

A coherent file timeline across the disk

Hash comparison

sha256sum, md5sum

Whether the file exists elsewhere

Static triage

file, strings, readelf, objdump

Build hints and capability hints

YARA

yara

Matching against known families rather than guessing

Memory analysis

Volatility

Processes and modules not visible on disk

Network corroboration

Zeek, firewall and proxy logs

Whether the sample ever communicated

Execution corroboration

Sysmon, EDR, auditd

Whether the sample ever ran

Chain of custody

Hash manifests, evidence log

Whether the artefact changed under your care

Sandbox

Isolated VM with full monitoring

Whether the sample does anything at all

How to Spot an Investigation That's Being Misled

  • A single artefact carries the whole narrative. Nothing in a real intrusion stands alone.
  • No execution record exists for a sample that supposedly ran. Something either ran or it didn't.
  • The sample never communicated. Malware with no network behaviour needs an explanation.
  • The attribution points at a named actor in the first report. Real attribution is slow and qualified.
  • The tooling doesn't match anything else found. A different language, compiler, or tradecraft is a question.
  • The file exists in exactly one place. Real campaigns reproduce; plants usually don't.
  • Nobody checked who else had access. Testing, red teams, and previous analysts are the usual explanation.
  • The evidence answers your open questions neatly. Convenience is a reason to look harder, not less.

Quick Reference: Test to What It Rules Out

Test

What You Check

What It Rules Out

Corroboration

Second independent source

A single planted file

Timeline

mtime vs ctime vs logs

Timestamp manipulation

Behaviour

Does it execute anything

A decoy or inert copy

Build artefacts

Compiler and section metadata

A hastily wrapped file

Duplication

Hash search across estate

A one-off placement

Access history

Who logged in, who ran what

Testing and contamination

Network records

Did it ever connect

Whether it was ever live

Custody

Hash manifest and evidence log

Your own handling errors

The Bottom Line

Asking whether a sample was planted isn't a conspiracy theory, it's a provenance test, and the method is corroboration rather than inspection, which means the finding has to appear in at least two systems the attacker doesn't control together before you treat it as connected to anything.

The practical position is to run the five tests on every artefact that carries weight, to rule out contamination before you consider intent, to treat a convenient finding as requiring more scrutiny rather than less, and to keep your attribution claims proportional to the number of independent sources that support them.

So run the corroboration test on your most important finding this week, which means asking which second system saw the same thing, because if the answer is none, you have an artefact rather than an intrusion, and the difference matters most when the report is already written.

FAQ

How can I tell if a malware sample was planted?

By testing provenance rather than appearance, which means checking whether a second independent system corroborates it, whether the timestamps are internally consistent, whether the sample actually executes anything, whether it has a plausible build history, and whether identical copies exist elsewhere.

Why is corroboration the strongest test?

Because planting a file is trivial and manufacturing matching telemetry across an endpoint agent, a proxy, a firewall, and an identity provider is not, so a sample that exists on disk with no execution record, no network connection, and no related artefacts is a sample with an unanswered provenance question.

What is a false flag attack?

It's a deliberate attempt to misattribute activity by leaving evidence that points at someone else, and it's genuinely rare because it requires the actor to anticipate your investigation, but it's most plausible in state-level intrusions where attribution carries legal or political weight.

Could a suspicious file just be leftover from testing?

Yes, and that's the more likely explanation by a wide margin, which is why the first questions are who else has access, what penetration tests or red team exercises have run, and whether an earlier analyst downloaded a sample and left it behind.

Why does a malware sample with no network traffic look suspicious?

Because malware exists to do something, and most families contact infrastructure at some point, so a sample that reads nothing, contacts nothing, and installs nothing is either a decoy, an inert copy, or something that was placed rather than deployed.

What does mtime versus ctime tell me?

The modification time can be set by anyone with write access, while the inode change time is maintained by the filesystem, so a file with an old modification time and a very recent change time indicates that something touched it after it was supposedly created.

What does attribution actually require?

More than one artefact, typically infrastructure overlap across incidents, code or tooling reuse, and matching operational patterns, because a single sample on a single host supports a claim about that host and nothing further.

What should I do if I suspect evidence was planted?

Preserve everything before examining it, hash the artefacts and maintain a custody log, involve a qualified forensic examiner and legal counsel, and widen the hunt rather than narrowing it, because a decoy usually exists to distract from something quieter.

Professional Services

Explore Our Cybersecurity Services

Our insights are backed by hands-on service delivery. If your business needs professional cybersecurity support, our UK-based specialists are ready to help.

© 2016 – 2026 Red Secure Tech Ltd. Registered in England and Wales — Company No: 15581067