$ nmap -sV -sC -PN -oA dog_nmap -p- 10.10.11.58
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-06-23 14:18 CEST
Nmap scan report for 10.10.11.58
Host is up (0.045s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.12 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 97:2a:d2:2c:89:8a:d3:ed:4d:ac:00:d2:1e:87:49:a7 (RSA)
| 256 27:7c:3c:eb:0f:26:e9:62:59:0f:0f:b1:38:c9:ae:2b (ECDSA)
|_ 256 93:88:47:4c:69:af:72:16:09:4c:ba:77:1e:3b:3b:eb (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Home | Dog
| http-robots.txt: 22 disallowed entries (15 shown)
| /core/ /profiles/ /README.md /web.config /admin
| /comment/reply /filter/tips /node/add /search /user/register
|_/user/password /user/login /user/logout /?q=admin /?q=comment/reply
| http-git:
| 10.10.11.58:80/.git/
| Git repository found!
| Repository description: Unnamed repository; edit this file 'description' to name the...
|_ Last commit message: todo: customize url aliases. reference:https://docs.backdro...
|_http-generator: Backdrop CMS 1 (https://backdropcms.org)
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
The site hosted by the web server on port 80 appears to be a blog for dog owners:
There is a link to a login page in the upper right corner, but no way of registering an account:
Foothold
The Nmap scan also found a publicly accesible Git repository in the web server root directory. The entire repository can be retrieved using a tool like git-dumper:
Using the username tiffany@dog.htb and the password found in the settings.php, the Backdrop admin panel can be accessed:
According to the Status report page, the version of Backdrop running on the target is 1.27.1. Searching for potential vulnerabilities for this version turned up a PoC for autenticated remote code execution.
The exploit creates a fake Backdrop module with a web shell payload. Once installed on the target (Functionality → Install new modules → Manual installation), the shell can be reached at http://dog.htb/modules/shell/shell.php:
Stood up a Netcat listener and ran a reverse shell payload in the web shell. Got a call back in the reverse shell as www-data.
johncusack@dog:~$ sudo -l
...
User johncusack may run the following commands on dog:
(ALL : ALL) /usr/local/bin/bee
According to the documentation, bee is a CLI tool for managing Backdrop. Among the usual selection of management functions, it also a command for running arbitrary PHP code:
With sudo permissions, eval runs as root and can be used to escalate privileges.
Attempted initially to execute a PHP reverse shell that would connect to a Netcat listener, but this didn't work. Opted instead for generating an SSH key pair and placing the public key in /root/.ssh/authorized_keys using the following eval command: