Page cover

Billing

Some mistakes can be costly.

Hey, fellow hackers! 🏴‍☠️

Today, we're setting sail into the Billing room on TryHackMe, where our mission is to navigate through vulnerabilities, uncover flags and claim root access! 💀⚔️

Reconnaissance - Scouting the Enemy 🚀

Every great conquest starts with intelligence gathering. A thorough network scan helps identify open services and potential entry points.

I use Nmap for this task:

🕵️ Findings :

  • 22/tcp - OpenSSH 8.4p1 (Debian)

  • 80/tcp - Apache 2.4.56 hosting a web application (/mbilling/)

  • 3306/tcp - MariaDB service, access denied (likely hosting sensitive VoIP data)

The presence of /mbilling/ suggests the system is running MagnusBilling, a widely used VoIP billing platform. This discovery guides our next steps towards web exploitation.

Initial Access - Breaking In! 🏴‍☠

MagnusBilling Login

Exploiting MagnusBilling (CVE-2023-30258)

A quick OSINT search reveals that MagnusBilling has an Unauthenticated Remote Command Execution (RCE) vulnerability (CVE-2023-30258)arrow-up-right . Leveraging this flaw provides us with an entry point into the system.

Time to fire up Metasploit 🔥

🎯 Boom! We're in!

  • Successfully executed RCE 🎉, gaining a meterpreter shell 💻

Let’s stabilize our foothold and get comfy:

With access as magnus, we begin system enumeration and credential discovery.

Retrieving the user flag! Yo-ho-ho!, Let’s press on. 🏴‍☠️

Privilege Escalation - Climbing the Ladder 🏆

Hunting for Credentials and Misconfigurations

A deep dive into configuration files often yields useful information. Looking into key application settings, we find potential credentials:

Additionally, another configuration file linked to Asterisk contains database credentials:

Extracted credentials—💰 Jackpot!

Sadly, no instant root access. I continued exploring for privilege escalation paths—our journey is far from over! 🔥

Checking sudo privileges:

Observation:

🎯 Bingo! The asterisk user can execute /usr/bin/fail2ban-client as root without a password.

By modifying fail2ban’s SSH action, we introduce a SUID backdoor:

Verifying changes:

Executing /bin/bash -p now elevates us to root. 🚀 Now, let’s take the throne!

Conclusion 🏁

This exercise highlights the real-world attack chain used to compromise a vulnerable system.

Final words? Stay sharp, keep hacking, and always test your defenses! ⚔️🔥

Happy hacking, fellow pirates! 🏴‍☠️💻

Last updated