SMB Zone Identifier

I have a question regarding SMB. Every file I upload will be duplicaded like this. What is it for?


file.txt
file.txt:Zone.Identifier

Do you use Windows? I have not seen such files. What is inside the file? Just a copy of the original?

Yes, I use Windows 7. I’m quite sure it was not like this in previous version of RouterOS.

Router: CRS125-24G-1S-2HnD-IN
RouterOS: 6.7

This is the content of the file.

[ZoneTransfer]
ZoneId=3

I found the answer to this issue, the text after the colon is an identifier for an “Alternate Data Stream”. A file with a “Zone.Identifier” extension is an alternate data stream (ADS) file that contains information about another file. It describes the security zone associated with the file, which may the Internet, local intranet, trusted site, or restricted site.

Zone.Identifier Stream Name

Exploring Alternate Data Streams


I found a way to get rid of the Zone.Identifier for files downloaded from the Internet. Download the SysInternals streams tool and unzip the executable file. Use the first batch file to list alternate data stream files. Use the second batch file to remove alternate data stream files.


SysInternals streams tool

Usage:
batchfile.bat filename
batchfile.bat List Zone.Identifier
@echo off
if !%1!==!! goto :end
:: use caret before pipe to hide the pipe from the outermost command in the batch file
for /f “usebackq tokens=1” %%d in (streams.exe %1 ^| find "Zone.Identifier:$DATA") do (
goto :list
)
goto :end
:list
streams.exe %1 | find “:”
:end
Delete Zone.Identifier*
@echo off
if !%1!==!! goto :end
:: use caret before pipe to hide the pipe from the outermost command in the batch file
for /f “usebackq tokens=1” %%d in (streams.exe %1 ^| find "Zone.Identifier:$DATA") do (
goto :kill
)
goto :end
:kill
streams -d %1
:end