-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomation-RegPathReputationBasicLists.yml
152 lines (147 loc) · 9.71 KB
/
automation-RegPathReputationBasicLists.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
commonfields:
id: RegPathReputationBasicLists
version: -1
name: RegPathReputationBasicLists
script: |-
WHITELIST = [ r'HKEY_LOCAL_MACHINE\Software\wow6432node\Microsoft\Windows\CurrentVersion\Run\vmware-tray.exe' ]
BLACKLIST = [ r'HKEY_CURRENT_USER\Software\Locky',
r'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Locky' ]
SUSPICIOUS = [ r"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\UrlSearchHooks",
r"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Htmlfile\Shell\Open\Command",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Htmlfile\Shell\Open\Command\(Default)",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Protocols\Filter",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Protocols\Handler",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\Appinit_Dlls",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\VmApplet",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Provider Filters",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\PLAP Providers",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellServiceObjects",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Active Setup\Installed Components",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Windows\Appinit_Dlls",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\ShellServiceObjects",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Authentication Packages",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Notification Packages",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\OSConfig\Security Packages",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Security Packages",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\AlternateShell",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders",
r"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SecurityProviders",
r"HKEY_LOCAL_MACHINE\Software\Classes\AllFileSystemObjects\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\AllFileSystemObjects\ShellEx\PropertySheetHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{083863F1-70DE-11d0-BD40-00A0C911CE86}\Instance",
r"HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{7ED96837-96F0-4812-B211-F13C24117ED3}\Instance",
r"HKEY_LOCAL_MACHINE\Software\Classes\Directory\Background\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\Directory\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\Directory\Shellex\CopyHookHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\Directory\Shellex\DragDropHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\Directory\Shellex\PropertySheetHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\Drive\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\Folder\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\Folder\ShellEx\DragDropHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\Folder\ShellEx\PropertySheetHandlers",
r"HKEY_LOCAL_MACHINE\Software\Classes\Folder\Shellex\ColumnHandlers",
r"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Drivers32",
r"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows",
r"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows\IconServiceLib",
r"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects",
r"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers",
r"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\AllFileSystemObjects\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\AllFileSystemObjects\ShellEx\PropertySheetHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\CLSID\{083863F1-70DE-11d0-BD40-00A0C911CE86}\Instance",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\CLSID\{7ED96837-96F0-4812-B211-F13C24117ED3}\Instance",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Directory\Background\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Directory\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Directory\Shellex\CopyHookHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Directory\Shellex\DragDropHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Directory\Shellex\PropertySheetHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Drive\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Folder\ShellEx\ContextMenuHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Folder\ShellEx\DragDropHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Folder\ShellEx\PropertySheetHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Classes\Folder\Shellex\ColumnHandlers",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects",
r"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ServiceControlManagerExtension",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\BootExecute",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KnownDlls",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\Wds\rdpwd",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\StartupPrograms",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock2\Parameters\NameSpace_Catalog5\Catalog_Entries",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock2\Parameters\NameSpace_Catalog5\Catalog_Entries64",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock2\Parameters\Protocol_Catalog9\Catalog_Entries",
r"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock2\Parameters\Protocol_Catalog9\Catalog_Entries64",
r"HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\policies\explorer\run",
r"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServices",
r"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices",
r"HKEY_LOCAL_MACHINE\software\microsoft\wbem\ess\//./root/cimv2\win32clockprovider",
r"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce",
r"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify",
r"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ShellServiceObjectDelayLoad",
r"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx",
r"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run",
r"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce",
r"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run",
r"HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\load",
r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SharedTaskScheduler" ]
# registry keys are case insensative: https://docs.microsoft.com/en-us/windows/desktop/sysinfo/structure-of-the-registry
reg_path = NormalizeRegistryPath(demisto.args()['input'].upper())
def check_reg_in_list(path, list_to_check):
for key in list_to_check:
if path.startswith(key.upper()):
return True
return False
if check_reg_in_list(reg_path, WHITELIST):
score = 1
elif check_reg_in_list(reg_path, BLACKLIST):
score = 3
elif check_reg_in_list(reg_path, SUSPICIOUS):
score = 2
else:
score = 0
outputs = {
'Path': reg_path,
'Score': score
}
demisto.results({
'Type': entryTypes['note'],
'ContentsFormat': formats['json'],
'Contents': score,
'ReadableContentsFormat': formats['text'],
'HumanReadable': "The Registry Path reputation for: {} is: {}".format(reg_path, score),
'EntryContext': {
'RegistryKey(val.Path == obj.Path)': outputs
}
})
type: python
tags:
- registry
- reputation
comment: Check the given registry path against a small blacklist (score 3), whitelist
(score 1), and suspicious list (score 2). If the key matches neither, returns an
answer of 0.
enabled: true
system: true
args:
- name: input
required: true
description: Registry path to be checked
scripttarget: 0
runonce: false
runas: DBotWeakRole