Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored hunt related functions to use the hunt_dispatcher #1807

Merged
merged 4 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed test
  • Loading branch information
scudette committed May 25, 2022
commit 582b2423e81c55a29d0d161d7409913afbb6c56d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ƩԀ��� �������Z�
micWindows.Network.NetstatEnrichedC.56a8dfd31eb1fa6f*�
micWindows.Network.NetstatEnrichedC.4f5e52adf0a337a9*�
IPRegex.*
PortRegex.*
FamilyALL?
Expand Down Expand Up @@ -34,4 +34,4 @@ ALL,".*"
TRUSTED,"^trusted$"
UNSIGNED,"^unsigned$"
NOT TRUSTED,"unsigned|disallowed|untrusted|error"
8�jF.BSJMEJIPT6P9Ip�꘳�����'Windows.Network.NetstatEnriched/Netstat�C.56a8dfd31eb1fa6f
8�jF.BSJMEJIPT6P9Ip�꘳�����'Windows.Network.NetstatEnriched/Netstat�C.4f5e52adf0a337a9
Expand Down
13 changes: 12 additions & 1 deletion vql/windows/wmi/wmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,24 @@ func Query(query string, namespace string) ([]*ordereddict.Dict, error) {
row.Set(property, &vfilter.Null{})
continue
}

defer func() {
_ = property_raw.Clear()
}()

// If it is an array we convert it here.
if property_raw.VT&ole.VT_ARRAY > 0 {
row.Set(property, property_raw.ToArray().ToValueArray())
result := []interface{}{}
for _, item := range property_raw.ToArray().ToValueArray() {
switch item.(type) {
case *ole.IDispatch:
case *ole.IUnknown:
default:
result = append(result, item)
}
}

row.Set(property, result)
continue
}

Expand Down