T1080: Taint Shared Content
Adversaries may deliver payloads to remote systems by adding content to shared storage locations, such as network drives or internal code repositories. Content stored on network drives or in other shared locations may be tainted by adding malicious programs, scripts, or exploit code to otherwise valid files. Once a user opens the shared tainted content, the malicious portion can be executed to run adversary's code on a remote system. Adversaries may use tainted shared content to move laterally.
A directory share pivot is a variation on this technique that uses several other techniques to propagate malware when users access a shared network directory. It uses Shortcut Modification of directory .LNK files that use Masquerading to look like real directories, which are hidden through Hidden Files and Directories. The malicious .LNK-based directories have embedded command that executes the hidden malware file in the directory and the opens the real intended directory so that the user's expected action still occurs. When used with frequently used network directories, the technique may result in frequent reinfections and broad access to systems and potentially to new and higher privileged accounts.
Adversaries may also compromise shared network directories through binary infections by appending or prepending its code to the healthy binary on the shared network directory. The malware may modify the original entry point (OEP) of the healthy binary to ensure that it is executed before the legitimate code. The infection could continue to spread via the newly infected file when it is executed by a remote system. These infections may target both binary and non-binary formats that end with extensions including, but not limited to, .EXE, .DLL, .SCR, .BAT, and/or .VBS.
A way to demonstrate this technique is commonly by tainting a Shared Folder it's very common for domain users to have access to a folder where everyone has access to it, and modify as they need to update files. Now it sounds like a great workflow but it has a security issue.
Everyone can ADD or MODIFY anything
For example we have our Legitimate Login Portal Shortcut for everyone to access their email on our Temp Share available from the Desktop-Alpha. But here we have changed the properties to have it point to our payload in this case hosted on an SMBSERVER from our attacking machine and use rundll32 to execute.
Now with execution we receive a shell on our attacking machine
Above we see our shell getting executed and receiving a connection from the new machine since we were previously located on Desktop-Alpha