Surveillance
Recon
nmap_scan.log
Open 10.129.230.42:22
Open 10.129.230.42:80
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} {{ip}} -vvv -sV -sC -Pn" on ip 10.129.230.42
PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 96:07:1c:c6:77:3e:07:a0:cc:6f:24:19:74:4d:57:0b (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBN+/g3FqMmVlkT3XCSMH/JtvGJDW3+PBxqJ+pURQey6GMjs7abbrEOCcVugczanWj1WNU5jsaYzlkCEZHlsHLvk=
| 256 0b:a4:c0:cf:e2:3b:95:ae:f6:f5:df:7d:0c:88:d6:ce (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIm6HJTYy2teiiP6uZoSCHhsWHN+z3SVL/21fy6cZWZi
80/tcp open http syn-ack nginx 1.18.0 (Ubuntu)
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-title: Did not follow redirect to http://surveillance.htb/
|_http-server-header: nginx/1.18.0 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernelHTTP (80)

CraftCMS_CVE-2023-41892https://blog.calif.io/p/craftcms-rceExploiting Arbitrary Object Instantiations in PHP without Custom Classes
Upgrade the webshell to reverse shell:
Enumerate the database
There's 3 users on the box
Hmm.. the password is probably not crackable so giving up on that.
There's a SQL backup in application
Download the file with pwncat

SSH (22)
Creds:
matthew:starcraft122490
User.txt
Privilege Escalation (zoneminder)
No luck with sudo
There are other web applications
Port forward the application

Default credentials admin:admin doesn't work, SSH credentials doesn't work, but admin:starcraft122490 works!
Creds:
admin:starcraft122490

The version is v1.36.32
Privilege Escalation (root)
Looks like this user has permissions to sudo any binary above without password, but rule looks tricky so we might do more.
Application allows setting LD_PRELOAD environment variable

For some reason pwncat-cs wasn't working when running gcc because ld is missing... (???) upgrade to SSH
LD_PRELOAD exists only in zmdc
version doesn't trigger it, but startup did.
Root.txt
Last updated