BloodHound — Saldiri Yolu Analizi (Edge to Exploit Haritalama)
BloodHound CE/legacy kurulumu, bloodhound-python ve SharpHound ile veri toplama, ve toplanan grafikteki HER kenarin (GenericAll, WriteDacl, AllowedToAct, ReadLAPSPassword vb.) somut istismar tekniğine eslenmesi ile Domain Admins'e en kisa yolun bulunmasi.
- En az bir gecerli domain hesabi (USER + PASS veya NTHASH veya Kerberos TGT)
- Docker veya neo4j + Java kurulumu (BloodHound CE icin)
- DC'ye LDAP/SMB erisimi
Komutlar
curl -L https://ghst.ly/getbhce -o docker-compose.yml && docker compose up -d sudo neo4j start && bloodhound --no-sandbox bloodhound-python -c All -u '{{USER}}' -p '{{PASS}}' -d {{DOMAIN}} -ns {{DC_IP}} --zip bloodhound-python -c All,LoggedOn -u '{{USER}}' -p '{{PASS}}' -d {{DOMAIN}} -ns {{DC_IP}} -dc {{DC_HOST}} --kerberos bloodhound-python -c All -u '{{USER}}' --hashes :{{NTHASH}} -d {{DOMAIN}} -ns {{DC_IP}} --zip SharpHound.exe -c All --zipfilename loot SharpHound.exe -c DCOnly --ldapusername '{{USER}}' --ldappassword '{{PASS}}' SharpHound.exe -c All,LoggedOn -d {{DOMAIN}} --domaincontroller {{DC_IP}} --collectionmethod Session,ACL nxc ldap {{DC_IP}} -u '{{USER}}' -p '{{PASS}}' --bloodhound -c All --dns-server {{DC_IP}} MATCH p=shortestPath((u:User {owned:true})-[*1..]->(g:Group {name:'DOMAIN ADMINS@{{DOMAIN}}'})) RETURN p MATCH (u:User)-[r:GenericAll|GenericWrite|WriteDacl|WriteOwner|Owns]->(t) WHERE u.owned=true RETURN u,r,t MATCH (c:Computer) WHERE c.unconstraineddelegation=true RETURN c.name Amac
BloodHound, AD’yi bir graf olarak modeller: dugumler (User, Computer, Group, GPO, OU, Domain) ve kenarlar (iliskiler). Bir saldirgan icin deger, sahip olunan dusuk yetkili bir principal’dan Domain Admins’e giden en kisa yolu ve her adimdaki somut istismari gormektir.
Kurulum
BloodHound CE (guncel, onerilen): curl -L https://ghst.ly/getbhce -o docker-compose.yml && docker compose up -d. UI 8080’de, Postgres+neo4j konteynerde. Ilk parolayi konteyner loglarindan al.
Legacy: neo4j servisini (bolt 7687, http 7474) baslatip Electron GUI’yi acarsiniz. CE, SharpHound/bhce-python JSON formatini bekler; legacy ile zip formatlari %100 uyumlu olmayabilir — toplayiciyi BloodHound surumune esle.
Toplama (Collection)
- Linux:
bloodhound-python -c All(LDAP+SMB).LoggedOnicin host’lara erisim sart, gurultu uretir. - Windows:
SharpHound.exe -c All. Stealth icin-c DCOnly(sadece LDAP, hicbir host’a oturum sorgusu yok). - Kerberos:
--kerberosileKRB5CCNAMEbileti kullanilir; saat skew’i 5 dk’yi gecmemeli.
Kenar -> Istismar Eslemesi (Kritik Tablo)
| Kenar (Edge) | Anlam | Istismar |
|---|---|---|
| GenericAll (user) | Nesne uzerinde tam kontrol | ForceChangePassword veya targeted Kerberoast (SPN ekle) |
| GenericAll (computer) | Tam kontrol | RBCD kur (msDS-AllowedToActOnBehalfOfOtherIdentity) veya LAPS oku |
| GenericAll (group) | Tam kontrol | Gruba kendini ekle (AddMember) |
| GenericWrite | Belirli nitelik yazma | targeted Kerberoast (servicePrincipalName yaz) / logon script |
| WriteDacl | DACL degistirme | Kendine GenericAll/DCSync ekle (aclpwn/dacledit) |
| WriteOwner | Sahip degistirme | Sahibi yap -> WriteDacl -> tam kontrol |
| Owns | Nesne sahibi | WriteOwner gibi DACL’i degistir |
| AddMember | Gruba uye ekleme | Yuksek yetkili gruba katil |
| ForceChangePassword | Parola sifirlama | Hedefin parolasini degistir, hesabini ele gecir |
| AllowedToDelegate (constrained) | KCD | S4U2Proxy ile hedef SPN’e impersonate |
| AllowedToAct (RBCD) | Resource-based KCD | S4U ile bilgisayara Administrator olarak gel |
| ReadLAPSPassword | ms-Mcs-AdmPwd oku | Yerel admin parolasini oku (bkz. ad-laps) |
| ReadGMSAPassword | gMSA parola blob | gMSA NT hash’ini cek (gMSADumper) |
| CanPSRemote | PSRemoting | evil-winrm/Enter-PSSession ile shell |
| AdminTo | Yerel admin | PtH/PsExec ile SYSTEM, LSASS dump |
| HasSession | Aktif oturum | Host’u ele gecirip token/cred calma |
| DCSync (GetChanges) | Replikasyon hakki | secretsdump ile tum NTDS hash’leri |
Ozel Cypher Sorgulari
shortestPath ile owned:true principal’dan DOMAIN ADMINS grubuna yol cek. Owned isaretlemek icin UI’da node’a sag tikla -> Mark as Owned. Toplu ACL avi icin yukaridaki GenericAll|GenericWrite|WriteDacl|... sorgusu sahip olunan hesabin tum dogrudan istismarlarini tek seferde verir.
Gotchalar
--dns-server/-nsDC IP’sine isaret etmezse bloodhound-python isim cozumleyemez ve toplama bos doner.- CE ve legacy JSON semasi farkli: yanlis toplayici -> bos graf. Toplayici surumunu BloodHound surumune esle.
- SharpHound
Sessiontoplamasi anliktir; kullanici cikis yaptiysa kacirilir, tekrarli toplama gerekebilir.