PG Nibbles

I look into vsftpd 3.0.3 first. Only a DDoS vulnerablity exists. Anonymous login is not working.

I move onto port 80. I don't see anyting interesting. ffuf is not showing anything.

It must be the postgresql server. I try psql and it does not work. It does not work because I need to set the port! The postgresql is sitting on port 5437. The default port is 5432. The default username/password is postgres/postgres.

I don't know much about postgres so I go on hacktricks. https://book.hacktricks.xyz/network-services-pentesting/pentesting-postgresql

The three metasploit modules stand out.

I read the /etc/passwd file. wilson is a user. I try to read /home/wilson/.ssh/authorized_keys and /home/wilson/.ssh/id_rsa. He does not have either. Reading doesn't help. The /bin/bash on postgres is insteresting to me.

I got stuck on this part for 1 hour. I use my favorite port 443 for reverse shells. Most Firewalls allow port 80 and 443. In Offsec fashion, they blocked port 443. I have run into this issue on another Offsec box a year ago. After an hour, I change the port to 80 and this exploit works.

I finally have a shell on a box. Priv Esc takes little time. Wget linpeas.sh and run it.

Find on gtfobins: https://gtfobins.github.io/gtfobins/find/

🗡️ Solved in Under 4 Hours 🗡️

First Intermediate box yay! I'm playing pokemon now. I collected postgres. I'm still looking for Oracle, MySQL, and more web apps.

Lessons Learned

  1. If a reverse shell is not working, try setting port 80 on it.
  2. First Postgres hack.
  3. Starting a Postgres Jutsu sheet

Additional Work

Manual Exploit

I want a manual exploit. 50847 works. searchsploit -m 50847. https://www.exploit-db.com/exploits/50847

FTP User/Pass List

For when I was using hydra on FTP: https://github.com/danielmiessler/SecLists/blob/master/Passwords/Default-Credentials/ftp-betterdefaultpasslist.txt

Actually going a directory up, this all looks good. https://github.com/danielmiessler/SecLists/tree/master/Passwords/Default-Credentials

Read this and grap important info for jutsu sheet: https://medium.com/@netscylla/pentesters-guide-to-postgresql-hacking-59895f4f007 and https://book.hacktricks.xyz/network-services-pentesting/pentesting-postgresql

Comments

Popular posts from this blog

HTB - Jarvis MySQL

Palo Alto for GNS3 CCDC Tutorial

Trace Labs Global Missing Persons CTF V