Navigation Menu
For those who use Windows, NTFS is a common knowledge subject. It is a revolutionary file system that supports file security, compression and encryption, among other things. Yet there is a little known "feature" in NTFS that has profound uses (or abuses). It has the ability to almost completely hide data from the user, and possibly some virus scanners and backup utilities. No, I'm not talking about the "Hidden files" attribute, which is easily defeated. In contrast to that attribute, this method is so secretive in nature that unless you were performing computer forensics, you would most likely never notice its existence.
I'm talking about Alternate Data Streams (or ADS). To keep your interest, lets try a simple demonstration.
Windows XP (And Vista):
For those who use Windows, NTFS is a common knowledge subject. It is a revolutionary file system that supports file security, compression and encryption, among other things. Yet there is a little known "feature" in NTFS that has profound uses (or abuses). It has the ability to almost completely hide data from the user, and possibly some virus scanners and backup utilities. No, I'm not talking about the "Hidden files" attribute, which is easily defeated. In contrast to that attribute, this method is so secretive in nature that unless you were performing computer forensics, you would most likely never notice its existence.
I'm talking about Alternate Data Streams (or ADS). To keep your interest, lets try a simple demonstration.
Windows XP (And Vista):
- Start >> Run... (If you don't have Run on your Vista button menu, you can enable it by following this tutorial)
- Type in: notepad "%HOMEPATH%\Desktop\test.txt:ADS"
- When asked if you want to create a new file, click Yes
- In the notepad, type "This is a test of NTFS's Alternate Data Stream feature"
- Save the file, don't change file type or file name information, and then close notepad.
- As you may have guessed, we have now created a file named "test.txt" on your Desktop. Try opening it now. The text is gone!
- Right click the file, and check its properties. The file should have zero file size!
- Double click the test.txt on your desktop again so that you may edit it, and add in some text (This is will be used later)
Now I know what you're thinking, "Tim, all you did was make me lose a line of text, I've lost entire hard drives worth of data. That's nothing special!" Hold on, the text isn't lost. Let me explain a little more about what ADS is, and how it works.
For quite some time, Apple's HFS and several other file systems, such as ZFS, have supported what is known as a filesystem fork. A filesystem fork was (and still is) generally used to store metadata about the files they were attached to. In NTFS, ADS is used much the same way, with some rather interesting effects.
For example. Lets say you download an executable file from a website in Internet Explorer. If you're running Windows XP SP2, Internet Explorer will add zone information data into an alternate stream of the executable. This results in Windows being able to mysteriously identify which executables have been downloaded from the internet, as opposed to plopped onto the hard drive from a CD or other media. In short, if you've ever seen this:
For quite some time, Apple's HFS and several other file systems, such as ZFS, have supported what is known as a filesystem fork. A filesystem fork was (and still is) generally used to store metadata about the files they were attached to. In NTFS, ADS is used much the same way, with some rather interesting effects.
For example. Lets say you download an executable file from a website in Internet Explorer. If you're running Windows XP SP2, Internet Explorer will add zone information data into an alternate stream of the executable. This results in Windows being able to mysteriously identify which executables have been downloaded from the internet, as opposed to plopped onto the hard drive from a CD or other media. In short, if you've ever seen this:

Then you've experienced a use of ADS. Windows XP and Vista both use Zone Information stored in alternate data streams to determine if the executable was downloaded from a "Trusted Site" or publisher, and if it can't verify the source as trusted, it pops up this message. Also, you'll see an option to "Unblock" this executable if you bring up the file's properties, along with an explanation stating that the file is from an outside source. Clicking Unblock will delete the zone data in the alternate stream of the file, preventing the warning seen above.

So how do you access an ADS? Lets go back to that test file again.
Windows XP (And Vista):
- Start >> Run...
- The previously run command should be in the box already. If not, type notepad "%HOMEPATH%\Desktop\test.txt:ADS"
- If done correctly, this'll open up the test.txt:ADS file, and prove that the line of text we typed earlier still exists!
So how is the ADS attached to the main file? Well, according to Microsoft (in this article), whenever a file is created, a default unnamed stream is made to store all the data being entered into a file while it is open. Besides this default unnamed stream, additional alternate ones can be created (ADS). Each stream ends with an End of File (EOF) marker, after which the next stream begins.
While it may be apparent that this is a security issue in itself, even more devious is the fact that ADS can be used to store executables in an alternate data stream of, for example, a text file. Doing this from command line (really the only way) would look something like:
C:\> type test.exe > test.txt:secret.exe
Followed by this command to run it:
C:\> start .\test.txt:secret.exe
This could easily be used to hide all kinds of nasty malware on a machine. For the most part though, the risk is relatively low, so long as you can trust those who use your machine (or machines). Since ADS is an NTFS ability (And not likely to be transferable even between other filesystems that support ADS), an ADS will be lost in transfer to another remote location, unless the software making the transfer is aware of ADS data. Additionally, if you're concerned that ADS may be a problem on your computer, SysInternals has a very useful program called Streams that can be used to find alternate data streams. Alternatively, Windows Vista has an updated dir command that can show the presence of an ADS file, by specifying the /R switch.