2

When I download software on Windows they get a security flag that I can see by right-clicking it and selecting Properties. On the General tab there is a section that says "Security: This file came from another computer and might be blocked to help protect this computer.", with a checkbox for unblocking it.

I am a software developer and I want to do some testing with this.

Once I unblock a file the checkbox goes away. How can I manually re-block it?

sourcenouveau
  • 3,566
  • 3
  • 31
  • 37
  • 1
    https://superuser.com/questions/1342990/how-can-i-make-windows-think-a-file-came-from-another-computer/1343001#1343001 – HelpingHand Aug 20 '20 at 09:17
  • Ah, dang. My Q&A is a duplicate of that. Too bad it didn't come up before/while I was writing up mine! – sourcenouveau Aug 20 '20 at 15:25
  • Does this answer your question? [How can I make Windows think a file "came from another computer"?](https://superuser.com/questions/1342990/how-can-i-make-windows-think-a-file-came-from-another-computer) – music2myear Aug 22 '20 at 17:01
  • Yes. That's the same question that @HelpingHand posted. I have already marked my question as a duplicate. – sourcenouveau Aug 22 '20 at 23:40

1 Answers1

4

Files are marked as "from another computer" using NTFS Alternate Data Streams, as James so graciously explained in another question. I also found a nice guide called Introduction to Alternate Data Streams.

You can run commands to read and write ADS data from the Command Prompt:

MORE < "myapp.exe:Zone.Identifier"

(
ECHO [ZoneTransfer]
ECHO ZoneId=4
)>myapp.exe:Zone.Identifier

And from Powershell:

Get-Content -Path .\myapp.exe -Stream Zone.Identifier

Set-Content -Path .\myapp.exe -Stream Zone.Identifier -Value "[ZoneTransfer]`nZoneId=4"

Some browsers also store other metadata there, such as the Referer and Host URLs of a download.

You can read more about zones at About URL Security Zones. The default ones are:

Value    Setting
------------------------------
0        My Computer
1        Local Intranet Zone
2        Trusted sites Zone
3        Internet Zone
4        Restricted Sites Zone

You can read about other known ADS names at Known Alternate Stream Names.

sourcenouveau
  • 3,566
  • 3
  • 31
  • 37
  • 1
    It should be noted that Alternate Data Streams can only be created on NTFS file systems; FAT file systems do not have the provisions to support them. – Jeff Zeitlin Feb 23 '23 at 12:13