09.02.2014 Views

Windows sysinternals

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11 File Utilities 327<br />

The type and more commands do not accept stream syntax, but Cmd.exe and its redirection<br />

operators do.<br />

The most apparent use of alternate data streams by <strong>Windows</strong> is with downloaded files.<br />

<strong>Windows</strong>’ Attachment Execution Service adds a Zone.Identifier stream that specifies the<br />

security zone from which a file was downloaded so that <strong>Windows</strong> can continue to treat the<br />

file as from that zone. One way to remove that indicator from a file is to open its Properties<br />

dialog box in Explorer and click the Unblock button. However, that button and other user<br />

interfaces to remove security zone information are often hidden from users by Group Policy.<br />

Sysinternals Streams examines files and directories you specify and reports the names and<br />

sizes of any alternate streams it encounters. You can search directory structures and list<br />

all the files and directories with ADSes. Optionally, you can also delete those streams—for<br />

example, to unblock downloaded content. Its command-line syntax is<br />

streams [-s] [-d] file_or_directory<br />

The file_or_directory parameter is mandatory and accepts wildcards. For example, the<br />

command streams *.exe examines all file system objects ending in “.exe” in the current<br />

directory and lists those that have ADSes with output like the following:<br />

C:\Users\Abby\Downloads\msvbvm50.exe:<br />

:Zone.Identifier:$DATA 26<br />

In this example, the file msvbvm50.exe has a 26-byte ADS called “Zone.Identifier”. You<br />

can see that stream’s content by running more < msvbvm50.exe:Zone.Identifier at a<br />

command prompt.<br />

The –s option examines directories recursively, and the –d option deletes ADSes that it finds.<br />

For example, the command<br />

streams -s -d C:\Users\Abby\Downloads<br />

searches in and under Abby’s Downloads folder, reporting on and deleting any ADSes it<br />

finds. Streams reports the names of alternate streams that it deletes.<br />

Figure 11-2 shows Streams identifying the Zone.Identifier ADS on a downloaded<br />

SysinternalsSuite.zip, and then deleting that stream. Deleting the Zone.Identifier stream<br />

before extracting the utilities allows them to run without security warnings and allows the<br />

Compiled HTML (.chm) files to display help content.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!