← Back to list

ALX Terminator lab Walkthrough

As part of the ALX Cybersecurity Program, I completed the ALX Terminator lab, a hands-on lab designed to strengthen foundational Linux…

Stephen Onyango · 2026-07-08 23:46 · 0 claps · 7.1 min read
#linux-commands #cybersecurity #command-line #alxafrica
Open on Medium ↗
Wiki topics: 🔒 · Cybersecurity 🔓 · Open Source 🥊 · Combat Sports

ALX Terminator lab Walkthrough

As part of the ALX Cybersecurity Program, I completed the ALX Terminator lab, a hands-on lab designed to strengthen foundational Linux command-line skills through a series of progressively challenging tasks.

Each level focuses on a practical Linux concept, including filesystem navigation, file permissions, hidden files, pattern matching, compressed and encrypted files, cron jobs, and user management. Rather than memorizing commands, the lab emphasizes understanding how they work and applying them to solve real problems.

This walkthrough documents my approach to each challenge, the commands I used, screenshots of the process, and the lessons learned along the way. Whether you’re new to Linux or building a foundation for cybersecurity, I hope this guide helps you understand the reasoning behind each solution.

Level 1:

The objective was straightforward: locate a password stored somewhere in the home directory and use it to access the next user account.

level 1 description

level 1 description

After listing the files in the home directory, we found the password.txt file. We then use the cat command to display the file contents which is the password for the next level. Now we got the password to level 3, we will use su to switch to user level3

Level 2: Dashed file

Level 2 introduced a small obstacle that can easily confuse new Linux users. Instead of working with a normal filename, the challenge used a file named -. Although it looks simple, a leading dash has a special meaning in many Linux commands because it usually indicates a command-line option.

The objective was to locate the file and determine how to display its contents without the shell interpreting the filename as an option.

Description of level 2

Description of level 2

After logging in as the level2 user, I listed the contents of the current directory. To tell Linux that the dash is a filename rather than an option, I referenced it through its relative path as /home/level2/-. Now we got the password to level 3, we will use su to switch to user level3

Level 3: Hidden files

The next challenge looked deceptively simple. After logging in as the level3 user, I listed the contents of the home directory and found almost nothing.

The challenge description hinted that something might be hidden. In Linux, files and directories whose names begin with a period (.) are hidden by default, so a standard ls command will not display them.

To reveal hidden files, I reran the command with the -a option.With the hidden file identified, I displayed its contents using the cat command.

Level 4: Spaced out files

This level focused on working with filenames that contain spaces. After logging in as the level4 user, I listed the contents of the current directory to identify the password file.

Since the filename contained spaces, I escaped each space with a backslash (\) so the shell would interpret it as a single filename.

Level 5: Searching for the Password

This level introduced the grep command, which searches for text that matches a given pattern. After listing the files in the current directory, I found the file containing the passwords.

The challenge stated that the correct password was on the line containing the word “password”. I used grep to search for that pattern.

Level 6: The Gzipped Files

This level introduced working with compressed files. The password was stored inside a file with a .gz extension, which first had to be decompressed before its contents could be read.

Since I did not have write permissions in the home directory, I performed the extraction in the /tmp directory. I copied the compressed file to /tmp, extracted it with gunzip, and displayed its contents.

Level 7: The Base64 Encoded Password

This level introduced Base64 encoding. The password was stored as an encoded string, which needed to be decoded to reveal the plain text.

I piped the contents of the file to the base64 command with the -d option to decode it.

Level 8: The AES-256-CBC Encrypted Password

This level introduced file decryption using OpenSSL. The password was stored in an AES-256-CBC encrypted file, while a second file contained the passphrase required to decrypt it.

I used the passphrase from the second file to decrypt the encrypted password with openssl. Since the challenge required writing an output file, I saved the decrypted file in the /tmp directory.

Level 9: The Inaccessible Password File

This level focused on Linux file permissions and sudo. The password file existed in the current directory, but attempting to read it resulted in a Permission denied error.

To determine what elevated privileges were available, I listed the commands my user was allowed to run with sudo.

The output showed the permitted command, which I then used to read the protected password file with elevated privileges.

Level 10: The Missing Password

This level required using sudo privileges to reset the password for the level11 user. Instead of searching for a hidden password, the objective was to create a new one and use it to access the account.

First, I reviewed the available sudo permissions to confirm that I was allowed to change another user's password.

Using the permitted sudo privileges, I changed the password for the level11 user to whatever I wanted.

Level 11: Network Detective

This level focused on identifying the container’s IP address. The challenge hinted that the answer might already be known, but I verified it by inspecting the network configuration.

The loopback address was the correct flag for this level

Level 12: Cron Job

This level introduced cron jobs, which are used in Linux to schedule automated tasks. The objective was to inspect the system’s cron configuration and identify a scheduled task that exposed the password for the next level.

To view the configured cron jobs, I ran:

The output revealed a scheduled task with a comment referencing the next level’s password.

The cron entry contained the clue needed to continue to the next level by indicating where the Level 13 password was hidden.

Level 13: UID

This level focused on identifying a user’s unique identifier (UID). The objective was to determine the UID of the level14 user and use it as the password for the next level.

To retrieve the user information, I queried the system’s user database. The third field (1337) is the UID and served as the password for the next level.

Level 14: Challenge Complete

The terminal displayed the completion message along with the final flag.

Challenges and Lessons Learned

Most of the levels were straightforward once I understood the objective, but two challenges required additional troubleshooting.

Level 8: While decrypting the encrypted file with OpenSSL, I initially encountered errors such as bad decrypt and error reading input file. After reviewing the challenge, I realized the decryption password had to be decoded from base64.txt before it could be used. I also learned that the -a flag should only be used when the encrypted input is Base64-encoded. Removing the unnecessary flag and supplying the correct password allowed the decryption to succeed.

Lesson learned: Before troubleshooting command syntax, verify the format of the input data and ensure all prerequisites have been completed.

Level 12: Finding the password in the cron job was less obvious than expected. I initially inspected the system cron files under /etc/cron*, expecting to find the password there. After reviewing multiple files without success, I revisited the challenge and examined the current user's crontab with crontab -l. The password was hidden inside a comment within the scheduled command, making careful inspection more important than broad searching.

Lesson learned: Enumeration is only effective when guided by the challenge requirements. Revisiting the problem statement can save time and prevent unnecessary investigation.

This lab reinforced an important principle that applies to cybersecurity beyond Linux. Success often depends on understanding the environment, reading clues carefully, and troubleshooting methodically instead of relying on trial and error.


메타데이터
post_id
de195e007da8
slug
alx-terminator-lab-walkthrough-de195e007da8
url
https://medium.com/@stephen_onyango/alx-terminator-lab-walkthrough-de195e007da8
canonical_url
https://medium.com/@stephen_onyango/alx-terminator-lab-walkthrough-de195e007da8
author_url
https://medium.com/@stephen_onyango
status
ok
fetched_at
2026-07-28 01:42:33