PISA Pakistan — Community CERT

← ⚙️ SOC Analyst Foundations

37. Active Directory Threat Hunting with BloodHound and Neo4j

⏱ 8 min

Introduction

Active Directory (AD) is the backbone of identity and access for most Pakistani enterprises, from federal ministries to private banks. Attackers who compromise a single workstation often escalate to Domain Admin by abusing AD misconfigurations. BloodHound and Neo4j give SOC analysts a graph‑based view of trust relationships, exposing the shortest paths an adversary can take. If you uncover a compromise, report it immediately to the NCCIA cybercrime helpline 1799.

BloodHound Basics

  • Install BloodHound (the GUI) and the Neo4j graph database on a dedicated analyst workstation.
  • Run SharpHound (the data collector) on a domain‑joined endpoint to harvest AD objects, ACLs, and group memberships.
  • Import the JSON output into Neo4j using BloodHound’s "Upload Data" button.
  • Key queries to start: Shortest Path to Domain Admins, Find Servers with Unconstrained Delegation, and Identify Users with DCSync Rights.

Hunting Realistic Attack Paths

A common scenario in Pakistani government networks: a phishing email delivers a macro‑enabled Word doc to an accountant. The macro runs PowerShell to invoke Mimikatz, dumping credentials. With those credentials, the attacker can move laterally to a file server that has Unconstrained Delegation. BloodHound shows this path in seconds, letting you intervene before Domain Admin is reached.

Detecting SharpHound Activity

  • SharpHound generates Windows Event ID 4672 (Special Privileges Assigned) and 4624 (Account Logon) with unusual source IP.
  • Deploy a Sigma rule:
    title: SharpHound Enumeration Detected
    logsource: windows security
    detection:
      eventid: 4672
      subject: *\SharpHound*
    condition: eventid == 4672 and subject contains "SharpHound"
    
  • Correlate with MISP sightings of the same user account to prioritize alerts.

Do / Don't

  • Do schedule weekly BloodHound ingestions and review the "Shortest Path to Domain Admins" query.
  • Don't ignore stale computer accounts; attackers use them as persistence vectors.

Takeaway

Run a Shortest Path to Domain Admins query today in BloodHound and document any exposed paths for remediation.

← PrevNext →