Skip to content

persistence: restrict registry-based service detection to service-specific values (fix #1100)#1126

Open
reyyanxahmed wants to merge 1 commit intomandiant:masterfrom
reyyanxahmed:fix/persist-via-windows-service-fp-1100
Open

persistence: restrict registry-based service detection to service-specific values (fix #1100)#1126
reyyanxahmed wants to merge 1 commit intomandiant:masterfrom
reyyanxahmed:fix/persist-via-windows-service-fp-1100

Conversation

@reyyanxahmed
Copy link

@reyyanxahmed reyyanxahmed commented Feb 25, 2026

Fixes #1100 - false positive in persist via Windows service rule.

Problem

The registry-based detection branch (third or branch) matches ANY registry write under Services\*, causing false positives for benign operations. The sample in #1100 modifies NetbiosOptions under Services\NetBT\Parameters\Interfaces\Tcpip_* - a legitimate network configuration change unrelated to service persistence.

Fix

Added a requirement that the registry value name must be one of three values that actually control service execution:

  • ImagePath - the service binary path (primary persistence vector)
  • ServiceDll - svchost-hosted service DLL path
  • FailureCommand - command executed on service failure (abuse vector)

This eliminates false positives from writes to service parameter subkeys (like NetbiosOptions, Parameters, Security) that don't control service execution, while preserving detection of all three main registry-based service persistence techniques.

Validation

  • capafmt output matches (no reformatting needed)
  • lint.py passes (only warnings are missing local sample files)

…fic values

Fixes mandiant#1100 — false positive in persist via Windows service rule.

The registry-based detection branch previously matched ANY registry write under
Services\*, which caused false positives for benign operations like modifying
NetBT network parameters (NetbiosOptions under Services\NetBT\Parameters\*).

Added a requirement for service-specific registry value names:
- ImagePath: the service binary path (primary persistence vector)
- ServiceDll: svchost-hosted service DLL path
- FailureCommand: command executed on service failure (abuse vector)

This eliminates false positives from registry writes to service parameter
subkeys that don't control service execution behavior, while preserving
detection of all three main registry-based service persistence techniques.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

persist via Windows service

1 participant