SuperSecretTip - TryHackMe Walkthrough

Portfolio documentation of the SuperSecretTip TryHackMe lab.

View on GitHub

📖 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


⚔️ 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

Nmap Scan

A full TCP scan identified:

Key Observation

A development web server exposed to an external network significantly increases the attack surface.


Phase 2 — Web Content Discovery

Hidden Endpoint Enumeration

FFUF 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

Cloud Endpoint

The /cloud endpoint exposed internal Flask application files due to weak filename validation.

Security Impact


Secret Retrieval

Encrypted Secret

Encrypted authentication material became accessible through the vulnerable download endpoint.


Phase 4 — XOR Reverse Engineering

XOR Reconstruction

The application relied on a reversible XOR implementation instead of secure password hashing.

Security Lesson


🔐 Debug Authentication Analysis


Source Code Review

Debug Source

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

Debug Session

A valid authenticated session was established after reconstructing the protected password.

Session cookie intentionally redacted.


🌐 Server-Side Template Injection (SSTI)


SSTI Validation

SSTI Confirmation

A harmless template expression confirmed Server-Side Template Injection inside the Flask application.

Why SSTI Matters

SSTI allows attackers to:


🧠 Python Runtime Enumeration


Runtime Class Enumeration

Python Runtime Enumeration

The Jinja runtime exposed loaded Python classes.

Enumeration Goal

Identify a runtime object capable of executing operating system commands.


Command Execution Primitive

subprocess Discovery

The runtime contained a process execution class that enabled command execution.


💥 Remote Code Execution


Payload Preparation

Encoded Payload

The reverse shell command was encoded before delivery.

Why Encoding?

Encoding bypassed transport restrictions without changing payload functionality.


Payload Delivery

URL Encoded Payload

The encoded payload was delivered through the vulnerable template engine.


Reverse Shell Established

Reverse Shell

The application connected back to the listener, providing an interactive Linux shell.

Initial Access

FLAG_REDACTED

🐧 Linux Privilege Escalation


Cron Enumeration

Cron Observation

Process monitoring revealed recurring scheduled tasks running under multiple user contexts.

Interesting Discovery


Writable .profile

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

PATH Hijacking

A malicious executable replaced a legitimate command through PATH precedence.

Privilege Escalation Technique


Root Cron Configuration Abuse

Root Cron

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 Privilege Escalation

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

Authentication Security

Linux Security


🎓 Learning Outcomes

This room strengthened practical understanding of:

Offensive Security

Defensive Security


📂 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


# ⭐ Thank You for Visiting My Portfolio ## SuperSecretTip — TryHackMe Walkthrough **Cybersecurity Portfolio by Anurag R.** *Web Exploitation • Linux Privilege Escalation • Security Documentation*