scanrootkit

What Is a Backdoor Virus? RATs, Web Shells and Supply-Chain Backdoors

A backdoor is a way into a computer that skips the front door. Normal access goes through a login, a password and whatever security the owner set up. A backdoor bypasses all of that and lets someone connect remotely whenever they like, usually without the owner knowing.

People often call it a “backdoor virus,” but most backdoors do not spread from file to file like a true virus. They are planted, by a trojan you were tricked into running, by an attacker who broke in through a vulnerability, or occasionally by someone inside the software supply chain.

Backdoors and rootkits are close partners. The backdoor gives access, and the rootkit hides it.

How a backdoor works

Most backdoors do three things:

  1. Persist. They arrange to start again after every reboot, through a service, scheduled task, startup entry, cron job or launch agent.
  2. Communicate. They either open a port and wait for the attacker to connect, or, more commonly today, connect out to the attacker’s server and wait for instructions. Outbound connections pass through home routers and most firewalls without trouble.
  3. Take commands. Run programs, upload and download files, open a remote shell, capture the screen, or install more malware.

Types of backdoor

Type Where it lives Example use
Remote access trojan (RAT) A program on a desktop or laptop Spying on a user, stealing logins, installing more malware
Web shell A script file on a web server Controlling a website or using the server as a foothold into a network
Abused legitimate tool Remote support or management software Persistence that looks like normal IT activity
Supply-chain backdoor Inside legitimate software before you install it Access to every system that installs the affected version
Hardcoded account A hidden login in a device’s firmware Routers, cameras and other connected devices
Firmware or boot-level The motherboard’s flash chip or boot loader Surviving reinstalls; see bootkits and firmware rootkits

Remote access trojans

A RAT is the most common backdoor on personal computers. CISA describes a RAT as software that, once on a victim’s machine, “allows remote administrative control,” and in malicious use can “install backdoors and key loggers, take screen shots, and exfiltrate data.” RATs typically arrive through phishing attachments, pirated software and fake installers, the same routes as keyloggers.

Abused remote access software

Not every backdoor is malware. CISA has warned that attackers “leverage legitimate RMM and remote desktop software as backdoors for persistence.” Tech support scams work the same way: the caller persuades you to install a genuine remote support tool, and then has a way back in. Security software may not flag these tools because they are legitimate products.

Web shells

A web shell is a small script, often a single PHP, ASP.NET or JSP file, uploaded to a web server through a vulnerability or stolen credentials. Visiting its address with the right parameters lets the attacker run commands on the server. Microsoft’s incident responders note that on Windows IIS servers, the most common sign is the web server’s worker process (w3wp.exe) starting command shells such as cmd.exe or PowerShell, something it should not normally do.

For a small website, the practical checks are: keep the CMS, plugins and themes updated, remove ones you do not use, watch for PHP or script files in upload folders, and compare the site’s files against a clean copy from the vendor.

Supply-chain backdoors: the xz-utils case

The most striking recent backdoor was not delivered by phishing at all. It was written into an open-source project used by nearly every Linux distribution.

The affected versions had mostly reached development and testing releases rather than stable distributions, so the damage was limited. The lesson for defenders is that a backdoor can arrive through a trusted, signed update. The defences are boring but effective: keep track of what software you run and where it came from, apply vendor security advisories quickly, and watch systems for behaviour that does not fit, which is exactly how this one was caught.

How to detect a backdoor

Backdoors are built to be quiet, so look for what they cannot avoid doing: starting up and communicating.

Check what starts automatically

Check network connections

On the computer itself:

netstat -ano

on Windows lists connections with the ID of the process that owns each one, which you can match in Task Manager’s Details tab. On Linux, sudo ss -tunap does the same.

A rootkit can hide connections from both. Your router, a separate firewall or a DNS filtering service sees traffic from outside the computer, so a connection that appears there but not on the machine itself is a strong sign that something is being hidden.

Scan from outside

Run a full scan, then an offline scan that boots outside the installed system, such as the Microsoft Defender Offline scan. This catches backdoors protected by a rootkit that a normal scan would miss. See how to detect a rootkit.

Watch for indirect signs

CISA’s red team guidance makes the point that monitoring should be “primarily behavior-based, rather than IOC-centric.” Known-bad file lists catch yesterday’s backdoors. Unusual behaviour catches new ones.

If you find one

  1. Disconnect the device from the network. On a server, consider taking a memory image first if you may need forensics.
  2. Change credentials from a different, clean device. The attacker may have captured passwords and keys, and stolen credentials work without the backdoor. On servers, rotate SSH keys, API keys and database passwords too.
  3. Decide between cleaning and rebuilding. A RAT caught early by a reputable scanner can often be removed. For a server, or anything where the attacker had administrator or root access for a while, rebuild from clean media and restore data, not programs, from a backup made before the compromise.
  4. Find the way in. Patch the vulnerability, remove the unused plugin or close the exposed service that let the backdoor in, or it will be back.

How to remove a rootkit covers the clean-or-rebuild decision in detail, and how to check for malware is the broader starting point if you are not sure what you are dealing with.

Frequently asked questions

What is a backdoor virus?
A backdoor is malware or a hidden mechanism that lets someone access a computer remotely while bypassing its normal login and security. "Backdoor virus" is a common name for it, though most backdoors do not spread like a true virus. They are installed by a trojan, an exploit or an intruder.
What is the difference between a backdoor and a rootkit?
A backdoor provides access. A rootkit provides concealment. They are often used together, with the rootkit hiding the backdoor's files, processes and network connections from the owner and from security tools.
What is a RAT?
A remote access trojan, malware that gives an attacker remote control of a computer. CISA describes RATs as able to install further backdoors and keyloggers, take screenshots and exfiltrate data.
What was the xz-utils backdoor?
A backdoor deliberately inserted into versions 5.6.0 and 5.6.1 of XZ Utils, a compression library used across Linux. It was discovered in March 2024 before it reached most stable distributions and is tracked as CVE-2024-3094. The fix was to downgrade to an uncompromised version such as 5.4.6.
Can a backdoor survive reinstalling the operating system?
An ordinary backdoor cannot survive a full wipe and reinstall. One stored in firmware, or one built into a legitimate software package you reinstall, can. Rotating passwords and keys matters too, because an attacker with stolen credentials does not need the backdoor at all.