Detection rule
HackTool - Bloodhound/Sharphound Execution
Overview
Detects command line parameters used by Bloodhound and Sharphound hack tools
- Rule id
f376c8a7-a2d0-4ddc-aa0c-16c17236d962- ATT&CK techniques
- T1059.001 Command and Scripting Interpreter: PowerShell, T1069.001 Permission Groups Discovery: Local Groups, T1069.002 Permission Groups Discovery: Domain Groups, T1087.001 Account Discovery: Local Account, T1087.002 Account Discovery: Domain Account, T1482 Domain Trust Discovery
- Severity
- High
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- n0n, The Gentlemen, qilin, INC Ransom, Akira, safepay, rhysida, Play, nightspire, majinahanashi
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
3 of 3 positive test events matched; 1 of 1 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · f376c8a7-a2d0-4ddc-aa0c-16c17236d962
title: HackTool - Bloodhound/Sharphound Execution
id: f376c8a7-a2d0-4ddc-aa0c-16c17236d962
status: test
description: Detects command line parameters used by Bloodhound and Sharphound hack tools
references:
- https://github.com/BloodHoundAD/BloodHound
- https://github.com/BloodHoundAD/SharpHound
author: Florian Roth (Nextron Systems)
date: 2019-12-20
modified: 2023-02-04
tags:
- attack.discovery
- attack.t1087.001
- attack.t1087.002
- attack.t1482
- attack.t1069.001
- attack.t1069.002
- attack.execution
- attack.t1059.001
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Product|contains: 'SharpHound'
- Description|contains: 'SharpHound'
- Company|contains:
- 'SpecterOps'
- 'evil corp'
- Image|contains:
- '\Bloodhound.exe'
- '\SharpHound.exe'
selection_cli_1:
CommandLine|contains:
- ' -CollectionMethod All '
- ' --CollectionMethods Session '
- ' --Loop --Loopduration '
- ' --PortScanTimeout '
- '.exe -c All -d '
- 'Invoke-Bloodhound'
- 'Get-BloodHoundData'
selection_cli_2:
CommandLine|contains|all:
- ' -JsonFolder '
- ' -ZipFileName '
selection_cli_3:
CommandLine|contains|all:
- ' DCOnly '
- ' --NoSaveCache '
condition: 1 of selection_*
falsepositives:
- Other programs that use these command line option and accepts an 'All' parameter
level: high
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_hktl_bloodhound_sharphound/info.ymlQRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: HackTool - Bloodhound/Sharphound Execution- Rule type
- Event rule (Local)
- Log source types
- Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
Building blocks
BB:OffSet7:HackTool Bloodhound Sharphound Execution:selection_img(match)Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.- custom property needed:
Productcontains:SharpHoundNo QRadar property mapped for "Product": create a custom event property (regex or JSON) on the DSM first. - custom property needed:
Descriptioncontains:SharpHoundNo QRadar property mapped for "Description": create a custom event property (regex or JSON) on the DSM first. - custom property needed:
Companycontains:SpecterOps,evil corpNo QRadar property mapped for "Company": create a custom event property (regex or JSON) on the DSM first. Process Path / Process Namecontains:\Bloodhound.exe,\SharpHound.exe
- custom property needed:
BB:OffSet7:HackTool Bloodhound Sharphound Execution:selection_cli_1(match)All test lines must match (AND).Commandcontains:-CollectionMethod All,--CollectionMethods Session,--Loop --Loopduration,--PortScanTimeout,.exe -c All -d,Invoke-Bloodhound,Get-BloodHoundData
BB:OffSet7:HackTool Bloodhound Sharphound Execution:selection_cli_2(match)All test lines must match (AND).Commandcontains:-JsonFolder,-ZipFileName
BB:OffSet7:HackTool Bloodhound Sharphound Execution:selection_cli_3(match)All test lines must match (AND).Commandcontains:DCOnly,--NoSaveCache
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1 - when an event matches the condition built from these building blocks:
(ANY of [BB:OffSet7:HackTool Bloodhound Sharphound Execution:selection_img, BB:OffSet7:HackTool Bloodhound Sharphound Execution:selection_cli_1, BB:OffSet7:HackTool Bloodhound Sharphound Execution:selection_cli_2, BB:OffSet7:HackTool Bloodhound Sharphound Execution:selection_cli_3])
Main rule, option B (AQL filter test)
Not available: the AQL conversion failed for this rule.
Rule response
- Severity 7, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)
Limitations
- AQL conversion failed (field 'Product' is not supported); only the building-block design is available.
- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
Product="*SharpHound*" OR Description="*SharpHound*" OR Company IN ("*SpecterOps*", "*evil corp*") OR Image IN ("*\\Bloodhound.exe*", "*\\SharpHound.exe*") OR CommandLine IN ("* -CollectionMethod All *", "* --CollectionMethods Session *", "* --Loop --Loopduration *", "* --PortScanTimeout *", "*.exe -c All -d *", "*Invoke-Bloodhound*", "*Get-BloodHoundData*") OR (CommandLine="* -JsonFolder *" CommandLine="* -ZipFileName *") OR (CommandLine="* DCOnly *" CommandLine="* --NoSaveCache *")Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[HackTool - Bloodhound/Sharphound Execution]
description = Detects command line parameters used by Bloodhound and Sharphound hack tools
search = Product="*SharpHound*" OR Description="*SharpHound*" OR Company IN ("*SpecterOps*", "*evil corp*") OR Image IN ("*\\Bloodhound.exe*", "*\\SharpHound.exe*") OR CommandLine IN ("* -CollectionMethod All *", "* --CollectionMethods Session *", "* --Loop --Loopduration *", "* --PortScanTimeout *", "*.exe -c All -d *", "*Invoke-Bloodhound*", "*Get-BloodHoundData*") OR (CommandLine="* -JsonFolder *" CommandLine="* -ZipFileName *") OR (CommandLine="* DCOnly *" CommandLine="* --NoSaveCache *")Microsoft Sentinel
Microsoft Sentinel KQL (ASIM)Hunting query
Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.
imProcessCreate
| where (TargetProcessFileProduct contains "SharpHound" or TargetProcessFileDescription contains "SharpHound" or (TargetProcessFileCompany contains "SpecterOps" or TargetProcessFileCompany contains "evil corp") or (TargetProcessName contains "\\Bloodhound.exe" or TargetProcessName contains "\\SharpHound.exe")) or (TargetProcessCommandLine contains " -CollectionMethod All " or TargetProcessCommandLine contains " --CollectionMethods Session " or TargetProcessCommandLine contains " --Loop --Loopduration " or TargetProcessCommandLine contains " --PortScanTimeout " or TargetProcessCommandLine contains ".exe -c All -d " or TargetProcessCommandLine contains "Invoke-Bloodhound" or TargetProcessCommandLine contains "Get-BloodHoundData") or (TargetProcessCommandLine contains " -JsonFolder " and TargetProcessCommandLine contains " -ZipFileName ") or (TargetProcessCommandLine contains " DCOnly " and TargetProcessCommandLine contains " --NoSaveCache ")Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceProcessEvents
| where (ProcessVersionInfoProductName contains "SharpHound" or ProcessVersionInfoFileDescription contains "SharpHound" or (ProcessVersionInfoCompanyName contains "SpecterOps" or ProcessVersionInfoCompanyName contains "evil corp") or (FolderPath contains "\\Bloodhound.exe" or FolderPath contains "\\SharpHound.exe")) or (ProcessCommandLine contains " -CollectionMethod All " or ProcessCommandLine contains " --CollectionMethods Session " or ProcessCommandLine contains " --Loop --Loopduration " or ProcessCommandLine contains " --PortScanTimeout " or ProcessCommandLine contains ".exe -c All -d " or ProcessCommandLine contains "Invoke-Bloodhound" or ProcessCommandLine contains "Get-BloodHoundData") or (ProcessCommandLine contains " -JsonFolder " and ProcessCommandLine contains " -ZipFileName ") or (ProcessCommandLine contains " DCOnly " and ProcessCommandLine contains " --NoSaveCache ")Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
(process.pe.product:*SharpHound* OR process.pe.description:*SharpHound* OR (process.pe.company:(*SpecterOps* OR *evil\ corp*)) OR (process.executable:(*\\Bloodhound.exe* OR *\\SharpHound.exe*))) OR (process.command_line:(*\ \-CollectionMethod\ All\ * OR *\ \-\-CollectionMethods\ Session\ * OR *\ \-\-Loop\ \-\-Loopduration\ * OR *\ \-\-PortScanTimeout\ * OR *.exe\ \-c\ All\ \-d\ * OR *Invoke\-Bloodhound* OR *Get\-BloodHoundData*)) OR (process.command_line:*\ \-JsonFolder\ * AND process.command_line:*\ \-ZipFileName\ *) OR (process.command_line:*\ DCOnly\ * AND process.command_line:*\ \-\-NoSaveCache\ *)Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where (process.pe.product:"*SharpHound*" or process.pe.description:"*SharpHound*" or (process.pe.company like~ ("*SpecterOps*", "*evil corp*")) or (process.executable like~ ("*\\Bloodhound.exe*", "*\\SharpHound.exe*"))) or (process.command_line like~ ("* -CollectionMethod All *", "* --CollectionMethods Session *", "* --Loop --Loopduration *", "* --PortScanTimeout *", "*.exe -c All -d *", "*Invoke-Bloodhound*", "*Get-BloodHoundData*")) or (process.command_line:"* -JsonFolder *" and process.command_line:"* -ZipFileName *") or (process.command_line:"* DCOnly *" and process.command_line:"* --NoSaveCache *")Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where process.pe.product like "*SharpHound*" or process.pe.description like "*SharpHound*" or process.pe.company like "*SpecterOps*" or process.pe.company like "*evil corp*" or process.executable like "*\\\\Bloodhound.exe*" or process.executable like "*\\\\SharpHound.exe*" or process.command_line like "* -CollectionMethod All *" or process.command_line like "* --CollectionMethods Session *" or process.command_line like "* --Loop --Loopduration *" or process.command_line like "* --PortScanTimeout *" or process.command_line like "*.exe -c All -d *" or process.command_line like "*Invoke-Bloodhound*" or process.command_line like "*Get-BloodHoundData*" or process.command_line like "* -JsonFolder *" and process.command_line like "* -ZipFileName *" or process.command_line like "* DCOnly *" and process.command_line like "* --NoSaveCache *"No working conversion: IBM QRadar AQL (hunting query) (QRadar AQL backend has no property mapping for field "Product")
Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineCompanyDescriptionImageProduct
False positives
- Other programs that use these command line option and accepts an 'All' parameter
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
References
Author and attribution
- Author
- Florian Roth (Nextron Systems)
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_hktl_bloodhound_sharphound.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2