Overview Types Techniques Notable Backdoors Demo Detection Prevention Incident Response Comparison Legal Resources

Backdoors Guide

What is a Backdoor?

A backdoor is a clandestine method of bypassing normal authentication, encryption, access controls, or security mechanisms to gain unauthorized remote access to a computer system, application, network, or device. Backdoors can be intentionally placed by developers (for maintenance, debugging, or technical support) or, far more commonly, installed by attackers to maintain persistent access after an initial compromise. Backdoors are a foundational component of advanced persistent threats (APTs), botnets, and targeted cyberattacks.

Historical Context: The term "backdoor" originated from physical building security, referring to hidden entrances for covert entry. In computing, backdoors have existed since the early days of networking (1980s). One of the first documented network backdoors was the "Back Orifice" tool released by Cult of the Dead Cow at DEF CON 6 (1998), demonstrating Windows remote administration vulnerabilities. The term became widely known after the 1999 Melissa virus and the 2000 ILOVEYOU worm, which installed backdoors on infected systems.

Backdoors enable attackers to perform malicious actions including:

Types of Backdoors

Network Listening Backdoors Most Common

Bind to a network port (TCP/UDP) and listen for incoming connections from attackers. Common ports: 443 (HTTPS masquerade), 8080 (HTTP alternate), 4444, 1337, 31337 (elite), 6666-6669. Can be detected via netstat/nmap. Firewalls may block inbound connections.

Reverse Shell Backdoors (Callback)

Initiate outbound connections to attacker-controlled C2 servers, bypassing firewall restrictions that block inbound connections. The compromised system "phones home" at regular intervals (beaconing). Most common type in modern attacks (evades NAT/firewalls). Use HTTP/HTTPS/DNS tunneling for C2 communication.

Authentication Backdoors

Bypass login mechanisms through hardcoded credentials (backdoor passwords), modified authentication routines (altered login binaries), credential sniffing, or forged authentication tokens. Examples: SSH backdoor in OpenSSH, Windows Logon bypass via sethc.exe replacement (Sticky Keys backdoor).

Hardware & Firmware Backdoors

Embedded in device firmware (UEFI/BIOS), network cards (NIC firmware), hard drive controllers, Baseboard Management Controllers (BMC), or Trusted Platform Module (TPM). Extremely persistent and survives OS reinstalls, disk wipes, and even hardware replacement. Nation-state capability (Equation Group, NSA).

RATs (Remote Administration Trojans)

Full-featured backdoors providing comprehensive remote control capabilities including file management (upload/download/delete), remote shell (CMD/PowerShell/bash), keylogging, screen capture (screenshots/video), webcam access, password recovery, and network proxy. Examples: DarkComet, Gh0st RAT, Poison Ivy, Quasar, Orcus.

Supply Chain Backdoors

Hidden within legitimate software during development, build, or distribution (compromised compilers, update servers, code repositories). Extremely dangerous as software is digitally signed and trusted. Examples: SolarWinds SUNBURST (2020), CCleaner backdoor (2017), NotPetya (via MeDoc accounting software).

Web Application Backdoors (Web Shells)

Malicious scripts (PHP, ASP, JSP, Python) uploaded to web servers via file upload vulnerabilities, SQL injection, or misconfigured permissions. Provide remote command execution through HTTP/HTTPS requests. Common names: shell.php, cmd.aspx, b374k, c99 shell, r57 shell. Used to compromise hosting environments and pivot to internal networks.

SSH Backdoors & Hidden Tunnels

Unauthorized SSH keys added to authorized_keys files, modified SSH daemon (sshd) with backdoor password, or SSH reverse tunnels created for persistent access. SSH tunneling can bypass most firewalls.

Backdoor Techniques & Capabilities

Remote Access & Command Execution

Provides command-line (CMD, PowerShell, bash), GUI (VNC, RDP), or API-based access to compromised systems from anywhere in the world. Supports interactive shell, single command execution, scripted automation, and file system browsing.

Privilege Escalation (Privesc)

Gains higher-level access (SYSTEM/root) to execute privileged operations, bypass UAC (Windows) or sudo restrictions (Linux). Escalation techniques include exploiting vulnerable services, kernel exploits, credential dumping (Mimikatz), and scheduled task abuse.

Persistence Mechanisms (Survive Reboots)

Ensures backdoor survives system reboots, user logouts, and security scans. Methods: Windows Registry (Run, RunOnce, Services), scheduled tasks (schtasks), startup folders, WMI event subscriptions, Linux cron jobs (@reboot), systemd services, .bashrc/.profile modifications, and launch daemons (macOS).

Data Exfiltration & Theft

Steals sensitive data including saved credentials (browsers, email, FTP), documents (Word, Excel, PDF), intellectual property (source code, patents), cryptocurrency wallets, SSH keys, and configuration files. Exfiltrates via HTTPS, FTP, DNS tunneling, or custom encrypted protocols.

Anti-Detection & Evasion

Hides processes (process hiding), files (rootkit techniques), network connections (filtering netstat), and registry keys from security software. Detects virtual machines (VM evasion), sandboxes, and analysis tools (debuggers, process monitors). Uses encrypted C2 communication, domain generation algorithms (DGA), and fast-flux networks to evade blacklisting.

Lateral Movement & Network Propagation

Uses compromised system as a pivot point (jump host) to attack other systems on the same network. Techniques: SMB/PsExec, RDP, WinRM, WMI, SSH hopping, pass-the-hash, credential dumping, and ARP scanning. Enables worm-like spread.

Surveillance & Monitoring

Captures keystrokes (keylogging), takes screenshots (periodic or on-demand), accesses webcam and microphone (video/audio surveillance), records clipboard contents, and monitors user activity. Used for espionage and extortion.

Proxy & Relay Capabilities

Turns compromised system into a SOCKS proxy, HTTP proxy, or VPN endpoint. Allows attackers to route traffic through victim's IP address (anonymity, geofence bypass), launch attacks that appear from victim's network, and bypass IP-based restrictions.

// Common backdoor persistence locations and methods # Windows Persistence # Registry Run Keys (user login) reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v "WindowsUpdate" /t REG_SZ /d "C:\backdoor.exe" reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v "Updater" /t REG_SZ /d "C:\backdoor.exe" # Windows Service (SYSTEM privileges, auto-start) sc create "BackdoorSvc" binPath= "C:\backdoor.exe" start= auto sc config "BackdoorSvc" obj= LocalSystem # Scheduled Task (persists across reboots) schtasks /create /tn "SystemMaintenance" /tr "C:\backdoor.exe" /sc onstart /ru SYSTEM # WMI Event Subscription (advanced persistence) wmic /namespace:\\root\subscription PATH __EventFilter CREATE Name="BootFilter", Query="SELECT * FROM Win32_ComputerSystemEvent WHERE EventType=1" # Linux Persistence # Cron job (@reboot runs on boot) (crontab -l 2>/dev/null; echo "@reboot /usr/local/bin/backdoor") | crontab - # Systemd service (auto-start) cat > /etc/systemd/system/backdoor.service << EOF [Service] ExecStart=/usr/local/bin/backdoor [Install] WantedBy=multi-user.target EOF systemctl enable backdoor.service # SSH authorized_keys (persistent SSH access) echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ..." >> ~/.ssh/authorized_keys # .bashrc / .profile (user login persistence) echo "/usr/local/bin/backdoor &" >> ~/.bashrc # macOS Launch Daemon (persistence) cat > /Library/LaunchDaemons/com.apple.backdoor.plist << EOF KeepAlive ProgramArguments/usr/local/bin/backdoor EOF launchctl load /Library/LaunchDaemons/com.apple.backdoor.plist

Notable Backdoor Families & Malware

NetBus (1998)

One of the first widely known backdoors, created by Swedish developer Carl-Fredrik Neikter. Allowed remote control of Windows systems with features including keylogging, screen capture, file management, process control, and audio recording. Used in early DDoS attacks.

Sub7 / SubSeven (1999-2002)

Popular backdoor from the early 2000s with extensive features including port redirection (proxy), UDP flooding (DDoS), password theft (cached credentials), ICQ/IRC-based command control, keylogger, screen capture, and plug-in support. Creator (Mobman) ceased development in 2002.

Back Orifice (BO) & BO2K

Created by Cult of the Dead Cow (cDc) and released at DEF CON 6 (1998). Designed to demonstrate Windows remote administration security weaknesses. Provided remote control, file transfer, registry editing, keylogging, and plug-in architecture. Named as parody of Microsoft BackOffice.

Poison Ivy (PI RAT)

Sophisticated RAT (2005) used in numerous targeted attacks and APT campaigns (Operation Aurora, 2009). Known for its stealth capabilities, customizability, encrypted C2 communication, keylogging, screen capture, and file theft. Attributed to Chinese threat actors (APT1, Comment Crew).

Gh0st RAT

Chinese-origin backdoor (2008) used extensively in cyber espionage operations against government, military, diplomatic, and corporate targets (Shadow Network, 2009). Features plug-in architecture, encrypted C2 traffic, keylogging, screen capture, webcam access, and file management. Source code leaked in 2009 leading to many variants.

DarkComet RAT

Full-featured RAT developed between 2008-2014 with plug-in architecture (plugin system), keylogger, screen capture, webcam access, file management, remote shell, password recovery (browsers, email clients), DDoS capabilities, and registry editing. Developer ceased distribution in 2014 due to malware abuse. Used by Syrian regime for surveillance (2011-2012).

BlackShades RAT

Commercial RAT sold for $40 to thousands of users worldwide before FBI takedown (Operation Cyber Sweep, 2014). Used for surveillance (webcam access), ransomware (Cryptolocker integration), DDoS attacks, and cryptocurrency theft. Over 6,000 users in 100+ countries. FBI arrested 97 individuals globally.

Zeus (Zbot) - Backdoor Component

Banking Trojan (2007-2014) with integrated backdoor capabilities. Infected millions of systems, creating massive botnet (GameOver Zeus). Stole billions in financial assets via web injection (man-in-the-browser), form grabbing, and credential theft. Backdoor allowed remote control for additional malware deployment.

X-Agent (Sofacy/Fancy Bear)

Sophisticated backdoor used by Russian GRU (Fancy Bear, APT28) targeting defense contractors, military organizations, and government agencies. Features modular architecture, encrypted C2, keylogging, screen capture, file theft, and credential harvesting. Used in DNC hack (2016), World Anti-Doping Agency (WADA) breach.

SUNBURST (SolarWinds, 2020)

Supply chain backdoor inserted into SolarWinds Orion IT management software (March-June 2020 updates). Compromised over 18,000 organizations including US government agencies (DHS, Treasury, Commerce, Energy), Fortune 500 companies, and think tanks. Remained undetected for 9 months. Attributed to Russian APT29 (Cozy Bear).

Cobalt Strike (Misused Legitimate Tool)

Commercial penetration testing tool (Cobalt Strike Beacon) widely misused by attackers as a backdoor. Provides beaconing C2, remote shell, keylogging, screen capture, file upload/download, privilege escalation, and lateral movement. License leaked/stolen copies used by ransomware groups (Conti, REvil, LockBit).

China Chopper (Web Shell)

Simple but effective web shell backdoor (PHP, ASP, JSP) used extensively by Chinese threat actors. Provides file management, command execution, database access, and privilege escalation via HTTP POST requests. Detected via small size (2-4KB) and consistent User-Agent string.

Backdoor Remote Command Simulation

This demonstration simulates how backdoors (specifically RATs) execute remote commands on infected systems after establishing C2 communication. Available commands: help, date, time, ip, system, whoami, ls, capture, netstat, processes, upload, download

Enter a command to see simulated backdoor response. Real backdoors execute actual system commands, upload/download files, and access webcams without user knowledge.

This is a simulated demonstration for educational purposes. Real backdoors (RATs, web shells) can execute any system command, transfer files, access the registry, manage processes, capture screenshots, and control infected devices completely without user knowledge or consent. Network backdoors often use encrypted C2 channels (HTTPS, DNS tunneling) to evade detection.

Detecting Backdoors (Indicators of Compromise)

Network Monitoring & Anomaly Detection

Monitor for unexpected outbound connections (beaconing) to suspicious IP addresses, especially on common backdoor ports (443, 8080, 4444, 1337). Look for regular check-in intervals (every 30-60 seconds), DNS queries to algorithmically generated domains (DGA), and unusual traffic patterns (large data exfiltration).

Process & Memory Analysis

Identify suspicious processes with random names (svch0st.exe, winupdate.exe), running from temp directories (%Temp%, %AppData%), or masquerading as legitimate software. Check parent-child process relationships (e.g., Microsoft Word spawning cmd.exe). Memory forensics can detect injected code and hidden processes.

File System & Registry Anomalies

Check for unexpected executables in startup folders, scheduled tasks, Windows Registry run keys (HKLM\Run, HKCU\Run), and Windows services. Look for web shells in web server directories (shell.php, cmd.aspx, /uploads/). Audit SSH authorized_keys files for unauthorized keys.

Security Software & EDR Alerts

Antivirus/EDR detections for known backdoor families (DarkComet, Gh0st, Poison Ivy, Cobalt Strike). Behavioral detection alerts for command and control (C2) communication, process injection, and persistence installation. Windows Defender alerts for suspicious PowerShell or WMI activity.

Log Analysis (Authentication & Security)

Review security logs for unusual login patterns (after-hours logins, logins from unexpected geolocations), account lockouts, privilege escalation events (new local admin accounts), service installations (new services with random names), and scheduled task creations.

Port & Service Scanning

Use netstat, TCPView, or nmap to identify listening ports (netstat -ano | findstr LISTENING). Look for unexpected services bound to non-standard ports. Compare baseline of known-good services with current state.

// Backdoor detection commands (Windows) # Check all listening ports (potential backdoor listeners) netstat -ano | findstr LISTENING # Review established outbound connections (C2 beaconing) netstat -ano | findstr ESTABLISHED # List all running processes with executable paths wmic process get name,executablepath,processid # Review all scheduled tasks (persistence) schtasks /query /fo LIST /v | findstr "TaskName\|Task To Run" # Check auto-start registry locations reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Run reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Run # List Windows services (look for suspicious names) sc query state= all | findstr "SERVICE_NAME" # Search for web shells in IIS web directories dir C:\inetpub\wwwroot\*.php /s dir C:\inetpub\wwwroot\*.aspx /s # Windows Defender offline scan (recommended for persistent backdoors) Start-MpWDOScan # Check for unauthorized SSH keys (Linux) cat ~/.ssh/authorized_keys cat /root/.ssh/authorized_keys cat /home/*/.ssh/authorized_keys # Check for cron job persistence (Linux) crontab -l cat /etc/crontab ls -la /etc/cron.*/

Preventing Backdoor Infections

Patch Management & Vulnerability Remediation

Apply security patches immediately (critical within 48 hours). Backdoors often exploit unpatched vulnerabilities (EternalBlue, Log4j, BlueKeep) for initial access. Prioritize external-facing systems, RDP, SMB, and web servers.

Firewall Configuration & Network Segmentation

Block unnecessary inbound ports (especially RDP 3389, SMB 445, SQL 1433) at perimeter. Restrict outbound connections to approved destinations only. Implement network segmentation (VLANs, Zero Trust) to limit lateral movement. Use egress filtering to block unauthorized C2 communication.

Endpoint Detection & Response (EDR/XDR)

Deploy EDR/XDR solutions (CrowdStrike, Microsoft Defender for Endpoint, SentinelOne, Carbon Black) with behavioral detection. Enable real-time monitoring for C2 communication, process injection, and persistence installation.

Principle of Least Privilege (PoLP)

Run with minimal privileges (standard user, not admin). Backdoors require elevated access for persistence (service installation, registry modification). Use separate admin accounts only for administrative tasks. Disable local admin rights for standard users.

Application Allowlisting (AppLocker)

Implement application allowlisting to prevent unauthorized executables (backdoors, web shells) from running. Block executables from %Temp%, %AppData%, and Downloads folders. Restrict PowerShell and scripting languages.

Email Security & Phishing Defense

Implement email filtering (SPF, DKIM, DMARC), block malicious attachments (macros, scripts, executables), and conduct security awareness training (phishing simulations). 94% of backdoors are delivered via phishing emails.

Supply Chain Security

Verify software digital signatures and checksums (SHA-256) before installation. Use trusted sources (official vendors, not third-party download sites). Monitor software vendors for supply chain compromise disclosures (SolarWinds, Kaseya, Codecov).

Disable Unnecessary Features & Services

Disable Windows Script Host, Office macros (via Group Policy), PowerShell in constrained language mode, and unnecessary Windows services (Remote Registry, Telnet, TFTP). Block SMBv1 and NetBIOS over TCP/IP.

Critical Defense - Defense-in-Depth: Backdoors often exploit initial compromise vectors (phishing, unpatched vulnerabilities, supply chain attacks). Prevent the initial infection to stop the backdoor. Implement layered defenses: email filtering + EDR + application allowlisting + network segmentation + least privilege. No single control is sufficient. Regular security audits and penetration testing help identify backdoor vulnerabilities before attackers do.

Backdoor Incident Response (What to do if backdoor discovered)

If a backdoor is discovered on your system or network, follow these incident response steps in order:

Backdoor vs. Other Malware Types

CharacteristicBackdoor (RAT)TrojanRootkitWorm
Primary PurposeRemote access, persistence, C2 communicationDeception, initial compromise, data theftStealth, hiding malicious activitySelf-propagation, network saturation
User Interaction RequiredNo (after installation)Yes (deception required)No (after installation)Minimal/None (autonomous)
Detection DifficultyModerate-High (network/behavioral)Moderate (signature-based)Extremely High (kernel/boot level)Low-Moderate (network traffic)
PersistenceHigh (designed for long-term access)Variable (may not persist)Very High (survives OS reinstall)Low (requires re-infection)
Primary DefenseNetwork monitoring, EDR, application allowlistingUser education, AV, email filteringSecure Boot, memory analysis, HVCIPatch management, network segmentation
ExampleDarkComet, Gh0st RAT, Cobalt Strike, web shellsZeus, Emotet, TrickBotStuxnet, TDSS, UEFI rootkitsConficker, WannaCry, SQL Slammer

Further Backdoor Resources & Information

CISA Backdoor Mitigation Guidance

CISA (Cybersecurity and Infrastructure Security Agency) guidance on detecting, preventing, and responding to backdoor infections including RATs, web shells, reverse shells, and C2 infrastructure. Includes IOCs and response procedures.

MITRE ATT&CK - Backdoor Techniques

MITRE ATT&CK framework tactics and techniques for backdoors: T1105 (Ingress Tool Transfer), T1071 (Application Layer Protocol - C2), T1059 (Command and Scripting Interpreter), T1547 (Boot or Logon Autostart Execution - persistence).

SANS FOR508 (Advanced Incident Response)

Advanced incident response course covering backdoor detection, C2 analysis, memory forensics, and remediation methodologies. Industry standard for forensic investigators.

Web Shell Detection & Analysis

Resources for detecting web shells (shell.php, cmd.aspx, b374k) via file integrity monitoring (FIM), log analysis (web server logs), and network traffic analysis (POST requests to non-standard paths).

YARA Rules for Backdoor Families

Community-maintained YARA detection rules for known backdoor families (DarkComet, Gh0st RAT, Poison Ivy, Quasar, Orcus, Cobalt Strike, web shells). Essential for threat hunting and detection development.

The DFIR Report (Backdoor Case Studies)

Real backdoor incident case studies, TTPs (Tactics, Techniques, Procedures), C2 network traffic analysis, and containment lessons from professional incident responders.

ANY.RUN / Cobalt Strike Beacon Analysis

Interactive malware analysis sandboxes for executing and analyzing backdoor behavior (Cobalt Strike beacon, RATs, web shells) in isolated environments. Essential for detection development.

US DOJ - Backdoor Prosecution Cases

US Department of Justice (DOJ) Computer Crime and Intellectual Property Section (CCIPS) case documents on backdoor prosecutions (BlackShades, DarkComet, Zeus botnet takedowns).

← Back to Knowledge Base