In linux every user can create symlinks, but in Windows I need an admin command line, or mklink fails. Why is that?
By default, only administrators can create symbolic links, because they are the only ones who have the
SeCreateSymbolicLinkPrivilege privilege found under
Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\ granted.
From Microsoft TechNet: Security Policy Settings New for Windows Vista:
Symbolic links (symlinks) can expose security vulnerabilities in applications that aren't designed to handle symbolic links.
Linux has a compartmentalised file/user structure. What that means is "program A" cannot do "task B" unless it's related to "disk space C". So symlinks don't really affect anything logistically in terms of risk penetration because the entire OS is predicated on the assumption of action->permission.
Or to put it another way, making a gazillion symlinks doesn't help you if you're a hacker with nothing but low-level permissions. So, on Linux or MacOS it doesn't help you.
However, on Windows you don't have a "program A" that runs a program other than the person logged in... so the person logged in can do "task B" to wherever they like. So it DEFINITELY helps you to have penetration to the level of symlinks because you can override commonly found real files with viral payload, and hide that you did it.
So, without the
symlink protection level, a virus could infect you, run as its payload a lot of symlinks to, say, redirect "
explorer.exe" to a fake "
Why would you do that? Quite honestly it's the keys to the kingdom. You could recruit that computer reliably into a bot theoretically activating its way into the future etc. There are a million ways why this is better than just "having an infection" because most people remove them when they see them, and this could be hidden.
It is not the case anymore as of Windows 10 Insiders build 14972 (windows 10 creators update).
However, from the comments below the blog post, concerns about the issues mentioned in the other answers are still there, and to make use of this new behaviour, you need to:
- enable developer mode on your machine
- pass a
SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATEflag to the