HackTheBox - Previous

HackTheBox - Previous

Source: YouTube · IppSec · published Jan 10, 2026 · 42:06

Penetration Testing
No ratings yet Log in to rate
Transcript Available
Description

This video demonstrates the exploitation of a Next.js middleware authentication bypass, leading to file disclosure and privilege escalation via Terraform command injection 0:00.

Key Takeaways:
• The challenge begins by exploiting a known Next.js middleware vulnerability to bypass authentication and access protected endpoints 0:06.
• Post-authentication, a file disclosure vulnerability enables examining the website's dependencies 0:15.
• Analysis of dependencies reveals stored credentials, allowing SSH access to the target machine 0:19.
• Privilege escalation is achieved by exploiting a sudo rule that permits running specific Terraform commands 0:25.
• Two methods leverage environment variables to override defaults, using symbolic links for file read and write access 0:30.
• A third method poisons the Terraform configuration file to redirect provider loading, executing a set-UID binary for root access 0:29.

The walk-through illustrates a realistic attack path from initial access to root, highlighting the importance of secure middleware configuration and strict sudo rules.

Sources:

  • 0:00 Introduction to the Hack the Box challenge and Next.js vulnerability
  • 0:06 Exploiting the Next.js middleware to bypass authentication
  • 0:15 Discovering file disclosure and analyzing dependencies
  • 0:19 Finding credentials and SSHing into the box
  • 0:25 Ex

Generate CPE Credits

Generate a professional CPE document from this video's transcript.

Estimated credit: 0.5 CPE hours

Estimate uses the video runtime (1 hour ≈ 1 CPE, rounded to the nearest 0.5, minimum 0.5, maximum 2.0). The final amount can be lower after review, never higher.

Topic: Penetration Testing. Commonly maps to: Security Assessment and Testing, Security Operations. Exact CISSP domains are assigned during generation.

CISSP Domain Mapping
Learning Objectives
Self-Assessment Questions
PDF Export Ready

Free account. One generation at a time, with a daily limit.

CPEBuddy is independent and not affiliated with or endorsed by ISC2, ISACA, or any certification body. Exports are formatted for common CPE submissions; acceptance is at your certification body's discretion.

Watch on YouTube

Transcript Preview

First 800 characters of the transcript

What's going on, YouTube? This is IPSG me doing previous from Hack the Box, which starts off with the Nex.js middleware vulnerability that made the headlines in early 2025. I'll show a couple ways to discover a vulnerable version is being utilized, and then we'll perform this exploit to bypass authentication. From here, we find a file disclosure vulnerability and with a little bit of looking into the dependencies of the website, we can identify where credentials may be stored. This lets us SSH into the box where a user can run a very specific Terraform command via pseudo. And we'll exploit this three different ways. The first two ways are dependent on pseudo being configured to not reset the environment because we'll use environment variables to override a default variable that lets us abu…