Grandmaster rank emblem

Lvl 99

Level XP3,807/5,718

3807 of 5718
Grandmaster dreadnaught
Machine
Bashed
OS
Linux
Difficulty
Easy
Steps
3
Added
23 Mar 2023

A leftover phpbash web shell gives code execution as www-data; a sudo rule and a root cron lead to root.

0Reconnmap1Footholdphpbash.php2Lateralscriptmanager3Priv escroot cron
1Recon2Foothold3Lateral4Priv escnmap1phpbash.php2scriptmanager3root cron4

How it went

  1. 0
    nmap

    An nmap scan shows a single web server on port 80.

  2. 1
    phpbash.php

    Nikto reveals /dev/ which contains phpbash.php. Calling it gives us command execution as www-data, the user flag, and the ability to call a revshell.

  3. 2
    scriptmanager

    Sudo config enables lateral movement to scriptmanager account.

  4. 3
    root cron

    scriptmanager owns /scripts which contains test.py which is ran via root cron (implicated by test.txt stats). Replace test.py with a revshell for root.