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.
Quick Overview
Navigation
- Executive Summary
- Assessment Methodology
- Attack Chain
- Reconnaissance
- Host Resolution
- Full TCP Port Scan
- Service Enumeration
- Web Application Enumeration
- Local File Inclusion Discovery
- Reading Sensitive Files
- Linux Enumeration
- Enumerating
/proc/net/tcp - Process Enumeration
- Initial Access
- Remote Code Execution
- Shell Stabilization
- Privilege Escalation
- SUID Enumeration
- GTFOBins Technique
- SSH Persistence
- Wildcard
sudoMisconfiguration - Root Verification
- MITRE ATT&CK Mapping
- Tools Used
- Security Findings
- Security Recommendations
- Lessons Learned
- Assessment Outcome
- References
- Responsible Use
- Repository Information
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.
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.
Full TCP Port Scan
A complete TCP SYN scan was performed to identify exposed TCP services.
nmap -sS -Pn -T4 -p- airplane.thm
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
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.
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.
/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.
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 discovery.Result
The service listening on port 6048 was identified as gdbserver.
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.
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.
findsudoSUID Enumeration
The filesystem was inspected for SUID-enabled binaries.
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.
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.
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.
sudo exploitation.Result
The crafted path bypassed the intended restriction and executed with root privileges.
sudoers allowed the intended restriction to be bypassed and resulted in root-level command execution.
Root Verification
Administrative privileges were verified after exploitation.
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 |
Tools Used
The documented workflow used the following tools and utilities.
| 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 |
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
sudoersrules for unintended path or argument bypasses.
Lessons Learned
Technical
The Airplane assessment demonstrated practical application of:
- Local File Inclusion exploitation
- Linux
/procfilesystem enumeration - Hidden service discovery
- Process enumeration
gdbserverdiscovery- Remote Code Execution
- Reverse shell establishment
- Shell stabilization
- SUID-based Linux privilege escalation
- GTFOBins techniques
- SSH key authentication
- Wildcard
sudomisconfiguration 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
The documented assessment successfully progressed from external reconnaissance through web exploitation and local privilege escalation to full administrative access.
References
- TryHackMe Airplane Room
- MITRE ATT&CK Framework
- GTFOBins
- HackTricks — Linux Privilege Escalation
- OWASP Path Traversal Documentation
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 |