Common Targets and Patterns of Malicious Software: Files, Registry Keys, and System Settings
Malicious software often targets specific files, registry keys, and system settings to achieve its objectives, such as persistence, data theft, or system disruption. Here are some common patterns and similarities found in most malware:
- Files Typically Targeted by Malware
- Common Registry Keys Targeted by Malware
- Common Techniques and Patterns
- Examples of Targeted Locations
Files Typically Targeted by Malware
System Files:
- Executable Files (EXE, DLL): Malicious software often injects code into legitimate executable files or replaces them to ensure they run at startup.
- System Configuration Files: Files such as
win.ini
,system.ini
, andboot.ini
on Windows systems can be modified to load malicious code.
User Data Files:
- Documents and Spreadsheets: Files like
.docx
,.xlsx
,.pdf
are often targeted for data theft or encryption (ransomware). - Database Files: Files related to database management systems, such as
.mdb
for Microsoft Access, are also targeted for sensitive data.
- Documents and Spreadsheets: Files like
Temporary and Cache Files:
- Temp Files: Malware often uses temporary folders (
C:\Windows\Temp
,C:\Users\[Username]\AppData\Local\Temp
) to store its payloads or logs. - Cache Files: Browser cache files and cookies are targeted for stealing session data and credentials.
- Temp Files: Malware often uses temporary folders (
Startup Files:
- Autostart Locations: Files in autostart directories (
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
) are modified or created to ensure malware runs at startup.
- Autostart Locations: Files in autostart directories (
Common Registry Keys Targeted by Malware
Run Keys:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
- These keys are commonly used to ensure malware runs every time the system starts.
Service Keys:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
- Malware may create or modify services to run malicious code as a service, ensuring it has higher privileges and persistence.
Explorer Keys:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
- These keys can be modified to change the behavior of Windows Explorer or to hide malicious files.
Browser Helper Objects (BHOs):
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects
- Malware may add BHOs to intercept and manipulate web traffic.
Shell Extensions:
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers
- Malware can add entries here to execute code when certain actions are performed on files, like right-clicking.
Startup Applications:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
- Malware may modify the
Userinit
orShell
values to execute its code during user logon.
Common Techniques and Patterns
Persistence Mechanisms:
- Run/RunOnce Keys: Ensure malware starts on boot.
- Scheduled Tasks: Use of
schtasks
to create scheduled tasks that execute malware at specific times or system events.
Code Injection:
- DLL Injection: Injecting malicious DLLs into legitimate processes.
- Process Hollowing: Hollowing out the memory of a legitimate process to run malicious code.
Obfuscation and Encryption:
- File Encryption: Ransomware encrypts user files and demands ransom for decryption.
- Obfuscated Code: Malware often obfuscates its code to avoid detection by antivirus software.
Credential Theft:
- Keylogging: Malware installs keyloggers to capture keystrokes.
- Credential Dumping: Accessing password hashes from files like
SAM
(Security Account Manager) or tools likeMimikatz
.
Network Communication:
- Backdoors: Installing backdoors to maintain remote access.
- Command and Control (C2): Malware communicates with a remote server for instructions, data exfiltration, or updates.
Examples of Targeted Locations
Registry Autorun Locations:
- Malware frequently adds entries to
Run
andRunOnce
keys.
- Malware frequently adds entries to
Startup Folder:
- Placing shortcuts or executable files in the
Startup
folder to ensure execution at system startup.
- Placing shortcuts or executable files in the
Common Directories:
%SystemRoot%\System32
%SystemRoot%\SysWOW64
%AppData%
%LocalAppData%
%Temp%
By understanding these common patterns and similarities, you can better anticipate and identify malicious behavior during dynamic analysis. Always keep your analysis environment isolated and up-to-date with the latest security tools and practices.
Comments
Post a Comment
Share your thoughts...