Startup Folders and Shell Extensions
What you'll learn: How attackers abuse Windows startup directories and shell integration points to achieve persistent, automatic execution of malware.
Understanding Startup Folders
Windows provides special startup folders where any executable, script, or shortcut placed inside will automatically run when a user logs in. Think of these like the "VIP guest list" at a nightclub—anything on the list gets automatic entry.
Common startup folder locations:
- Per-user:
C:\Users\[Username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup - All users:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
Attackers drop malicious executables or scripts here to ensure their malware runs every time the system boots or a user logs in. This technique is simple, effective, and requires minimal sophistication.
Shell Extensions: Deeper Integration
Shell extensions are more insidious—they're DLLs that extend Windows Explorer's functionality (context menus, property sheets, icon handlers). When you right-click a file and see custom options, that's a shell extension at work.
Malware registers malicious DLLs as shell extensions through registry keys like:
HKLM\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\ApprovedHKCR\*\shellex\ContextMenuHandlers
Every time Explorer loads (which is constantly), these DLLs execute. It's like hiding malicious code inside the very walls of the building—it activates whenever someone opens a door.
Browser Helper Objects (BHOs) are a related concept: add-ons that load with Internet Explorer, registered under:
HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects
Malware uses BHOs to monitor browsing, inject ads, or steal credentials—all while appearing as legitimate browser functionality.
Detection and Mitigation
Monitor startup folders and shell extension registry keys regularly. Tools like Autoruns (from Sysinternals) enumerate all auto-start locations, making suspicious entries visible.
Key Takeaway: Startup folders and shell extensions provide attackers with reliable, automatic execution by leveraging legitimate Windows features—defenders must audit these locations consistently to detect unauthorized persistence mechanisms.