Trojans, Backdoors, and RATs
A trojan disguises itself as legitimate software so the victim runs it; a backdoor is the hidden access an attacker leaves to get back in; a RAT (Remote Access Trojan) combines both and adds interactive control of the machine. They’re three pieces of the same “access and control” family seen in the fundamentals. This page treats them from analysis and detection: how they operate conceptually, what artifacts they leave, and how to hunt them.
Concepts and differences
Section titled “Concepts and differences”- Trojan — the vector: a file that looks useful (installer, crack, document) and hides a malicious payload. It defines how it gets in, not what it does afterward.
- Backdoor — the access: a mechanism that lets the attacker reconnect without re-exploiting anything (a hidden service, an added credential, a listening port).
- RAT — the control: client/server giving the operator a remote console: files, shell, webcam, keylogging, pivoting.
In practice they overlap: a trojan delivers a RAT that includes a backdoor to persist.
How they operate (conceptual)
Section titled “How they operate (conceptual)”flowchart LR E[Deception<br/>trojan] --> X[Execution] X --> C[C2 channel<br/>client/server] C --> O[RAT capabilities<br/>shell · files · keylog · webcam] X --> B[Backdoor<br/>persistent reconnection]
- Initial execution by deception: the user opens what they believe is legitimate (see Social engineering).
- Client/server architecture: the implant (server) on the victim connects out to the operator (client), usually outbound to cross NAT/firewall.
- C2 channel: the detail on channels, beaconing, and detection is in Command & Control.
- Typical RAT capabilities: command execution, file transfer, screen/keyboard capture, webcam/mic access, pivoting into the internal network.
The “undetectable” myth (FUD)
Section titled “The “undetectable” myth (FUD)”Joiners/binders (bind the RAT to a legitimate file) and crypters (encrypt the payload to break signatures) are sold with the promise of being FUD (“Fully UnDetectable”). The myth doesn’t hold: obfuscation breaks static signatures for a while, but runtime behavior (periodic outbound connection, injection, webcam access) is still detectable by EDR and network analysis. “Undetectable today by signatures” isn’t “undetectable.” See Obfuscation and packing and Defense evasion.
Red Team
Section titled “Red Team”In authorized exercises, RATs/implants are used to test detection and response (modern C2 frameworks are, in essence, professional RATs). What matters for the report is which implant capabilities the blue team caught and which went unnoticed — not “I got control.” Recognizing the artifacts of commercial and commodity RATs (AsyncRAT, Remcos, njRAT) is shared work with the blue team.
Blue Team
Section titled “Blue Team”Detection
Section titled “Detection”- Network: periodic outbound connection to a fixed/rare destination (beacon analysis); unusual ports/protocols for that process.
- Endpoint: a process accessing webcam/mic/clipboard, keyboard hooks, or spawning shells; correlation with persistence.
- Signatures: many commodity RATs have public YARA rules due to code reuse.
Telemetry
Section titled “Telemetry”- Sysmon network connect (3), process create (1) with command line, image load (7); proxy/DNS logs.
- Device access (webcam/mic) and browser-credential access as high-priority signals.
Response
Section titled “Response”Isolate, identify all persistence mechanisms and the backdoor (there may be several), extract C2 IOCs, rotate exposed credentials, and rebuild if there was prolonged access (see DFIR).
CVEs and real-world cases
Section titled “CVEs and real-world cases”- njRAT, AsyncRAT, Remcos, QuasarRAT — heavily reused commodity families; their open or leaked code makes them ubiquitous and well-signed.
- RATs as a targeted espionage vector: multiple APTs use custom RATs with DLL sideloading to persist (see Persistence).
- ATT&CK: T1219 (Remote Access Software), T1071 (Application Layer Protocol / C2), T1105 (Ingress Tool Transfer), T1113/T1125 (screen/webcam capture).
Testing checklist
Section titled “Testing checklist”- Classify the sample: trojan (vector) / backdoor (access) / RAT (control)
- Identify the channel and the C2s (see Command & Control)
- Enumerate capabilities (shell, files, keylog, webcam, pivoting)
- Locate backdoor(s) and associated persistence
- Joiner/binder/crypter? → unpack and sign in memory
- Extract IOCs (C2, mutex, paths) and look for the family’s YARA rule
- Detection: beacon analysis + device/credential access
- Response: isolate, clean all access, rotate credentials