百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

BloodHound-Owned

> 编程语言
开源

包含用于在 BloodHound 中添加和利用自定义属性的文件集合。

185 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

包含用于在 BloodHound 中添加和利用自定义属性的文件集合。

BloodHound Owned

A collection of files for adding and leveraging custom properties in BloodHound. A thorough overview of the ideas that led to these Custom Queries & Ruby script can be found in this blog post: http://porterhau5.com/blog/extending-bloodhound-track-and-visualize-your-compromise/

These are intended, although not required, to be used with a forked version of BloodHound found here: https://github.com/porterhau5/BloodHound

Files in the example-files directory can be used with the Ruby script and the BloodHoundExampleDB.graphdb for demonstration or development purposes. Usage examples are shown below.

Quickstart

Using these requires Neo4j, a populated database, and a BloodHound app.

The Ruby script (bh-owned.rb) and custom queries (customqueries.json) can be used with the official BloodHound app. However, the UI customizations are currently only available in the customized app found in this forked BloodHound repo.

Current UI customizations include:

  • Node highlighting
  • Custom properties displayed on Node Info tab
  • Run custom queries from Node Info tab
  • Adding or removing nodes from blacklist via tooltip
  • Marking or unmarking nodes as owned via tooltip

If you'd like to try out the features added in the customized BloodHound app, then either download a pre-compiled binary here or build the app from source. If building from source, then follow the official BloodHound install directions but substitute the forked repo URL (https://github.com/porterhau5/BloodHound) for the official repo URL in step 2 (cloning the repository). The building instructions are on BloodHound's wiki.

To use the custom queries, first copy the customqueries.json file to the Electron project's home folder:

  • Windows: ~\AppData\Roaming\bloodhound\
  • Mac: ~/Library/Application Support/bloodhound/
  • Linux: I'm not sure. If someone does this on Linux and figures this out then let me know.

Refresh or restart BloodHound for the changes to take effect. Custom Queries can be found in the Search Container (top-left) on the Queries tab underneath the Custom Queries header.

bh-owned.rb Usage

This script is the primary means for updating the Neo4j database to support the custom queries and UI enhancements.

…

It helps to create a few new indexes to help with query performance. This can be done using Neo4j's web browser or BloodHound's Raw Query feature (I recommend Neo4j's web browser for this):

CREATE INDEX ON :Group(wave)
CREATE INDEX ON :User(wave)
CREATE INDEX ON :Computer(wave)
CREATE INDEX ON :Group(blacklist)
CREATE INDEX ON :User(blacklist)
CREATE INDEX ON :Computer(blacklist)
Owned/Wave

Data is ingested using the script's -a flag with a file passed as an argument. Files should be in CSV format with the name of the compromised node first, followed by the method of compromise. If no method of compromise is provided then it will default to "Not specified" (these files can be found in the example-files dir):

$ cat 1st-wave.txt
[email protected],LLMNR wpad
[email protected],NBNS wpad

$ ruby bh-owned.rb -a 1st-wave.txt
[*] Using default username: neo4j
[*] Using default password: BloodHound
[*] Using default URL: http://127.0.0.1:7474/
[*] No previously owned nodes found, setting wave to 1
[+] Success, marked '[email protected]' as owned in wave '1' via 'LLMNR wpad'
[+] Success, marked '[email protected]' as owned in wave '1' via 'NBNS wpad'
[*] Finding spread of compromise for wave 1
[+] 2 nodes found:
DOMAIN [email protected]
SYSTEM38.INTERNAL.LOCAL

The script will first query the database and determine the latest wave added. It then increments it by one so that the incoming additions will be in the new wave. You can override this behavior by setting the -w flag to the preferred wave value.

Once the wave number is determined, the script takes the following steps:

  • Creates the Cypher queries to add the nodes
  • Creates the Cypher query to find the spread of compromise for the new wave
  • Wraps it all in JSON
  • POSTs the request to the REST endpoint

Until more options and error-checking is thrown in, each wave should be added separately:

…

The -A flag will skip the wave process entirely. This is useful if you just want to mark nodes as owned and move on:

$ cat example-files/owned-no-wave.txt 
[email protected],Social engineered
[email protected]
[email protected],Phish
$ ruby bh-owned.rb -A example-files/owned-no-wave.txt 
[*] Using default username: neo4j
[*] Using default password: BloodHound
[*] Using default URL: http://127.0.0.1:7474/
[+] Success, marked '[email protected]' as owned via 'Social engineered'
[+] Success, marked '[email protected]' as owned via 'Not specified'
[+] Success, marked '[email protected]' as owned via 'Phish'
SharesPasswordWith

Use -s to add a file containing a list of nodes with the same password. This will create a new relationship, "SharesPasswordWith", between each node in the list. Useful for representing Computers with a common local admin password, or Users that use the same password for multiple accounts:

…

Blacklisting

Specific nodes or relationships can be added to the blacklist. For adding nodes, put the name of each node in a newline-delimited file and add it using the -b flag. Note that blacklist features are only compatible with the custom queries:

$ cat blacklist-nodes.txt
MANAGEMENT3.INTERNAL.LOCAL
[email protected]
[email protected]
DESKTOP20.EXTERNAL.LOCAL

ruby bh-owned.rb -b blacklist-nodes.txt
[*] Using default username: neo4j
[*] Using default password: BloodHound
[*] Using default URL: http://127.0.0.1:7474/
[+] Success, marked 'MANAGEMENT3.INTERNAL.LOCAL' as blacklisted
[+] Success, marked '[email protected]' as blacklisted
[+] Success, marked '[email protected]' as blacklisted
[+] Success, marked 'DESKTOP20.EXTERNAL.LOCAL' as blacklisted

Relationships are added to the blacklist by specifying the start node and end node for the desired relationship. Each relationship should be in CSV format with the start node first, relationship second, and end node last, with one path per line. They are added to the blacklist using the -B flag:

$ cat blacklist-rels.txt
[email protected],AdminTo,MANAGEMENT3.INTERNAL.LOCAL
DESKTOP21.EXTERNAL.LOCAL,HasSession,[email protected]

$ ruby bh-owned.rb -B blacklist-rels.txt
[*] Using default username: neo4j
[*] Using default password: BloodHound
[*] Using default URL: http://127.0.0.1:7474/
[+] Success, marked 'AdminTo' as blacklisted from '[email protected]' to 'MANAGEMENT3.INTERNAL.LOCAL'
[+] Success, marked 'HasSession' as blacklisted from 'DESKTOP21.EXTERNAL.LOCAL' to '[email protected]'

Nodes are removed from the blacklist in the same manner they are added, but use the -r flag. Use -R to remove relationships from the blacklist:

…
Miscellaneous options

The -n flag can be used to dump the names of all nodes from the database:

$ ruby bh-owned.rb -n
[*] Using default username: neo4j
[*] Using default password: BloodHound
[*] Using default URL: http://127.0.0.1:7474/
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

The -e flag can be used to show examples of Cypher queries leveraging the custom properties. The juicy ones have been rolled up into the 'Custom Queries' available in the app:

…

If you want to start over and remove any custom properties & relationships from your database nodes, use --reset:

$ ruby bh-owned.rb --reset
[*] Using default username: neo4j
[*] Using default password: BloodHound
[*] Using default URL: http://127.0.0.1:7474/
[*] Removing all custom properties and SharesPasswordWith relationships

Custom Queries

There are the current custom queries in this set:

  • Find all owned Domain Admins: Same as the "Find all Domain Admins" query, but instead only show Users with owned property.
  • Find Shortest Paths from owned node to Domain Admins: Same as the "Find Shortest Paths to Domain Admins" query, but instead only show paths originating from an owned node.
  • Show wave: Show only the nodes compromised in a selected wave. Useful for focusing in on newly-compromised nodes.
  • Highlight delta for wave: Show all compromised nodes up to a selected wave, and will highlight the nodes gained in that wave. Useful for visualizing privilege gains as access expands.
  • Find clusters of password reuse: Show all nodes with a SharesPasswordWith relationship to another node.
  • Show blacklisted nodes: Show all nodes with the blacklist property set.
  • Show blacklisted relationships: Show all relationships (and their start and end node) with the blacklist property set.
  • Show blacklist: Show all nodes and relationships with the blacklist property set.
  • Show owned nodes: Show all nodes with the owned property set.

All queries (except for the blacklist-specific queries) will filter out nodes & relationships from the blacklist.

Check out the "UI Customizations and Custom Queries" section of the blog post to see examples of these custom queries in action.

Known Issues and Future Development

  • Add additional queries to pull specific nodes from database and write to output file
  • Showing deltas for large waves can be stressful on the UI, should add ability to LIMIT results to a user-defined threshold
  • General HTTP error-checking
  • More, broader ideas here

Acknowledgements

hackerjiv and pfizzell for the sound advice and feedback. CptJesus, _wald0, and harmj0y for making a tremendous platform.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言