Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit 2c2fad9

Browse files
author
Michael Ligh
committed
add an additional sanity check to windows services, exclude those without valid service type values
1 parent 794d15e commit 2c2fad9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

volatility/plugins/malware/svcscan.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,12 @@ def Pid(self):
141141

142142
def is_valid(self):
143143
"Check some fields for validity"
144+
type_flags_max = sum([(1 << v) for v in SERVICE_TYPE_FLAGS.values()])
144145
return obj.CType.is_valid(self) and self.Order > 0 and \
145146
self.Order < 0xFFFF and \
146147
self.State.v() in SERVICE_STATE_ENUM and \
147-
self.Start.v() in SERVICE_START_ENUM
148+
self.Start.v() in SERVICE_START_ENUM and \
149+
self.Type.v() < type_flags_max
148150

149151
def traverse(self):
150152

0 commit comments

Comments
 (0)