PG Banzai

21 | FTP | vsftpd 3.0.3 | (admin/admin)
22 | SSH | OpenSSH 7.4p1
25 | SMTP | Postfix smtpd
5432 | Postgres | Can't login.
8080 | Web | Nothing here
8295 | Web | Nothing here

We can enumerate users on SMTP. Install smtp-user-enum and use xato-net-10-millino-usernames-dup.txt Users admin, root, and banzai exist.

admin/admin is found. Login via FTP

There is a configuration issue. Whenever I write "ls" or "dir", FTP goes into "Extended Passive Mode" which breaks my shell. I googled the answer here: https://serverfault.com/questions/152245/how-to-disable-passive-mode-in-linux-ftp-command

Put a shell.php in the directory. Visit: http://192.168.65.56:8295/shell.php to trigger a PHP Reverse shell. I used port 21.

While getting my linpeas.sh file, I see port 80 is blocked. I don't fall for this anymore :) . I used port 21 for everything this time.

I run linpeas.sh, and nothing stands out. I go looking around and arrive to /var/www.

A config.php file exists with a password. I go to hacktricks: https://book.hacktricks.xyz/network-services-pentesting/pentesting-mysql

This MySQL version is vulnerable to priv esc. The copy function did not work. I used this trick instead: https://emarcel.com/mysql-error-when-creating-function/ to copy the file over to /usr/lib/mysql/plugin. I believe this file can work too: https://www.exploit-db.com/exploits/1518

🗡️ Solved in Under 2 Hours 🗡️

Lessons Learned

  1. Installed smtp-users-enum. Ready for future use.
  2. Now use xato first vs rockyou.txt to save time.
  3. Re-discovered this priv esc option for MySQL

Need to Do

  1. Create 2 jutsu docs for SMTP and MySQL

Comments

Popular posts from this blog

HTB - Jarvis MySQL

Palo Alto for GNS3 CCDC Tutorial

Trace Labs Global Missing Persons CTF V