Airplane
CTF WRITEUP
# ✈️ Airplane — TryHackMe Penetration Testing Walkthrough

This documentation presents a complete penetration testing walkthrough for the Airplane room on TryHackMe, following a professional offensive security methodology from reconnaissance through web exploitation, Linux enumeration, remote code execution, privilege escalation, and root access.

TryHackMe Linux Medium Web Exploitation Penetration Testing

Quick Overview

Platform
TryHackMe
Room
Airplane
Difficulty
Medium
Operating System
Linux
Category
Web Exploitation
Assessment Type
Black-box Penetration Test
Environment
Authorized TryHackMe Lab
Assessment Outcome
Root Access Achieved


Executive Summary

The Airplane room demonstrates a realistic attack chain beginning with reconnaissance, identifying a Local File Inclusion (LFI) vulnerability, enumerating Linux processes through the /proc filesystem, discovering an exposed gdbserver, obtaining Remote Code Execution, and escalating privileges to root using Linux privilege escalation techniques.

The assessment demonstrates the relationship between web-layer vulnerabilities, local Linux enumeration, exposed internal services, remote code execution, SUID misconfiguration, SSH access, and a vulnerable wildcard sudo rule.

The documentation below records the observed methodology, commands, evidence, findings, and defensive recommendations.


Assessment Methodology

The assessment followed an offensive security workflow progressing from external reconnaissance toward full administrative access.

Reconnaissance
→
Service Enumeration
→
Web Enumeration
→
LFI Exploitation
→
Linux Enumeration
→
gdbserver Discovery
→
Remote Code Execution
→
Privilege Escalation
→
Root Access
Airplane CTF attack chain from reconnaissance through root access
Figure — Airplane attack chain from reconnaissance to root access.

1. Reconnaissance

Reconnaissance established the target environment and identified the externally exposed attack surface.

Host Resolution

The target hostname was added to the local hosts file before enumeration.

Local hosts file configured for the Airplane target
Figure 1 — Host resolution configuration.

Full TCP Port Scan

A complete TCP SYN scan was performed to identify exposed TCP services.

nmap -sS -Pn -T4 -p- airplane.thm
Nmap full TCP port scan of the Airplane target
Figure 2 — Full TCP port scan.

Exposed Services

Port Service
22 SSH
6048 Unknown
8000 Werkzeug HTTP

The scan established three relevant exposed ports, with port 6048 requiring additional investigation because its service was initially unknown.


Service Enumeration

A focused service/version scan was then performed against the identified ports.

nmap -sV -sC -p22,6048,8000 airplane.thm
Nmap service enumeration results for ports 22, 6048 and 8000
Figure 3 — Service version detection.

Findings

The service enumeration identified:

  • Werkzeug Python Web Server
  • OpenSSH
  • An unknown service on port 6048 requiring further investigation

The Werkzeug application on port 8000 became the primary web attack surface.


2. Web Application Enumeration

The exposed web application redirected requests to a parameterized endpoint.

The observed request structure included:

?page=index.html

The presence of a user-controlled page parameter suggested a potential file inclusion attack surface.


Local File Inclusion Discovery

Directory traversal payloads were tested against the page parameter.

Local File Inclusion discovered through the page parameter
Figure 4 — Local File Inclusion identified.
Key Finding — Local File Inclusion
The application allowed arbitrary file reads from the server filesystem through the vulnerable `page` parameter.

Security Impact

The ability to read arbitrary local files provided visibility into sensitive Linux system information and enabled further host-level enumeration.


Reading Sensitive Files

The LFI vulnerability was used to access Linux system files.

Linux passwd file enumeration through the Local File Inclusion vulnerability
Figure 5 — /etc/passwd enumeration.

Information Collected

File Purpose
/etc/passwd Local users
/etc/group Group memberships
/proc/self/environ Process environment
/proc/net/tcp Network sockets

This provided a useful transition from web-layer exploitation into Linux host enumeration.


3. Linux Enumeration

The LFI capability exposed additional information from the underlying Linux environment.

The /proc filesystem was particularly useful because it provided information about active processes and network sockets.


Enumerating /proc/net/tcp

The /proc/net/tcp interface was examined to identify active TCP listeners.

Enumeration of Linux TCP sockets through proc net tcp
Figure 6 — Hidden TCP listener enumeration.

Observation

A hexadecimal port value corresponded to 6048, confirming the presence of an internal service associated with the previously unknown listener.

This provided a direct lead for identifying the service responsible for the exposed port.


Process Enumeration

Running processes were enumerated to determine ownership and identify the process associated with the hidden listener.

gdbserver process discovered during Linux process enumeration
Figure 7 — gdbserver process discovery.

Result

The service listening on port 6048 was identified as gdbserver.

Key Finding — Exposed Debugging Service
A remotely accessible debugger significantly expanded the target's attack surface and provided the path toward remote code execution.

4. Initial Access

The discovered debugging service was leveraged to obtain code execution and establish an interactive foothold.


Remote Code Execution

The exposed debugger service was leveraged to execute a reverse shell payload.

Reverse shell established through the exposed gdbserver service
Figure 8 — Reverse shell established.

Outcome

Initial access was obtained as a low-privileged Linux user.

The successful shell established a foothold from which local enumeration and privilege escalation could continue.


Shell Stabilization

A PTY shell was created to improve shell interaction and support post-exploitation activities.

Benefits

  • Interactive shell behavior
  • Proper terminal behavior
  • More reliable privilege escalation workflow

Shell stabilization provided a more practical environment for subsequent local enumeration and exploitation.


5. Privilege Escalation

Following initial access, the system was examined for local privilege escalation opportunities.

Low-Privileged Shell
→
SUID Enumeration
→
SUID find
→
Elevated Local Access
→
SSH Access
→
Wildcard sudo
→
Root

SUID Enumeration

The filesystem was inspected for SUID-enabled binaries.

SUID-enabled binaries identified during local enumeration
Figure 9 — SUID binary enumeration.

Key Finding

A SUID-enabled find binary provided a privilege escalation opportunity.

A SUID binary executes with the privileges of its owning account, making unexpected or unnecessary SUID-enabled utilities an important local privilege escalation concern.


GTFOBins Technique

The SUID-enabled find binary was abused using the documented GTFOBins technique.

SUID find privilege escalation using the documented GTFOBins technique
Figure 10 — SUID find privilege escalation.

Outcome

Access was escalated to a higher-privileged local account.

This represented a significant progression from the initial low-privileged foothold.


SSH Persistence

SSH key authentication was configured for stable authenticated access.

SSH key authentication configured for stable access
Figure 11 — SSH key authentication.

Why SSH?

SSH provided:

  • Persistent access
  • A reliable terminal
  • An easier post-exploitation workflow

The SSH configuration therefore provided a more stable mechanism for continuing the assessment.


Wildcard sudo Misconfiguration

A vulnerable wildcard rule inside sudoers allowed unintended command execution.

Wildcard sudo rule exploited for root privilege escalation
Figure 12 — Wildcard sudo exploitation.

Result

The crafted path bypassed the intended restriction and executed with root privileges.

Key Finding — Wildcard Sudo Rule
An overly permissive wildcard rule in sudoers allowed the intended restriction to be bypassed and resulted in root-level command execution.

Root Verification

Administrative privileges were verified after exploitation.

Root shell verification showing uid zero
Figure 13 — Root shell verification.

Validation

uid=0(root)
gid=0(root)
groups=0(root)

The assessment successfully achieved full administrative access.


MITRE ATT&CK Mapping

The documented attack activity maps to the following MITRE ATT&CK concepts.

Tactic Technique Evidence
Initial Access Exploit Public-Facing Application Web application exploitation through the documented LFI vulnerability
Discovery Process Discovery Linux process enumeration used to identify gdbserver
Discovery Network Service Discovery Enumeration of exposed and internally identified network services
Execution Command & Scripting Interpreter Command execution following exploitation and shell access
Persistence SSH Authorized Keys SSH key authentication configured for stable access
Privilege Escalation Abuse Elevation Control Mechanism SUID and wildcard sudo privilege escalation activity
Initial Access Discovery Execution Persistence Privilege Escalation

Tools Used

The documented workflow used the following tools and utilities.

Nmap gdbserver SSH find GTFOBins
Tool / Utility Documented Purpose
Nmap TCP port scanning and service enumeration
gdbserver Exposed debugging service identified during enumeration
SSH Stable authenticated access
find SUID privilege escalation vector
GTFOBins Reference for the documented SUID find technique

Security Findings

The assessment identified several security weaknesses documented throughout the attack chain.

Finding Severity Evidence Impact
Local File Inclusion High page parameter allowed arbitrary file reads Exposure of local filesystem information
Exposed gdbserver Critical gdbserver identified on port 6048 Remote code execution and initial access
SUID Misconfiguration High SUID-enabled find binary Local privilege escalation
Wildcard sudo Rule Critical Vulnerable wildcard sudoers rule Root-level command execution
Primary Attack Path
The documented compromise progressed from a web-accessible Local File Inclusion vulnerability to Linux host enumeration, discovery of an exposed gdbserver, remote code execution, local privilege escalation through a SUID-enabled find binary, stable SSH access, and ultimately root access through a vulnerable wildcard sudo rule.

Security Recommendations

The following recommendations are directly derived from the documented findings.

Web Application

  • Validate user-controlled file paths.
  • Prevent directory traversal.
  • Restrict filesystem access.
  • Avoid allowing user input to directly determine files that the application reads.

Linux Hardening

  • Audit SUID binaries.
  • Remove unnecessary privileged binaries.
  • Apply least privilege.
  • Review privileged executable permissions regularly.

SSH

  • Audit authorized_keys.
  • Restrict write permissions.
  • Monitor authentication events.
  • Review unexpected or unauthorized SSH keys.

Services

  • Disable remote debugging in production.
  • Restrict internal services with firewall rules.
  • Monitor unexpected listeners.
  • Avoid exposing debugging infrastructure to untrusted networks.

Sudo Configuration

  • Review wildcard rules in sudoers.
  • Restrict command arguments as precisely as possible.
  • Apply least privilege to administrative command execution.
  • Test sudoers rules for unintended path or argument bypasses.

Lessons Learned

Technical

The Airplane assessment demonstrated practical application of:

  • Local File Inclusion exploitation
  • Linux /proc filesystem enumeration
  • Hidden service discovery
  • Process enumeration
  • gdbserver discovery
  • Remote Code Execution
  • Reverse shell establishment
  • Shell stabilization
  • SUID-based Linux privilege escalation
  • GTFOBins techniques
  • SSH key authentication
  • Wildcard sudo misconfiguration analysis
  • Root privilege verification

Documentation

The exercise also reinforced the importance of:

  • Evidence-based security reporting
  • Structured penetration testing methodology
  • Clear technical explanations
  • Screenshot organization
  • MITRE ATT&CK mapping
  • Finding and impact documentation
  • Remediation-focused reporting

Assessment Outcome

Reconnaissance
Completed
Web Enumeration
Completed
LFI Exploitation
Completed
Remote Code Execution
Completed
Privilege Escalation
Completed
Root Access
Completed

The documented assessment successfully progressed from external reconnaissance through web exploitation and local privilege escalation to full administrative access.


References


Responsible Use

This documentation was created for an authorized TryHackMe training environment. The techniques described are intended for educational purposes, authorized penetration testing, security research, and controlled laboratory environments only.


Repository Information

Project Value
Repository TryHackMe-Airplane-CTF-Walkthrough
Author Anurag Ravankar
Category Penetration Testing Documentation
Platform TryHackMe
Environment Authorized Training Lab