Malware & ransomware

What Is a Remote Access Trojan? How RAT Malware Works and How to Stop It

A remote access trojan hands an attacker the keys to your computer — files, webcam, passwords and all. Here is how it gets in, what it does, and how to get it out.

Cysoro Security TeamPublished · 10 min read
C:\> attacker@remote:~$whoami → adminfiles → 1,284 copiedwebcam → ONsession: LIVE — undetected Command & control MALWARE & RANSOMWARE Remoteaccess trojan Hidden control of your computer.
Quick answer

A remote access trojan (RAT) is malware that secretly gives an attacker full remote control of a computer or phone. Once installed, usually through a phishing attachment, a fake download or a cracked program, it connects to the attacker's command-and-control server and lets them run commands, steal files and passwords, log keystrokes, and switch on the webcam or microphone — often without the owner noticing.

Key takeaways

  • A RAT is a hidden backdoor that gives an attacker the same control over your device as sitting in front of it.
  • Most RATs arrive through phishing emails, fake software downloads and cracked programs, then phone home to a command-and-control server.
  • Removal means disconnecting, running a full scan, changing passwords from a clean device, and rebuilding the machine if the infection was deep.

Imagine someone sitting at your keyboard while you are out of the room — opening your files, reading your email, watching through your webcam. A remote access trojan, or RAT, does exactly that, from anywhere in the world, and its whole design is to make sure you never notice.

What is a remote access trojan?

A remote access trojan (RAT) is malware that secretly gives an attacker full remote control of a computer or phone. Once it is installed, the attacker can run commands, browse and copy files, steal passwords, record keystrokes, take screenshots and switch on the webcam or microphone.

The word "trojan" is the clue to how it works. Like the wooden horse of the old story, a RAT hides inside something that looks harmless — a game, a document, a software update — and the victim installs it themselves. TechTarget defines a RAT as malware an attacker uses to gain full administrative privileges and remote control of a target computer.

A RAT is different from most other malware in one important way: it does not just steal something and leave. It stays. It opens a hidden channel back to the attacker, waits for instructions, and keeps working across restarts. That persistence is what turns a single infection into months of spying, theft or a foothold for ransomware.

How does a remote access trojan work?

A RAT works in four stages: infection, persistence, connection to the attacker's server, and remote control. The infected device "phones home" to a command-and-control server, and the attacker sends commands back through that channel.

How a RAT takes over a device1Infectionphishing file, fakedownload or crack2Persistencehides, survivesrestarts, kills AV3Phone homebeacons to theattacker's server4Remote controlfiles, passwords,camera, more malwareThe device dials out — so firewalls that block incoming traffic do not stop it.
The four stages of a RAT infection, from the first click to full remote control. Illustration by Cysoro.

1. Infection

The RAT arrives disguised as something the victim wants: an invoice, a job application, a game mod, a "free" version of paid software, or a fake update. Opening it runs the installer silently in the background.

2. Persistence

The RAT sets itself to run every time the computer starts, often by adding a registry key or a scheduled task, and may disable or blind security software. Some use rootkit techniques to hide their files and processes from task lists.

3. Connection to command and control

The RAT beacons out to the attacker's command-and-control (C2) server. Because the connection starts from inside your network, usually over normal-looking web traffic, most home firewalls let it through. The beacon carries a check-in, and the server's reply carries the next command.

4. Remote control

From here the attacker has a live session. They can browse the file system, run shell commands, download and upload files, install more malware, and watch the screen in real time. After a RAT has run, the attacker could have done anything the user account could do, for as long as the session lasted.

What can a RAT do once it is installed?

Almost anything the device owner can do — and several things they cannot. A RAT gives the attacker the keys to the machine, and the most dangerous capabilities are the quiet ones: stealing, watching and spreading.

  • Steal passwords and files: keylogging records every keystroke, including banking logins; saved browser passwords, documents and crypto wallets can be copied out.
  • Spy on you: screenshots, screen recording, webcam and microphone activation, and on phones, message reading and location tracking.
  • Install more malware: ransomware, infostealers and cryptominers are commonly delivered as a second stage through a RAT.
  • Use your machine for attacks: infected computers can be grouped into a botnet and used for spam, credential stuffing or distributed denial-of-service attacks.
  • Move deeper into a network: in a business, a RAT on one employee's laptop is a foothold for lateral movement to servers and other machines.
  • Destroy or lock data: files can be deleted, encrypted or held for ransom, and system settings changed to keep the attacker in control.

The webcam risk is the one people find most unsettling, and it is real: RAT operators have been caught watching victims through their cameras for months. Covering the camera helps, but it does nothing about the files and passwords.

How do RATs spread?

Phishing is the most common route, followed by fake downloads and cracked software. Attackers go where victims already click, and they dress the RAT as something the victim expects to see.

  • Phishing emails and messages: an attachment or link that looks like an invoice, a delivery notice or a job offer. Our guide to what spear phishing is shows how targeted versions of these messages work.
  • Malicious downloads: free apps, pirated media, game cheats and "cracked" software bundled with a hidden RAT.
  • Fake updates: pop-ups warning that your browser, Flash player or antivirus is out of date, linking to a malware installer.
  • Compromised websites and ads: exploit kits on hacked sites can install a RAT by exploiting unpatched browser or plugin vulnerabilities.
  • Physical access: someone with hands on the device — a malicious insider, a stolen laptop, an "evil maid" attack — can install one directly.
  • Supply-chain and package attacks: look-alike software packages in open-source registries have carried RAT payloads, as researchers have documented in npm and PyPI packages.

On phones the pattern is the same, with one twist: malicious apps installed from outside the official app stores are the main route, along with phishing links sent by text message.

RAT vs virus vs backdoor vs spyware: what is the difference?

These terms overlap, and vendors use them loosely, but the distinctions matter when you are deciding how serious an infection is and what to do about it.

Malware typeWhat it doesSpreads by itself?Main danger
Remote access trojanGives an attacker live remote controlNo — needs a trick to installTotal control, spying, staging for ransomware
VirusCopies itself into files and programsYes, when infected files runCorruption and spread across files
BackdoorA hidden way back into a systemNoQuiet re-entry after cleanup
SpywareSecretly watches and records activityUsually noStolen credentials and private data
InfostealerGrabs credentials and files, then exitsNoFast credential theft
RootkitHides malware from the systemNoMakes other malware invisible

A single infection often combines several of these: a RAT may arrive with a rootkit to hide it, act as a backdoor for re-entry, and include spyware features such as keylogging. The key difference from an infostealer is the live session — after an infostealer runs, you rotate what it could read, but after a RAT runs, you must assume the attacker saw everything the account could reach.

What are some well-known RAT examples?

RATs have been around since the late 1990s, and the famous names show how the same idea keeps coming back in new packaging. Knowing the names helps you recognize them in threat reports.

  • Back Orifice (1998): one of the earliest well-known RATs, built as a remote administration tool for Windows and quickly adopted by attackers.
  • DarkComet: a widely used RAT sold as a "remote administration tool" that became a staple of cybercrime and surveillance campaigns before its author shut it down.
  • njRAT (Bladabindi): a long-running RAT family spread through phishing and cracked software, used to steal credentials and control victims' machines.
  • AsyncRAT and QuasarRAT: modern open-source RATs whose code is freely available, which makes them cheap for attackers to customize and hard for defenders to fingerprint.
  • Poison Ivy: a RAT used in targeted espionage campaigns against governments and companies in the 2010s.

Attackers also abuse legitimate remote-access software. MITRE ATT&CK technique T1219: Remote Access Tools documents groups using TeamViewer, AnyDesk and Ammyy Admin as interactive command-and-control channels — including Carbanak, which used them to move inside bank networks. A remote-access tool on a machine that nobody in IT installed is a red flag, not a convenience.

How do you know if you have a RAT? 10 warning signs

RATs are built to hide, so there is rarely a single obvious symptom. Look for a pattern of small oddities, especially several at once.

  1. Mouse moves or windows open by themselves. The clearest sign of a live remote session.
  2. Webcam light turns on when you are not using it. Check which program is using the camera.
  3. Computer slows down or fans spin up at idle. The RAT may be recording, uploading or mining in the background.
  4. Unknown programs, browser extensions or scheduled tasks appear.
  5. Antivirus is disabled, or you cannot open security settings.
  6. Files are moved, renamed or deleted without you touching them.
  7. Unusual outbound network traffic at odd hours, or to unknown destinations.
  8. Passwords stop working or accounts show logins from places you have never been.
  9. Friends receive strange messages from your accounts.
  10. System settings change: new user accounts, changed firewall rules, or remote-access features switched on.

One sign alone can have an innocent explanation. Three or four together should be treated as an infection until proven otherwise. If you suspect a RAT, check whether any passwords you use appear in known breaches with our pwned password checker — from a clean device, not the suspect one.

How do you detect a remote access trojan?

Detection works best in layers, because a RAT that hides from one check may trip another. Start with the checks you can do yourself, then use security tools for the rest.

Four places to look for a RAT1. Running processes and tasksUnknown processes, odd names, programsrunning from temporary folders2. Network connectionsOutbound connections to unknown IPs,regular beacons at odd hours3. Startup and persistenceNew autostart entries, scheduled tasks,registry keys you did not create4. Remote-access toolsTeamViewer, AnyDesk or VNC installedwithout IT approval — check MITRE T1219
Where a RAT leaves traces: processes, network traffic, startup entries and remote-access tools. Illustration by Cysoro.
  • Run a full antivirus and anti-malware scan with up-to-date definitions, and a second-opinion scanner if the first finds nothing.
  • Check outbound connections: on Windows, netstat -ano in a terminal lists connections; look for unknown foreign addresses and processes you do not recognize.
  • Review startup items and scheduled tasks for entries pointing at unfamiliar files, especially in temporary folders.
  • Look for remote-access tools you did not install. In a business, application allowlisting blocks unapproved remote tools entirely — a mitigation MITRE recommends for T1219.
  • Watch for beacons: security teams look for regular, small outbound connections at fixed intervals, which is the RAT checking in with its server.

For a small business, the practical version is simpler: keep endpoint protection on every machine, log outbound connections centrally if you can, and treat any unapproved remote-access tool as an incident, not a quirk.

How do you remove a remote access trojan?

Act fast and assume the attacker has seen your passwords. Disconnect first, clean second, and change credentials from a device you trust — in that order.

  1. Disconnect from the network immediately. Unplug ethernet or turn off Wi-Fi so the attacker loses the live session and cannot steal more.
  2. Do not log in to anything important from the infected machine. Keylogging means anything you type may be captured.
  3. Run a full scan with reputable antivirus and a second-opinion anti-malware tool, from a bootable rescue disk if possible.
  4. Change all passwords from a clean device — email first, then banking, then everything else — and turn on multi-factor authentication. Use unique passwords, ideally from a password manager.
  5. Check for new accounts, forwarding rules and unknown devices in your email and cloud accounts, and revoke sessions you do not recognize.
  6. Reinstall the operating system if the RAT had administrator access or the scan cannot guarantee a clean machine. This is the only way to be sure no hidden backdoor remains.
  7. Report it: tell your IT team at work, and in the US report fraud and losses to the FBI's Internet Crime Complaint Center at ic3.gov.
Do not just delete the fileDeleting the RAT executable is not enough. A RAT usually leaves persistence entries and may have installed other backdoors, so a scan plus password resets — and a reinstall for serious cases — is the safe path.

How do you protect yourself from RATs?

Prevention is mostly about the front door: the RAT only works if something lets it in. Close the common entry points and it has nowhere to start.

  • Do not open unexpected attachments or click links in unsolicited messages, even from people you know — their account may be compromised.
  • Download software only from official sources. Never install cracked programs, game cheats or "free" versions of paid software.
  • Keep your system and browser updated. Patching closes the vulnerabilities exploit kits use to install RATs silently.
  • Use reputable endpoint protection with behaviour monitoring, and keep it running. The UK's NCSC recommends keeping anti-malware up to date as a basic defence.
  • Use application allowlisting at work so only approved software can run, and block unapproved remote-access tools.
  • Limit administrator rights: do not browse or open email as an administrator; a RAT inherits the rights of the account that runs it.
  • Train your team: short, regular phishing awareness training beats a yearly lecture. Try our free phishing quiz as a starting point.
  • Segment your network: in a business, a RAT on one laptop should not be able to reach your servers. Our small business cybersecurity checklist covers segmentation alongside backups and updates.

The bottom line

A remote access trojan is one of the most complete compromises a device can suffer: the attacker does not just steal a file, they take the seat in front of your screen. The good news is that the entry points are ordinary and fixable — phishing, fake downloads and unpatched software.

Download only from official sources, keep your software updated, run endpoint protection, and treat any remote-access tool you did not install as an emergency. And if you think a RAT is already there, disconnect, change your passwords from a clean device, and rebuild the machine rather than hoping a quick delete fixed it.

Frequently asked questions

What is a remote access trojan in simple terms?

It is malware that lets a stranger control your computer from far away, in secret. Once it is installed, the attacker can open files, type commands, steal passwords, watch your screen and turn on your camera, as if they were sitting at your desk.

How does a remote access trojan get on your computer?

Most often through a phishing email attachment, a link to a malicious download, a fake software update, or a cracked game or program. It can also be installed by someone with physical access to the device, or by exploiting unpatched software.

Can a remote access trojan infect a phone?

Yes. RATs target Android and iPhones too, usually through malicious apps installed outside the official app stores, or through phishing links sent by text or messaging apps. Once installed, a phone RAT can read messages, track location and record audio.

What is the difference between a RAT and a virus?

A virus copies itself and spreads to other files, while a RAT is a backdoor that gives an attacker remote control. A RAT does not usually spread on its own. It waits quietly for instructions from its operator, which is what makes it so hard to spot.

Is a remote access trojan the same as remote desktop software?

No, but attackers abuse the same idea. Legitimate tools such as TeamViewer or AnyDesk let you control a computer with permission. A RAT does the same thing without permission, and hides itself. Attackers also abuse real remote-access tools, which MITRE tracks as technique T1219.

Can antivirus detect a remote access trojan?

Good antivirus and endpoint protection can detect many known RATs, but new or custom-built ones often slip past signature-based detection. Behaviour monitoring, which watches for unusual outbound connections and persistence tricks, catches more of them.

Should you reset your computer if it has a RAT?

If the RAT had full administrative access, a clean reinstall of the operating system is the safest option. The attacker could have installed other backdoors or changed system settings that a scan cannot guarantee to find.

Is it illegal to use a remote access trojan?

Yes. Installing or using a RAT on someone else's device without permission is a computer crime in the US, UK, EU and most other countries, and can lead to prosecution for unauthorized access, fraud and identity theft.

Sources

  1. TechTarget — RAT (remote access Trojan)
  2. MITRE ATT&CK — Technique T1219: Remote Access Tools
  3. National Cyber Security Centre (UK) — Malware guidance
  4. CISA — Malware analysis and guidance
  5. ANY.RUN — Remote Access Trojan malware analysis
  6. Group-IB — Remote Access Trojan: RAT Malware Explained
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 MITRE ATT&CK T1219, TechTarget's RAT definition and NCSC malware 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