Grandmaster rank emblem

Lvl 99

Level XP3,807/5,718

3807 of 5718
Grandmaster dreadnaught
Machine
Photobomb
OS
Linux
Difficulty
Easy
Steps
3
Added
4 Sep 2023

Hardcoded JS credentials reach an injectable endpoint for a shell; a sudo script with a relative call gives root via PATH.

0Reconnmap1Footholdphotobomb.js2Footholdfiletype inject3Priv esccleanup.sh
1Recon2Foothold3Priv escnmap1photobomb.js2filetype inject3cleanup.sh4

How it went

  1. 0
    nmap

    An nmap scan shows SSH and an nginx site at photobomb.htb.

  2. 1
    photobomb.js

    A photobomb.js script hardcodes the credentials pH0t0:b0Mb! for the printer page.

  3. 2
    filetype inject

    The filetype parameter is injectable, giving command execution and a reverse shell as wizard for the user flag.

  4. 3
    cleanup.sh

    A sudo cleanup script calls [ without an absolute path; with SETENV, a PATH hijack makes a planted [ run as root.