Hack The Box: Knife Write-up

This box was SUPERRRRRRRRR easy. What’s funny is I purposefully was like “Ah shoot I only have like 20 minutes to speed run this before work” and sure enough I rooted the whole thing in like 15 minutes lol. The only PITFALL was RUBY

Yeah well not here buddy anyways it wasn’t hard I was over complicating it trying to get a revshell instead of a bash shell in context.

Enumeration

=== 10.129.103.49 (22,80) ===
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-10-07 20:21 EDT
Nmap scan report for 10.129.103.49
Host is up (0.055s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   3072 be:54:9c:a3:67:c3:15:c3:64:71:7f:6a:53:4a:4c:21 (RSA)
|   256 bf:8a:3f:d4:06:e9:2e:87:4e:c9:7e:ab:22:0e:c0:ee (ECDSA)
|_  256 1a:de:a1:cc:37:ce:53:bb:1b:fb:2b:0b:ad:b3:f6:84 (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title:  Emergent Medical Idea
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

HTTP

As we can see there is a known vulnerable version of PHP running the website! Easy pickings. Let’s google dork a ‘php 8.1.0 reverse shell poc github’ and hit it

https://github.com/flast101/php-8.1.0-dev-backdoor-rce/blob/main/README.md

Let’s run it on port 80 to avoid firewall rules, using rlwrap so we can go up and down and sideways in our shell history.

And…

Privilege Escalation

The first thing I always do on a box is check the sudo privileges. And this time, it just so happen to be wraps.

https://gtfobins.org/gtfobins/knife/

← all writeups