📖 About This Walkthrough
SuperSecretTip is a web exploitation and Linux privilege escalation room on TryHackMe that demonstrates how multiple independent security weaknesses can be chained together into a complete system compromise.
This documentation is written as a professional penetration testing report rather than a simple CTF write-up. Every exploitation stage is documented with technical analysis, screenshots, security observations, MITRE ATT&CK mapping, and defensive recommendations.
Public Portfolio Edition
All challenge flags, passwords, cookies, API keys, session tokens, and sensitive values have been intentionally redacted.
🎯 Assessment Objectives
- Enumerate exposed services.
- Discover hidden web application endpoints.
- Analyze vulnerable Flask source code.
- Reverse weak XOR authentication logic.
- Authenticate to the internal debug interface.
- Exploit Server-Side Template Injection (SSTI).
- Achieve Remote Code Execution.
- Obtain an interactive Linux shell.
- Escalate privileges using Linux environment misconfigurations.
- Analyze insecure root cron execution.
⚔️ Complete Attack Chain
Internet
│
▼
Werkzeug HTTP Server
│
▼
Directory Enumeration
│
▼
Source Code Disclosure
│
▼
XOR Secret Reconstruction
│
▼
Authenticated Debug Session
│
▼
Server-Side Template Injection
│
▼
Python Runtime Enumeration
│
▼
Remote Code Execution
│
▼
Interactive Shell
│
▼
Cron Enumeration
│
▼
Writable .profile
│
▼
PATH Hijacking
│
▼
Second User Access
│
▼
Root Cron Abuse
│
▼
Root-Level File Access
🧩 Skills Demonstrated
| Red Team | Blue Team | Linux |
|---|---|---|
| Nmap Enumeration | Detection Engineering | Cron Analysis |
| FFUF Discovery | MITRE ATT&CK Mapping | PATH Hijacking |
| Burp Suite | Security Hardening | File Permissions |
| Source Code Review | Root Cause Analysis | Environment Variables |
| Flask Security | Log Analysis | Privilege Escalation |
| SSTI Exploitation | IOC Identification | Scheduled Tasks |
💻 Technical Environment
| Component | Technology |
|---|---|
| Operating System | Ubuntu Linux |
| Web Framework | Flask |
| HTTP Server | Werkzeug Development Server |
| Programming Language | Python 3 |
| Template Engine | Jinja2 |
| Category | Web Exploitation + Privilege Escalation |
📍 Walkthrough Timeline
Phase 1 — Network Reconnaissance
Service Enumeration

A full TCP scan identified:
- SSH Service
- Werkzeug Development Server running on TCP/7777
Key Observation
A development web server exposed to an external network significantly increases the attack surface.
Phase 2 — Web Content Discovery
Hidden Endpoint Enumeration

Directory enumeration discovered undocumented application endpoints.
Interesting Endpoints
| Endpoint | Purpose |
|---|---|
/cloud |
Download functionality exposing internal files. |
/debug |
Authentication-protected debug interface. |
Phase 3 — Source Code Disclosure
Download Function Analysis

The /cloud endpoint exposed internal Flask application files due to weak filename validation.
Security Impact
- Hidden routes exposed.
- Authentication logic exposed.
- Helper modules exposed.
- Cryptographic implementation exposed.
Secret Retrieval

Encrypted authentication material became accessible through the vulnerable download endpoint.
Phase 4 — XOR Reverse Engineering

The application relied on a reversible XOR implementation instead of secure password hashing.
Security Lesson
- Reversible encryption is not password hashing.
- Static XOR keys should never protect authentication secrets.
🔐 Debug Authentication Analysis
Source Code Review

Application logic revealed how localhost validation and authentication were implemented.
Trust Boundary Finding
The application trusted client-controlled request metadata when determining localhost access.
Authenticated Debug Session

A valid authenticated session was established after reconstructing the protected password.
Session cookie intentionally redacted.
🌐 Server-Side Template Injection (SSTI)
SSTI Validation

A harmless template expression confirmed Server-Side Template Injection inside the Flask application.
Why SSTI Matters
SSTI allows attackers to:
- Evaluate server-side expressions.
- Access Python runtime objects.
- Execute operating system commands.
- Escalate to Remote Code Execution.
🧠 Python Runtime Enumeration
Runtime Class Enumeration

The Jinja runtime exposed loaded Python classes.
Enumeration Goal
Identify a runtime object capable of executing operating system commands.
Command Execution Primitive

The runtime contained a process execution class that enabled command execution.
💥 Remote Code Execution
Payload Preparation

The reverse shell command was encoded before delivery.
Why Encoding?
Encoding bypassed transport restrictions without changing payload functionality.
Payload Delivery

The encoded payload was delivered through the vulnerable template engine.
Reverse Shell Established

The application connected back to the listener, providing an interactive Linux shell.
Initial Access
FLAG_REDACTED
🐧 Linux Privilege Escalation
Cron Enumeration

Process monitoring revealed recurring scheduled tasks running under multiple user contexts.
Interesting Discovery
- Login shell executed periodically.
- Root scheduled task executed automatically.
Writable .profile

A writable shell initialization file created an opportunity to influence PATH resolution.
Security Observation
Login shells inherit environment configuration from .profile.
PATH Hijacking

A malicious executable replaced a legitimate command through PATH precedence.
Privilege Escalation Technique
- Writable PATH entry.
- Login shell.
- Command executed without absolute path.
Root Cron Configuration Abuse

A root scheduled task consumed a curl configuration file writable by a lower-privileged user.
Root Cause
A privileged process trusted attacker-controlled configuration.
Root-Level File Access

Root-context file access was achieved through cron configuration abuse.
FLAG_REDACTED
🔎 Security Findings Summary
| Vulnerability | Severity | Category |
|---|---|---|
| Source Code Disclosure | 🔴 High | Information Disclosure |
| Weak XOR Authentication | 🟠 Medium | Cryptographic Weakness |
| Forwarded Header Trust | 🔴 High | Authorization Bypass |
| Server-Side Template Injection | 🔴 Critical | Remote Code Execution |
Writable .profile |
🔴 High | Privilege Escalation |
| PATH Hijacking | 🔴 High | Linux Privilege Escalation |
| Writable curl Configuration | 🔴 Critical | Privilege Escalation |
🛡️ Blue Team Detection Opportunities
| Stage | Detection Strategy |
|---|---|
| Directory Enumeration | Detect abnormal discovery requests. |
| Source Downloads | Alert on access to application source files. |
| Debug Interface | Monitor requests to /debug. |
| Template Injection | Detect Jinja syntax inside request parameters. |
| Runtime Enumeration | Alert on requests containing Python introspection strings. |
| Reverse Shell | Detect Python spawning shell processes. |
| PATH Hijacking | Monitor .profile modifications. |
| Cron Abuse | Audit privileged scheduled task configuration. |
🧬 MITRE ATT&CK Mapping
| ATT&CK Phase | Technique |
|---|---|
| Network Discovery | T1046 |
| File Discovery | T1083 |
| Exploit Public-Facing Application | T1190 |
| Command & Scripting Interpreter | T1059 |
| Process Discovery | T1057 |
| Scheduled Task Discovery | T1053 |
| PATH Interception | T1574.007 |
| Data From Local System | T1005 |
📚 Security Lessons Learned
Web Security
- Never expose application source code through download functionality.
- Disable Flask debugging features in production.
- Never trust forwarded headers supplied by clients.
- Never render attacker-controlled template strings.
Authentication Security
- Replace XOR with Argon2id or bcrypt.
- Separate secrets from application source code.
- Never store reversible authentication secrets.
Linux Security
- Protect shell initialization files.
- Use absolute executable paths inside cron jobs.
- Prevent privileged tasks from reading writable configuration files.
🎓 Learning Outcomes
This room strengthened practical understanding of:
Offensive Security
- Reconnaissance
- Flask Security
- Burp Suite
- Jinja2 SSTI
- Python Runtime Enumeration
- Remote Code Execution
- Linux Privilege Escalation
Defensive Security
- Secure Configuration Review
- MITRE ATT&CK Mapping
- Detection Engineering
- Root Cause Analysis
- Security Hardening
📂 Project Structure
SuperSecretTip-TryHackMe-Walkthrough/
│
├── README.md
├── Documentation/
│ ├── Documentation.md
│ └── SuperSecretTip_TryHackMe_Report.docx
├── Resources/
│ └── notes.md
├── docs/
│ ├── index.md
│ ├── _config.yml
│ └── assets/
│ ├── css/
│ └── 00_room_banner.png ... 18_flags_terminal.png
📖 Repository Documentation
| File | Description |
|---|---|
| README.md | Repository landing page. |
| Documentation.md | Complete technical walkthrough. |
| Resources/notes.md | Security concepts and interview notes. |
| SuperSecretTip_TryHackMe_Report.docx | Printable report. |
| docs/index.md | GitHub Pages documentation site. |
⚠️ Ethical Disclosure
This documentation was created during an authorized TryHackMe training exercise.
Public Repository Policy
- ✅ Methodology documented.
- ✅ Screenshots preserved.
- ✅ Security analysis included.
- ❌ Challenge flags removed.
- ❌ Passwords removed.
- ❌ Session cookies removed.
- ❌ Secrets removed.