This lab focused on exploiting vulnerabilities in a Postgres service on a Linux server using Metasploit on Kali Linux. Through controlled exploitation and privilege escalation, the lab provided hands-on experience with vulnerability scanning, exploitation, and gaining administrative access.
- Effective use of Nmap and OpenVAS for scanning and vulnerability detection.
- Experience using Greenbone Security Assistant for managing vulnerability data.
- Proficiency with Metasploit Framework and Meterpreter for exploitation and shell interaction.
- Understanding of network security, pentesting methodologies, and privilege escalation techniques.
- Nmap/Zenmap – Network scanning for open ports and services.
- OpenVAS/Greenbone – Vulnerability scanning and management.
- Metasploit Framework – For exploiting vulnerabilities in Postgres and escalating privileges.
- Meterpreter – For shell interaction and control over the target system.
-
Nmap: Used to scan for open ports and services on the target system.
-
OpenVAS with Greenbone: Launched OpenVAS to detect vulnerabilities.
-
Metasploit Setup: Started PostgreSQL service and launched Metasploit to exploit the target.
- Command:
msfconsole
- Command:
-
PostgreSQL Exploitation: Ran auxiliary modules to brute-force and gain access.
-
Udev Netlink Exploit: Used local exploit to gain root privileges on the target system.
-
Execute Interactive Bash Shell: After exploiting the target, we executed
execute -f /bin/bash -ito spawn an interactive shell with root privileges.- Explanation: This command was used to start an interactive bash shell on the target system. By doing this, we gained direct root access, allowing us to issue commands dynamically with elevated permissions.
- Command:
execute -f /bin/bash -i
-
Verification and Accessing
/etc/shadow: With root access, we verified our elevated privileges by accessing the/etc/shadowfile, which stores hashed passwords and is only accessible by the root user.
This lab demonstrated the process of exploiting a vulnerable Postgres database, escalating privileges to root, and gaining a deeper understanding of penetration testing workflows.





