01Linux CLI Fundamentals

TryHackMe AoC 2026 · Day 4 Writeup

TryHackMe AoC 2026 Day 4 Room Icon
04 /home Alone

/home Alone.

Discover the secret of Christmas past by learning the basics of the Linux CLI.

Task 1–2 · Linux Filesystem · System Health · Apache & Bash · Flag Captured

ECTO1-WEB · Linux CLI Triage Workflow

AoC 2026 · Day 4

Audit Order · Forgotten Server Checklist

01 · Orient

User & Host

Confirm identity, location, and uptime with pwd, ls, whoami, hostname, and uptime -p.

02 · Health

System & Services

Check OS, memory, disk, and active daemons using lsb_release -a, free -h, df -h, and systemctl status.

03 · Inspect

Web Root & Scripts

Move into /var/www/ecto1 with cd and read call-ecto1.sh using cat, pipes |, and less.

02Task 1 · Introduction

Wareville Data Centre

A forgotten machine in the corner.

ScenarioSOC Inventory

Walking the Data Centre

With Wareville deserted, McSkidy is cataloguing every plugged-in device into her SOC inventory. Tucked in the back corner sits an old, dusty test machine that hasn't been touched in over a year—yet her legacy SSH credentials still work.

Target AccessSSH Over VPN / Split-Screen

Connecting to ECTO1-WEB

Connect via the TryHackMe split-screen terminal or over VPN using SSH: ssh mcskidy@MACHINE_IP with username mcskidy and password gh05t3d@out.

03Task 2 · Old Ghosts

Step-by-Step Enumeration

Tracing ECTO1-WEB from home to web root.

Step 01pwd · ls · whoami · hostname

Orienting in the Shell

Running pwd confirms we are in /home/mcskidy, and ls reveals a single file: notes.txt. Checking whoami returns mcskidy, hostname prints ECTO1-WEB, and uptime -p shows the server has been running unattended for 397 days.

Step 02cat notes.txt

Reading the Old Note

Using cat notes.txt prints McSkidy's 2025 development log: she had started building a regex-based chatbot project named ECTO1, left it running before the holidays with a reminder to add guardrails, and forgot about it after last year's incident.

Step 03lsb_release · free · df · systemctl

Quick System Health Check

lsb_release -a identifies Ubuntu 24.04.4 LTS (noble). free -h shows 435Mi RAM (no swap), df -h flags /dev/root at 88% full, and systemctl status apache2 confirms the Apache HTTP Server has been active (running) since boot.

Step 04cd /var/www/ecto1 · call-ecto1.sh

Uncovering the Script Secret

Moving to /var/www/ecto1 with cd lists call-ecto1.sh, index.html, and quotes.txt. Inspecting call-ecto1.sh (via cat call-ecto1.sh | less or grep) reveals the hardcoded flag trigger: THM{m3rry_chr1stm4s_mcsk1dy}.

Terminal · /var/www/ecto1/call-ecto1.sh
mcskidy@ECTO1-WEB:~$ grep -iE "thm|secret|flag|pass|key" /var/www/ecto1/call-ecto1.sh
    # Prio 1. Flag trigger
    if [[ "$input_lc" =~ (secret|code|password|christmas|xmas|santa|holiday|winter) ]]; then
        echo "Glad you asked, I have something for you: THM{m3rry_chr1stm4s_mcsk1dy}"

04Linux CLI Cheat Sheet

11 Essential Commands

Commands used on ECTO1-WEB.

Command Purpose Example Used
pwd Print working directory — shows your current path in the filesystem. pwd → /home/mcskidy
ls List directory contents (-l for details, -a for hidden files). ls → notes.txt
whoami / hostname Display the current logged-in user and the machine's network name. mcskidy / ECTO1-WEB
uptime -p Show how long the system has been running in plain English. up 397 days, 16 hours, 51 minutes
cat / less Print a file directly to stdout (cat) or page through long output (less). cat call-ecto1.sh | less
lsb_release -a Print Linux distribution release and codename details. Ubuntu 24.04.4 LTS (noble)
free -h / df -h Check RAM and disk usage in human-readable units (MB/GB). /dev/root 88% used
systemctl status Inspect overall systemd state or a specific service like apache2. systemctl status apache2
cd Change directory to navigate the filesystem. cd /var/www/ecto1
| (Pipe) Send the stdout of one command directly as the stdin of the next. cat call-ecto1.sh | less

05Answers & Flag

Verified · Day 4 Complete

Room Complete · Task 1 & 2 Solved

Secret of Christmas past.

By orienting with basic Linux CLI commands, auditing system health and Apache services, and reading the forgotten call-ecto1.sh script, McSkidy recovered her old holiday flag.

  • Filesystem Navigation
  • Service Audit
  • Flag Captured

Recovered Flag · Task 2

THM{m3rry_chr1stm4s_mcsk1dy}

Task 2 · Question 01

What is the secret revealed in the script file?

THM{m3rry_chr1stm4s_mcsk1dy}