用于将 BloodHound "Legacy" 的自定义查询导入到 BloodHound "Community" 的工具。
注意:在 Linux/Kali 上,BloodHound Legacy 的 customqueries.json 文件位于 ~/.config/bloodhound/customqueries.json
example.env 文件复制为 .env,并填写所需的环境变量。pip3 install -r requirements.txt
该脚本使用以下环境变量,应设置在 .env 文件中(参见 example.env):
BHE_DOMAIN:BHE API 的域名。BHE_PORT:BHE API 的端口。BHE_SCHEME:BHE API 的方案(http 或 https)。BHE_TOKEN_KEY:BHE API 的令牌密钥。BHE_TOKEN_SECRET:BHE API 的令牌机密。更多详情请参阅:BloodHound API
python bh-toolset.py [-h] [-i [FILE]] [--new [NEW_FILE]] [--delete]
-h:显示帮助信息并退出。-i:从旧版格式导入 customqueries.json 文件。(默认:customqueries.json)。--new:导入已格式化为新版的自定义查询。(默认:new_customqueries.json)。--delete:删除所有已保存的查询。# 显示帮助
python3 bh-toolset.py -h
# 转换并导入来自 BloodHound Legacy 的自定义查询
python3 bh-toolset.py -i
# 同时导入已转换的自定义查询
python3 bh-toolset.py -i --new
# 指定自定义文件名
python3 bh-toolset.py -i my_customqueries.json --new my_new_customqueries.json
# 删除所有已保存的查询
python3 bh-toolset.py --delete
某些属性(如 owned 和 highvalue)在 BloodHound Community 中已发生变化。您需要手动修改它们(目前)。例如:
MATCH (m:User) WHERE m.owned=TRUE RETURN m 现在变为 MATCH (m:User) WHERE m.system_tags =~ '.*owned*.' RETURN mnew_customqueries.json