rule_inventory · jdarmy, sharphound — Claude Code rule: what it does, how to install
A rule file that gives the agent an inventory of SharpHound detections: three YARA rules, one Sigma rule, pattern tables and a difficulty rating for each.
MIT ★ 336 updated 2026-04-09
.claude/rules/rule_inventory.mdWhat rule_inventory does
The file sits at .claude/rules/rule_inventory.md and acts as a reference sheet the agent can reason over. It gathers what catches SharpHound: three YARA rules from Elastic Security, st-mn and Telsy, plus one Sigma rule from SigmaHQ.
Each rule gets its own table. You'll find TypeLib GUIDs, constants pulled from log output, command-line flags such as -CollectionMethod All and --Loop --Loopduration, output names like _computers.json, and the PowerShell wrapper Invoke-BloodHound. The Sigma entry breaks into four selection blocks, and two of them only fire when every listed string appears at once.
The risk table is the part worth reading twice: assembly metadata, the binary name and both GUIDs are rated Easy, while string constants and CLI arguments land at Medium. Nothing here performs a scan. It is background material, and the agent does the rest.
What it helps with
- Trace which YARA rules cover SharpHound and the strings behind them
- Line up Sigma CommandLine selections with real flags
- Find the assembly fields (Product, Company) that trigger a match
- Check which output filenames the rules look for
- Group patterns by how hard they are to change
Example prompts for the agent
- Which YARA rules in
rule_inventory.mdcover SharpHound, and what do they match on? - List the CommandLine values the Sigma rule
proc_creation_win_hktl_bloodhound_sharphound.ymlchecks - Which patterns does the risk table rate Easy, and which Medium?
How to install rule_inventory
Manually: put the files in place
.claude/rules/rule_inventory.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/rule_inventory.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/rule_inventory.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/rule_inventory.mdManually: put the files in place
.clinerules/rule_inventory.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about rule_inventory
How do I install rule_inventory in Claude Code?
Copy the file to .claude/rules/rule_inventory.md in your project. That is the whole step.
What does rule_inventory do?
It hands the agent an inventory of SharpHound detections: three YARA rules, one Sigma rule, per-pattern tables and a difficulty rating.
Which detections does the inventory rate Easy?
Assembly metadata fields, the binary name and the two TypeLib GUIDs. The file marks each of those as a small change.
Source text
rule_inventory.md · MIT
# Rule Inventory for SharpHound
## Summary
| Type | Count | Sources |
|------|-------|---------|
| YARA | 3 | Elastic, st-mn, Telsy |
| Sigma | 1 | SigmaHQ |
| Network | 0 | - |
| Other | 0 | - |
## YARA Rules
| File | Author | Patterns | Target |
|------|--------|----------|--------|
| Windows_Hacktool_SharpHound_Elastic.yar | Elastic Security | 2 GUIDs, 3 strings | Binary |
| Tool_SharpHound_BloodHound_st-mn.yar | Threat Hunter | 4 strings | Binary |
| Bloodhound_SharpHound_PS_telsy.yar | Emanuele De Lucia | 3 strings | PowerShell |
### Detailed Pattern Analysis
#### Windows_Hacktool_SharpHound_Elastic.yar
| Pattern | Type | Detection |
|---------|------|-----------|
| $guid0 = "A517A8DE-5834-411D-ABDA-2D0E1766539C" | GUID | TypeLib GUID |
| $guid1 = "90A6822C-4336-433D-923F-F54CE66BA98F" | GUID | TypeLib GUID |
| $print_str0 = "Initializing SharpHound at {time} on {date}" | String | Log message |
| $print_str1 = "SharpHound completed {Number} loops!..." | String | Log message |
| $print_str2 = "[-] Removed DCOM Collection" | String | CLI output |
#### Tool_SharpHound_BloodHound_st-mn.yar
| Pattern | Type | Detection |
|---------|------|-----------|
| $s1 = "SharpHound" | String | Name |
| $s2 = "BloodHound" | String | Name |
| $s3 = "CollectionMethod" | String | CLI argument |
| $json = "_computers.json" | String | Output file |
#### Bloodhound_SharpHound_PS_telsy.yar
| Pattern | Type | Detection |
|---------|------|-----------|
| $s1 = "function Invoke-BloodHound" | String | PS function |
| $s2 = "Runs the BloodHound C# Ingestor..." | String | PS comment |
| $s3 = "$Assembly.GetType(\"Sharphound2.Sharphound\")..." | String | Reflection code |
## Sigma Rules
| File | Category | Detection |
|------|----------|-----------|
| proc_creation_win_hktl_bloodhound_sharphound.yml | process_creation | Image + CommandLine |
### Detailed Pattern Analysis
#### proc_creation_win_hktl_bloodhound_sharphound.yml
**Selection 1 - Image/Product/Description:**
| Field | Modifier | Value | Detection |
|-------|----------|-------|-----------|
| Product | contains | 'SharpHound' | Assembly metadata |
| Description | contains | 'SharpHound' | Assembly metadata |
| Company | contains | 'SpecterOps' | Assembly metadata |
| Company | contains | 'evil corp' | Assembly metadata |
| Image | contains | '\Bloodhound.exe' | Binary path |
| Image | contains | '\SharpHound.exe' | Binary path |
**Selection 2 - CommandLine:**
| Field | Modifier | Value | Detection |
|-------|----------|-------|-----------|
| CommandLine | contains | ' -CollectionMethod All ' | CLI argument |
| CommandLine | contains | ' --CollectionMethods Session ' | CLI argument |
| CommandLine | contains | ' --Loop --Loopduration ' | CLI argument |
| CommandLine | contains | ' --PortScanTimeout ' | CLI argument |
| CommandLine | contains | '.exe -c All -d ' | CLI pattern |
| CommandLine | contains | 'Invoke-Bloodhound' | PS function |
| CommandLine | contains | 'Get-BloodHoundData' | PS function |
**Selection 3 - CommandLine (all required):**
| Field | Modifier | Value | Detection |
|-------|----------|-------|-----------|
| CommandLine | contains | ' -JsonFolder ' | CLI argument |
| CommandLine | contains | ' -ZipFileName ' | CLI argument |
**Selection 4 - CommandLine (all required):**
| Field | Modifier | Value | Detection |
|-------|----------|-------|-----------|
| CommandLine | contains | ' DCOnly ' | CLI argument |
| CommandLine | contains | ' --NoSaveCache ' | CLI argument |
## Detection Risk Summary
| Detection Type | Patterns | Evasion Difficulty |
|----------------|----------|-------------------|
| Assembly Metadata | Product, Description, Company | Easy - Modify .csproj |
| Assembly Name | SharpHound.exe | Easy - Rename |
| TypeLib GUID | 2 GUIDs | Easy - Regenerate |
| String Constants | Multiple strings | Medium - Encrypt/obfuscate |
| CLI Arguments | Multiple patterns | Medium - Rename arguments |
| Output Files | *_computers.json | Medium - Change naming |
| PowerShell | Invoke-BloodHound | N/A - Separate wrapper |
## References
- https://github.com/BloodHoundAD/BloodHound
- https://github.com/BloodHoundAD/SharpHound
- https://github.com/SpecterOps/SharpHound
- https://bloodhound.specterops.io/
© JDArmy · MIT · JDArmy/Evasion-SubAgents
Similar IDE rules
All IDE rules for Security →rule_inventory by other authors comes first.