Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


March 2001

NTFS Alternate Data Streams


RSS
Subscribe to Windows IT Pro | See More Security Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

See for Yourself
To witness the vulnerability of alternate streams, you can conduct a simple experiment that tries the five known methods by which viruses can be activated from alternate streams. All you need is a Win2K Professional system with NTFS installed.

The three file formats that malicious users most commonly use for computer viruses are .exe, .vbs, and .cmd. For this experiment, select or create on your system a file of each format. In our testing, we used the Calculator program (i.e., calc.exe) and wrote two programs, which we named test.vbs and test.cmd. To create test.vbs, we used the instruction

MsgBox "Hello World! (this is VBS file)"

To create test.cmd, we used the instruction

@Echo Hello World! (this is CMD file)
@Pause

If you don't include the @Pause statement in test.cmd, Win2K will immediately close the command-prompt window.

Next, choose one more .exe file that you'll use as a dummy file, and be sure to back up the file before you begin. We used the Notepad program (i.e., notepad.exe), from the Windows system directory, as the dummy file.

Now, use the following instructions to copy your three programs to an alternate stream in the dummy file:

type calc.exe > notepad.exe:calc.exe
type test.vbs > notepad.exe:test.vbs
type test.cmd > notepad.exe:test.cmd

Your dummy file, notepad.exe, now contains three alternate data streams: calc.exe, test.vbs, and test.cmd. Follow the instructions below to use the five known methods to run these alternate streams.

  1. Select Start, Run, and type this instruction for each stream (include no spaces in the command):
  2. file:\\%windir%\notepad.exe:
    <stream name>

    For example,

    file:\\%windir%\notepad.exe:test.vbs
    file:\\%windir%\notepad.exe:calc.exe
    file:\\%windir%\notepad.exe:test.cmd

    Win2K should launch the .vbs and .exe programs in the alternate data stream with no trouble. Figures 2 and 3 show the results of running the test.vbs and calc.exe programs, respectively. The .cmd program should fail to run.

  3. At the command line, type this instruction for your .vbs stream:
  4. wscript notepad.exe:<stream name>

    For example,

    wscript notepad.exe:test.vbs

    In our test, this command opened the same dialog box that Figure 2 shows.

  5. Create three shortcuts on your Windows desktop, and link each of them to the corresponding stream in the dummy file. As we expected, our test displayed the test.vbs and calc.exe windows and test.cmd failed to start. This scenario proves that .exe and .vbs programs can reach alternate streams through shortcuts. Interestingly, the Notepad shortcuts' icons changed to icons that represent the programs in the alternate streams, as Figure 4, page 48, shows.


  6. In the Windows Startup folder, instruct Win2K to run the programs that reside in the alternate data streams. Then, reboot the computer or log on again. In our test, the test.vbs and calc.exe windows automatically appeared at startup. The test.cmd file failed to run.


  7. Modify the registry subkey that controls auto-run programs, as follows: HKEY_ LOCAL_MACHINE\SOFTWARE\Microsoft\ Windows\CurrentVersion\RunTest=%WIN DIR%\notepad.exe:stream name. For example, HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows\CurrentVersion\Run, followed by


    • test1=%WINDIR%\notepad.exe:test .vbs
    • test2=%WINDIR%\notepad.exe:calc .exe
    • test3=%WINDIR%\notepad.exe:test .cmd
   Previous  1  [2]  3  Next 


Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Windows 7 Sets Sales Record

Microsoft CEO Steve Ballmer described Windows 7's first ten days of sales as "fantastic" while in Japan yesterday. ...


Security Whitepapers Reducing the Costs and Risks of Branch Office Data Protection

Solving Desktop Management Challenges in Healthcare

Solving Desktop Management Challenges in Education

Related Events Disk-to-Disk Grows Up

WinConnections and Microsoft® Exchange Connections

Check out our list of Free Email Newsletters!

Security eBooks Spam Fighting and Email Security for the 21st Century

Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

Related Security Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement