Skip to main content
rule CX Codex

behavior_analysis · jdarmy, sharphound — Claude Code rule: what it does, how to install

behavior_analysis — a rule file that tables how SharpHound gives itself away and what the doc suggests changing in the build, the flags and the output files.

MIT ★ 336 updated 2026-04-09

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/behavior_analysis.md
Open on GitHub

What behavior_analysis does

This rule maps how a SharpHound run gets noticed. Six tables cover process creation, network connections, file events, process access, registry keys and API call patterns. Every row carries the indicator, its value, the file and line it comes from, and a risk level.

Two more tables list detection-sensitive strings and the TypeLib GUIDs that YARA rules match. A summary counts entries per category, and the detection points are ranked in three tiers, with assembly metadata, the binary name and those GUIDs at the top. The file closes with six changes: .csproj metadata, the executable name, GUID regeneration, string obfuscation, argument renaming and output filename patterns.

Renaming command-line arguments is noted in the document as a hit to usability, so the trade-off is spelled out rather than hidden. The file goes to .claude/rules/behavior_analysis.md inside your project.

What it helps with

  • see which SharpHound artifacts trip detection first
  • check the risk level of an indicator before editing the build
  • trace an indicator back to its file and line in the source
  • draft a checklist of .csproj, binary and output-file edits
  • spot string constants that match YARA patterns

Example prompts for the agent

  • Walk the detection tables and list every high-risk SharpHound indicator.
  • Draft the .csproj and binary rename checklist from behavior_analysis.
  • Cross-check the project's string constants against the YARA patterns in the rule.

How to install behavior_analysis

Manually: put the files in place

.claude/rules/behavior_analysis.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about behavior_analysis

How do I install behavior_analysis in Claude Code?

Copy the rule file into your project at .claude/rules/behavior_analysis.md.

What does behavior_analysis do?

It tables the indicators that reveal a SharpHound run, with source locations and risk levels, then lists six build changes that reduce them.

Which indicators rank as critical?

Assembly metadata (Product, Description, Company), the executable name, and the TypeLib GUIDs embedded in the .NET assembly.

Source text

behavior_analysis.md · MIT
# Behavior Analysis: SharpHound

## Detection Categories

### 1. Process Creation

| Indicator | Value | Source Location | Detection Risk |
|-----------|-------|-----------------|----------------|
| Image | SharpHound.exe | Assembly name | High |
| Product | SharpHound | Assembly metadata | High |
| Description | SharpHound | Assembly metadata | High |
| Company | SpecterOps | Assembly metadata | High |
| CommandLine | -CollectionMethod | Options.cs:17 | High |
| CommandLine | --CollectionMethods | Options.cs:17 | High |
| CommandLine | --Loop | Options.cs:151 | Medium |
| CommandLine | --PortScanTimeout | Options.cs:113 | Medium |
| CommandLine | Invoke-BloodHound | PowerShell wrapper | High |

### 2. Network Connection

| Indicator | Value | Source Location | Detection Risk |
|-----------|-------|-----------------|----------------|
| DestinationPort | 389 (LDAP) | LDAP enumeration | Medium |
| DestinationPort | 636 (LDAPS) | LDAP SSL | Medium |
| DestinationPort | 445 (SMB) | Computer enumeration | Medium |
| DestinationPort | 135 (RPC) | Session enumeration | Medium |
| Protocol | LDAP | EnumerationDomain.cs | High |
| Protocol | SMB | ComputerFileProducer.cs | Medium |

### 3. File Event

| Indicator | Value | Source Location | Detection Risk |
|-----------|-------|-----------------|----------------|
| TargetFilename | *_computers.json | OutputWriter.cs | High |
| TargetFilename | *_users.json | OutputWriter.cs | High |
| TargetFilename | *_groups.json | OutputWriter.cs | High |
| TargetFilename | *_sessions.json | OutputWriter.cs | High |
| TargetFilename | *.zip (encrypted) | Options.cs:66 | Medium |
| TargetFilename | Cache file | Options.cs:48 | Medium |

### 4. Process Access

| Indicator | Value | Source Location | Detection Risk |
|-----------|-------|-----------------|----------------|
| API | NetSessionEnum | Session enumeration | High |
| API | NetWkstaUserEnum | Session enumeration | High |
| API | NetLocalGroupGetMembers | Local group enum | High |
| API | DsGetDomainControllerInfo | DC enumeration | Medium |
| API | LDAP search | EnumerationDomain.cs | Medium |

### 5. Registry

| Indicator | Value | Source Location | Detection Risk |
|-----------|-------|-----------------|----------------|
| Key | .NET Framework version check | Sharphound.cs:52 | Low |

### 6. API Usage Patterns

| API | Purpose | Source Location | Detection Risk |
|-----|---------|-----------------|----------------|
| System.DirectoryServices | LDAP queries | EnumerationDomain.cs | High |
| System.DirectoryServices.Protocols | LDAP operations | EnumerationDomain.cs | High |
| NetApi32 (NetSessionEnum) | Session enumeration | SharpHoundCommon | High |
| NetApi32 (NetWkstaUserEnum) | Workstation users | SharpHoundCommon | High |
| SAMR | Local group enumeration | SharpHoundCommon | Medium |
| LSA | Policy enumeration | SharpHoundCommon | Medium |

## String Constants Analysis

### Detection-Sensitive Strings

| String | Source Location | Detection Type | Risk |
|--------|-----------------|----------------|------|
| "SharpHound" | Multiple files | Name signature | Critical |
| "BloodHound" | Multiple files | Name signature | Critical |
| "CollectionMethod" | Options.cs:17 | CLI detection | High |
| "Initializing SharpHound" | Elastic YARA | String pattern | High |
| "SharpHound completed" | Elastic YARA | String pattern | High |
| "Removed DCOM Collection" | Options.cs:246 | String pattern | Medium |
| "_computers.json" | Output files | File pattern | High |
| "SpecterOps" | Assembly info | Company name | High |
| "Invoke-BloodHound" | PS wrapper | Function name | High |
| "Get-BloodHoundData" | PS wrapper | Function name | High |

### GUID Patterns

| GUID | Purpose | Detection |
|------|---------|-----------|
| A517A8DE-5834-411D-ABDA-2D0E1766539C | TypeLib GUID (YARA) | High |
| 90A6822C-4336-433D-923F-F54CE66BA98F | TypeLib GUID (YARA) | High |

## Risk Summary

| Category | Critical | High | Medium | Low |
|----------|----------|------|--------|-----|
| Process Creation | 0 | 6 | 2 | 0 |
| Network | 0 | 1 | 4 | 0 |
| File Event | 0 | 4 | 2 | 0 |
| Process Access | 0 | 3 | 2 | 0 |
| Strings | 2 | 6 | 1 | 0 |

## Detection Vectors

### Critical Detection Points
1. **Assembly Metadata** - Product, Description, Company names
2. **Binary Name** - SharpHound.exe
3. **GUIDs** - TypeLib GUIDs embedded in .NET assembly

### High Detection Points
1. **CLI Arguments** - CollectionMethod, Loop, etc.
2. **Output Files** - *_computers.json, *_groups.json, etc.
3. **API Calls** - NetSessionEnum, NetWkstaUserEnum
4. **String Constants** - "SharpHound", "BloodHound"

### Medium Detection Points
1. **Network Ports** - 389, 636, 445, 135
2. **File Patterns** - ZIP with password, cache files
3. **Function Names** - Get-BloodHoundData

## Recommendations for Evasion

1. **Assembly Metadata** - Modify Product, Description, Company in .csproj
2. **Assembly Name** - Rename executable
3. **GUIDs** - Regenerate TypeLib GUID in project
4. **String Constants** - Encrypt or obfuscate sensitive strings
5. **CLI Arguments** - Rename argument names (affects usability)
6. **Output Files** - Change naming pattern

© JDArmy · MIT · JDArmy/Evasion-SubAgents

Similar IDE rules

All IDE rules for Security →

behavior_analysis by other authors comes first.

behavior_analysis JDArmy behavior_analysis — a Claude Code rule that loads a structured behavioral profile of Stowaway into the agent context: CLI flags, protocol constants, build artifacts, and tiered detection indicators. CX Codex +1 ★ 336repo stars detection-engineer 0xSteph detection-engineer turns an attack technique into a detection rule you can load: Sigma, Splunk SPL, Elastic EQL, Sentinel Kusto, YARA. Includes tuning notes. CX Codex ★ 2,482repo stars 05-malware-analysis Masriyan 05-malware-analysis is a Claude Code skill that inspects suspicious files and writes YARA rules. It extracts PE imports and calculates entropy for unknown binaries. CX Codex +1 ★ 71repo stars skill-security superagent-ai Audits AI agent skills, plugins, and SKILL.md files for security risks and prompt injections before installation. CX Codex +1 9,100installs malware-triage securityskills malware-triage — a skill for safe analysis of unknown malware samples. Extracts static indicators, runs code in a sandbox, identifies behavior patterns, and produces detection guidance with IOCs and ATT&CK mapping. CX Codex +1 234installs ntlm-relay-coercion yaklang ntlm-relay-coercion is a skill for capturing and relaying NTLM authentication to SMB, LDAP, HTTP and MSSQL targets, including coercion methods. CX Codex +1 3,900installs windows-lateral-movement yaklang windows-lateral-movement is a Claude Code skill for moving between Windows hosts with PsExec, WMI, WinRM, DCOM, RDP, pass-the-hash and pass-the-ticket. It covers the stage after access to one machine. CX Codex +1 3,900installs

From the same set22

The whole set →
tools_evasion The tools_evasion command examines a penetration-testing tool, gathers detection rules, then changes its source code to avoid those rules. It is intended for authorized security work. CX Codex +1 ★ 336repo stars rule_inventory 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. CX Codex +1 ★ 336repo stars hex_analysis hex_analysis — a rule file that explains YARA hex signatures for AdaptixC2: which instruction produced each one and which compiler flag moves those bytes. CX Codex +1 ★ 336repo stars lesson_learned The lesson_learned rule explains why string constants must match fixed-width protocol fields. Use it when changing Go code that reads message headers into fixed-size buffers. CX Codex +1 ★ 336repo stars modifications_summary modifications_summary keeps a record of the AdaptixC2 YARA-evasion edits in front of Claude: beacon build flags, renamed Go functions and the commands that verify them. Useful when you pick the repo back up. CX Codex +1 ★ 336repo stars behavior_analysis behavior_analysis — a Claude Code rule that loads a structured behavioral profile of Stowaway into the agent context: CLI flags, protocol constants, build artifacts, and tiered detection indicators. CX Codex +1 ★ 336repo stars modifications_summary modifications_summary — a Claude rule that fixes the shape of a change log for tool modifications: build metadata, log strings, filenames, and which detections still fire. CX Codex +1 ★ 336repo stars c2-evasion-agent c2-evasion-agent — a subagent that hunts down YARA and Sigma rules written for a C2 framework, then edits the implant source so those signatures stop matching. CX Codex ★ 336repo stars

Project sponsors

Companies that keep this analytics open