Skip to main content

Bloodhound Usage

 

 

BloodHound-Python
If you have access to DC, need admin creds - Github

Linux:


proxychains python3 bloodhound.py -d Steins.local -u admin -p p@$$W0rd! -c all -dc dc.steins.local -gc dc.steins.local -v -ns 10.10.10.10 --dns-tcp

Few files will appear in the same location, import them into bloodhound

Kali: apt-get install bloodhound
sudo neo4j console
go to localhost:7474
neo4j: neo4j #login in browser and change the password

bloodhound #bloodhoun login will pop-up, login with new creds

Windows:


Download this on Windows target: SharpHound.ps1


powershell -ep bypass
..\SharpHound.ps1
invoke-Bloodhound -CollectionMethod All -Domain Steins.local -ZipfileName file.zip

invoke-Bloodhound -CollectionMethod LoggedOn -Verbose

or

SharpHound.exe -c All -d Steins.local --zipfilename test.zip

OR
.\SharpHound.exe -d steins.local --domaincontroller 192.168.168.168 --ldapusername admin --ldappassword P@$$W0rd! --zipfilename domain.zip - c All

open the file in bloodhound --> click on upload --> select file


For Testing:

git clone https://github.com/BloodHoundAD/BloodHound-Tools
cd DBCreator
pip install neo4j-driver
sudo pip3 install neo4j
python3 DBCreator.py
sudo neo4j console
dbconfig

Invoke-BloodHound Commands 

#specify detailed collection methods
Invoke-BloodHound -CollectionMethod ACL,ObjectProps

#Change the frequency of the requests sent by BloodHound
Invoke-BloodHound -Throttle 1500 -Jitter 10

#increase the stealthiness of theBloodHound ingestor is to minimize its disk footprint.
Invoke-BloodHound -CompressData -RemoveCSV and –NoSaveCache
Bloodhound Ingestor - Linux/Python 

git clone https://github.com/dirkjanm/BloodHound.py
pip install
bloodhound-python -u UserName -p "P@SSW)RD!" -d steins.local -ns 10.10.10.10 -c All
Bloodhound Rust Ingestor 

git clone https://github.com/NH-RED-TEAM/RustHound.git

#install cargo
curl https://sh.rustup.rs -sSf | sh
. "$HOME/.cargo/env" 

#Compile RustHound
make install

#Run it 
rusthound -d domain.local -i 10.10.10.10 -u 'username@domain.local' -p 'P@ssw0rd!' -o . -z

# Kerberos authentication (Linux)
export KRB5CCNAME="/tmp/Username.ccache"
rusthound -d domain.local -f dc01.domain.local -k -z

Custom Queries

#Find AllowedToAct|AllowedToDelegate Permissions 
MATCH p=(n)-[r:AllowedToAct|AllowedToDelegate]->(m) RETURN p

#Find Accounts Trusted for Delegation
MATCH (n)-[r:TrustedForDelegation]->(m) RETURN n, r, m

#Find RBAC Paths
MATCH p=(n)-[r:AllowedToAct|AllowedToDelegate]->(m) RETURN p

#Find Accounts with SPN That allows Delegation
MATCH (n)-[r:HasSPN]->(m) WHERE n.TrustedToAuthForDelegation = True RETURN n, r, m
Custom Commands

Click on custom queries and edit the json file, we can add as many queries as required

Example 1

{
"name": "CUSTOM",
"queryList": [
{
"final": true,
"query": "MATCH (n:User) RETURN n"
}
]
}

List all Domain Admins


{
"name": "CUSTOM",
"queryList": [
{
"final": true,
"query": "MATCH (n:Group) WHERE n.name =~ \"(?i).*DOMAIN ADMINS.*\" WITH n MATCH (n)<-[r:MemberOf*1..]-(m) RETURN n,r,m"
}
]
}
 
Display all the users that are part of administrators group
{
"name": "CUSTOM",
"queryList": [
{
"final": true,
"query": "MATCH (u:User)-[MemberOf]->(g:Group {name: \"ADMINISTRATORS@ELS-CHILD.ELS.LOCAL\"}) RETURN u"
}
]
},

 

 

 

 

 

 

Comments

Popular posts from this blog

SQL DB & SQL Injection Pentest Cheat Sheet

1) MSSQL Injection Cheat Sheet | pentestmonkey 2) xp_cmdshell | Red Team tales 3) PentesterMonkey SQL Injection Cheatsheet Use dbeaver for GUI Access 4) SQL Injection Explanation | Graceful Security Common Ports Microsoft SQL: 1433/TCP (default listener) 1434/UDP (browser service) 4022/TCP (service broker) 5022/TCP (AlwaysOn High Availability default) 135/TCP (Transaction SQL Debugger) 2383/TCP (Analysis Services) 2382/TCP (SQL Server Browser Service) 500,4500/UDP (IPSec) 137-138/UDP (NetBios / CIFS) 139/TCP (NetBios CIFS) 445/TCP (CIFS) Oracle SQL: 1521/TCP 1630/TCP 3938/HTTP MongoDB : 27017,27018,27019/TCP PostgreSQL: 8432/TCP MySQL: 3306/TCP SQL DB Enum with nmap: nmap -p 1433 —script ms-sql-info —script-args mssql.instance-port=1433 IP_ADDRESS nmap -Pn -n -sS —script=ms-sql-xp-cmdshell.nse IP_ADDRESS -p1433 —script-args mssql.username=sa,mssql.password=password,ms-sql-xp-cmdshell.cmd="net user bhanu bhanu123 /add" nmap -Pn -n -sS —script=ms-sql-xp-cmds...

Host and Application locally and access it over the internet via ngrock

 ngrock creates a tunnel from your local machine to ngrock server and host it on the internet via their HTTPS url  Resister an account on ngrock and login #Download the client curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \ | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \ && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \ | sudo tee /etc/apt/sources.list.d/ngrok.list \ && sudo apt update \ && sudo apt install ngrok #add the authToken ngrok config add-authtoken 2p7Oc #start a python server on your application python -m http.server 3000 #start the server - use the same port as the python server (3000 in below example) ngrok http http://localhost:3000 --request-header-add "ngrok-skip-browser-warning: true" Setting up a Request Header - Login to the application --> Univeral Gateway --> Edges - Create an Edge --> Request Headers --> `ngrok-skip-browser-warning :12 - go back to overv...

Cloud Pentest Cheatsheet - Azure

Azure Cloud offers a comprehensive ecosystem of tools and services. Among its core components are: Azure Active Directory (AAD) Azure Resource Manager (ARM) Office 365 (O365) Initial Access Try to get a user credential via OSINT/Social engineering or try to comprise a web application hosted on Azure VM. Enumerate the roles attached to the VM and try to escalate your privileges.  Entra ID Directory Role Entra ID directory roles are predefined roles that grant permissions to perform specific tasks within an Azure AD tenant. These roles are essential for managing administrative tasks in Entra ID. Types of Roles: Built-in Directory Roles Global Administrator Application Administrator User Administrator Custom Directory Roles Accessing APIs in Azure Entra ID - Access via Microsoft Graph API Endpoint {HTTP method} https://graph.microsoft.com/{version}/{resource}?{query-parameters} Azure Resource Manager API Endpoint (ARM-specific) {HTTP method} https://management.azure.com/{...