Community discussions

MikroTik App
 
Borage
Member Candidate
Member Candidate
Topic Author
Posts: 170
Joined: Sun Sep 26, 2004 10:19 pm

SMB Zone Identifier

Mon Dec 09, 2013 4:15 pm

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
Last edited by Borage on Mon Dec 09, 2013 4:31 pm, edited 1 time in total.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24608
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: SMB Zone identifier

Mon Dec 09, 2013 4:16 pm

Do you use Windows? I have not seen such files. What is inside the file? Just a copy of the original?
No answer to your question? How to write posts
 
Borage
Member Candidate
Member Candidate
Topic Author
Posts: 170
Joined: Sun Sep 26, 2004 10:19 pm

Re: SMB Zone Identifier

Mon Dec 09, 2013 4:19 pm

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
 
Borage
Member Candidate
Member Candidate
Topic Author
Posts: 170
Joined: Sun Sep 26, 2004 10:19 pm

Re: SMB Zone Identifier

Tue Dec 10, 2013 2:24 am

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:

shell code

batchfile.bat filename
batchfile.bat *
List Zone.Identifier

batch code

@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

batch code

@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

Who is online

Users browsing this forum: Google [Bot] and 18 guests