USD ($)
$
United States Dollar
Euro Member Countries
India Rupee
د.إ
United Arab Emirates dirham
ر.س
Saudi Arabia Riyal

Persistence Techniques (Registry, Scheduled Tasks, SSH Keys)

Lesson 13/44 | Study Time: 20 Min

Persistence techniques are vital strategies employed by attackers to maintain ongoing access to compromised systems, even after reboots, password changes, or other remediation efforts.

These methods ensure malware or backdoors automatically re-execute or maintain control mechanisms over time, securing continuous presence within the target environment.

Common persistence vectors include modifying Windows registry entries, scheduling tasks to run malicious payloads, and abusing SSH keys for stealthy remote access. 

Registry-Based Persistence (Windows)

The Windows registry is a prime target for persistence due to its central role in system configuration and application startup control.


1. AutoStart Extension Points (ASEPs): Attackers create or modify registry keys such as:

HKCU\Software\Microsoft\Windows\CurrentVersion\Run

HKLM\Software\Microsoft\Windows\CurrentVersion\Run


These keys point to executables or scripts launched automatically on user login or system startup.


2. Services and Drivers: Persistence can also be established by installing malicious services registered in registry paths like:

HKLM\SYSTEM\CurrentControlSet\Services

Malicious drivers loaded early during boot enhance stealth and control.


3. Scheduled Tasks via Registry: Scheduled tasks information is stored and can be manipulated via registry keys such as:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree

Tasks set to run periodically or at system events can silently re-launch malware.


4. UserInit and Winlogon Hijacking: Modifying keys like HKLM\Software\Microsoft\Windows

NT\CurrentVersion\Winlogon\Userinit allows attackers to launch payloads during the Windows login process.


5. DLL Injection and Hijacking via Registry: Registry keys influencing DLL load orders (KnownDLLs, AppInit_DLLs) can be manipulated to inject malicious DLLs into legitimate processes.

Scheduled Tasks for Persistence

Scheduled tasks are system features that enable automated execution of programs or scripts based on triggers such as time schedules or system events.

SSH Key Abuse for Persistence (Linux & Unix)

SSH keys provide passwordless authentication, ideal for automation and remote management—but also abused for persistent, stealthy access.


1. Installation of Unauthorized SSH Keys: Attackers add their public keys to victim's ~/.ssh/authorized_keys to gain ongoing access without needing credentials.

2. Key Forwarding and Agent Abuse: Attackers leverage SSH agent forwarding to move laterally, using hijacked keys without leaving footprints.

3. Compromised Private Keys: Stolen private keys enable attackers to impersonate legitimate users, bypassing password controls.

4. Mitigation: Regularly audit authorized keys, disable unused accounts, restrict SSH access by IP or with multi-factor authentication.

Jake Carter

Jake Carter

Product Designer
Profile

Class Sessions

1- Deep Passive Reconnaissance 2- Active Reconnaissance Techniques 3- Traffic Analysis & Packet Crafting Fundamentals 4- Identifying Attack Surface Expansion Paths 5- Advanced Network Mapping & Host Discovery 6- Bypassing Firewalls & IDS/IPS 7- Man-in-the-Middle Attacks (ARP Spoofing, DNS Manipulation) 8- VLAN Hopping, Port Security Weaknesses, and Network Segmentation Testing 9- Windows & Linux Privilege Escalation: Advanced Enumeration & Kernel-Level Attack Paths 10- Exploiting Misconfigurations & File/Service Permission Abuse 11- Bypassing UAC, sudo, and Restricted Shells 12- Credential Dumping & Token/Key Abuse 13- Persistence Techniques (Registry, Scheduled Tasks, SSH Keys) 14- Tunneling & Port Forwarding (SOCKS Proxy, SSH Tunnels, Chisel Basics) 15- Pivoting in Multi-Layered Networks 16- Data Exfiltration Concepts & OPSEC Considerations 17- Server-Side Attacks (Advanced SQL Injection, Template Injection, Server-Side Template Injection - SSTI) 18- Authentication & Authorization Attacks (JWT Abuse, Session Misconfigurations) 19- SSRF, XXE, Deserialization & Logic Flaw Identification 20- Advanced API Security Testing (Token Handling, Rate-Limiting Bypass Concepts) 21- Wi-Fi Security Attacks (WPA3 Considerations, Enterprise Networks) 22- Rogue APs & Evil Twin Concepts 23- Mobile App Security Overview (Android & iOS Attack Surface, Static/Dynamic Testing) 24- IoT Device Weaknesses (Firmware Analysis Basics, Insecure Protocols, Hardcoded Credentials) 25- Cloud Service Models & Shared Responsibility (AWS, Azure, GCP basics) 26- Cloud Misconfigurations (IAM, Storage Buckets, Exposed Services) 27- Container & Kubernetes Security (Namespaces, Privilege Escalations, Misconfigurations) 28- Virtualization Weaknesses & Hypervisor Attack Concepts 29- Malware Behavior Analysis (Dynamic vs Static) 30- Exploit Development Concepts (Buffer Overflow Fundamentals, Shellcode Basics) 31- Reverse Engineering Essentials (Strings, Disassembly, Logic Flow Understanding) 32- Detection & Evasion Techniques (Sandbox Evasion Concepts) 33- Automating Recon & Scans (Python/Bash/PowerShell Basics) 34- Writing Custom Enumeration Scripts 35- Tool Customization (Modifying Payloads, Extending Existing Tools Ethically) 36- Data Parsing, Reporting & Workflow Automation 37- Threat Intelligence Integration & TTP Mapping 38- Attack Path Mapping (MITRE ATT&CK Alignment) 39- Social Engineering Campaign Planning (Ethical Boundaries & Simulations) 40- Blue Team Evasion Concepts (OPSEC, Log Evasion Principles) 41- Structuring Professional Penetration Test Reports 42- Mapping Findings to Risk Ratings (CVSS, Impact Assessment) 43- Presenting Findings to Executives and Technical Teams 44- Prioritizing Remediation and Security Hardening Guidance

Sales Campaign

Sales Campaign

We have a sales campaign on our promoted courses and products. You can purchase 1 products at a discounted price up to 15% discount.