
π Introduction
Alternate Data Streams (ADS) are hidden components attached to regular filesβsuch as documents, executables, and system filesβon NTFS drives. In this guide, youβll learn:
- β What ADS are
- β How both legitimate applications and malware use them
- β How to detect and remove malicious ADS safely
To enhance your malware detection skills, consider reviewing Learning HijackThis!.
π§ A Brief History of ADS
Since their introduction in Windows NT with the NTFS file system, ADS have served a purpose. They were originally designed to maintain compatibility with Appleβs Hierarchical File System (HFS).
π Legitimate Uses:
- Applications store metadata such as indexing details and access permissions in ADS.
- Document properties, visible under the βDetailsβ tab, are stored in ADS.
- Antivirus programs might use ADS to log scanning details.
While these uses are valid, attackers frequently exploit ADS for concealment.
π§° How Software Uses ADS
Legitimate programs commonly utilize ADS to store metadata invisibly. For example, if you create a text file and view its properties, you’ll see summary information stored through an ADS.
β Example: Creating ADS via Command Prompt
c:\file.exe > C:\WINDOWS\system32\calc.exe:file.exe
Code language: CSS (css)
Here, file.exe
becomes a hidden stream inside calc.exe
. However, the host fileβs appearance and behavior remain unchanged.
β οΈ Why ADS Can Be Dangerous
Despite their usefulness, ADS present a security risk when misused.
π© Exploitation by Malware:
- ADS are invisible in standard Explorer views and directory listings.
- Malicious streams can be launched via PowerShell, VBScript, or command line.
- Traditional antivirus and Task Manager may fail to detect them.
π¨ Common Risks:
- Trojans, ransomware, or spyware can hide in ADS.
- Rootkits often use ADS to maintain stealth.
- These streams do not alter file size or timestamp, making them hard to detect manually.
β Can ADS Be Disabled?
Unfortunately, ADS cannot be disabled in NTFS. Nevertheless, you can scan and remove them using specialized utilities.
π How to Detect and Remove ADS Infections
Manual removal can be risky and may break applications. Instead, itβs better to rely on trusted tools. Keep in mind: deleting a host file will also delete its ADS.
π§° Trusted Tools for Detection and Removal:
Each of these tools is designed to uncover and eliminate malicious ADS.
π§½ Removing ADS with FRST
π§Ύ Example from an FRST Log:
AlternateDataStreams: C:\Windows\System32\legitfile:malware.exe [134]
AlternateDataStreams: C:\malware:malware.exe [134]
Code language: CSS (css)
π Removal Process:
- Download and run FRST.
- In the same directory, create a file named
fixlist.txt
with this content:
Start::
AlternateDataStreams: C:\Windows\System32\legitfile:malware.exe [134]
AlternateDataStreams: C:\malware:malware.exe [134]
C:\malware
Stop::
Code language: CSS (css)
- Click Fix in the FRST interface.
- Reboot your system once cleanup is complete.
π§½ Removing ADS with OTL (OldTimer’s List It)
π§Ύ Example from an OTL Log:
@Alternate Data Stream - 48 bytes -> C:\WINDOWS:5E0D2877D3BDDE45
Code language: CSS (css)
π Removal Steps:
- Launch
OTL.exe
. - Under Custom Scans/Fixes, paste the following:
:Files
@C:\WINDOWS:5E0D2877D3BDDE45
:Commands
[purity]
[emptytemp]
[start explorer]
[Reboot]
- Click Run Fix.
- Allow your system to reboot.
π§½ Removing ADS with ComboFix
ComboFix detects and removes ADS automatically during its standard scan. However, you can also specify entries manually.
π§Ύ Example Log Entry:
c:\windows\system32\OLD4.tmp:ext.exe 32768 bytes executable
Code language: CSS (css)
π Manual Removal:
- Open Notepad.
- Enter the following:
ADS::
c:\windows\system32\OLD4.tmp
Code language: CSS (css)
- Save it as
CFScript.txt
. - Drag this script onto
ComboFix.exe
. - Let ComboFix complete the removal process.
π§½ Removing ADS with HijackThis (ADS Spy)
HijackThis includes a utility called ADS Spy, designed to detect and delete hidden ADS entries. It is an effective method of removing ADS infections.
π Removal Instructions:
- Open HijackThis.
- Click Config β Misc Tools β ADS Spy.
- Press Scan to find hidden streams.
- Review the results carefully.
- Select unwanted entries and click Remove Selected.
π‘ Need a refresher on HijackThis? See Learning HijackThis!.
β Conclusion
Alternate Data Streams (ADS) are integral to NTFS but present risks when exploited. Although you canβt disable ADS, using trusted tools allows you to remove threats effectively.
β Employ tools like FRST, OTL, ComboFix, and HijackThis to detect and clean up ADS infections.
π Regular system scans can reveal hidden threats your antivirus might overlook.
π For expanded malware analysis techniques, visit Learning HijackThis! and explore our Malware & Virus Analysis Resources hub.