-
Notifications
You must be signed in to change notification settings - Fork 35
/
Consts.h
executable file
·310 lines (207 loc) · 6.32 KB
/
Consts.h
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
//
// Consts.h
// KnockKnock
//
// Created by Patrick Wardle on 2/4/15.
// Copyright (c) 2015 Objective-See. All rights reserved.
//
#ifndef KK_Consts_h
#define KK_Consts_h
//not first run
#define NOT_FIRST_TIME @"notFirstTime"
//asked for full disk access
#define REQUESTED_FULL_DISK_ACCESS @"requestedFullDiskAccess"
//supported plugins
static NSString * const SUPPORTED_PLUGINS[] = {@"AuthorizationPlugins", @"BrowserExtensions", @"BTM", @"CronJobs", @"DirectoryServicesPlugins", @"DockTiles", @"EventRules", @"Extensions", @"Kexts", @"LaunchItems", @"DylibInserts", @"DylibProxies", @"LoginItems", @"LogInOutHooks", @"PeriodicScripts", @"QuicklookPlugins", @"SpotlightImporters", @"StartupScripts", @"SystemExtensions"};
//status msg
#define SCAN_MSG_STARTED @"Scanning Started"
//status msg
#define SCAN_MSG_STOPPED @"Scan Stopped"
//status msg
#define SCAN_MSG_COMPLETE @"Scan Complete"
//prefs
// ->filter out OS/known
#define PREF_SHOW_TRUSTED_ITEMS @"showTrustedItems"
//prefs
// ->disable VT querires
#define PREF_DISABLE_VT_QUERIRES @"disableVTQueries"
//prefs
// ->save output
#define PREF_SAVE_OUTPUT @"saveOutput"
//prefs
// ->no updates
#define PREF_DISABLE_UPDATE_CHECK @"noUpdateCheck"
//disabled state
#define STATE_DISABLED 0
//enabled state
#define STATE_ENABLED 1
//success
#define STATUS_SUCCESS 0
//signers
enum Signer{None, Apple, AppStore, DevID, AdHoc};
//signature status
#define KEY_SIGNATURE_STATUS @"signatureStatus"
//signer
#define KEY_SIGNATURE_SIGNER @"signatureSigner"
//signing auths
#define KEY_SIGNATURE_AUTHORITIES @"signatureAuthorities"
//code signing id
#define KEY_SIGNATURE_IDENTIFIER @"signatureIdentifier"
//entitlements
#define KEY_SIGNATURE_ENTITLEMENTS @"signatureEntitlements"
//flags
#define KEY_SIGNING_FLAGS @"signingFlags"
//is notarized?
#define KEY_SIGNATURE_IS_NOTARIZED @"notarized"
//OS version yosemite
#define OS_MINOR_VERSION_YOSEMITE 10
//executable path
#define EXECUTABLE_PATH @"@executable_path"
//loader path
#define LOADER_PATH @"@loader_path"
//rpath
#define RUN_SEARCH_PATH @"@rpath"
//path to LSOF
#define LSOF @"/usr/sbin/lsof"
//hash key, SHA1
#define KEY_HASH_SHA1 @"sha1"
//hash key, MD5
#define KEY_HASH_MD5 @"md5"
//path to crontab
#define CRONTAB @"/usr/bin/crontab"
//cron file(s) directory
#define CRON_FILES_DIRECTORY @"/private/var/at/tabs"
//path to system profiler
#define SYSTEM_PROFILER @"/usr/sbin/system_profiler"
//path for pluginkit
#define PLUGIN_KIT @"/usr/bin/pluginkit"
//dyld_ key for launch items
#define LAUNCH_ITEM_DYLD_KEY @"EnvironmentVariables"
//dyld_ key for applications
#define APPLICATION_DYLD_KEY @"LSEnvironment"
//user name
#define USER_NAME @"userName"
//user (home) directory
#define USER_DIRECTORY @"userDirectory"
//path to diff
#define DIFF @"/usr/bin/diff"
//menu
//tag for prefs menu item
#define PREF_MENU_ITEM_TAG 1
//main window
//space for File's button in item table (w/ VT info)
#define TABLE_BUTTONS_FILE 200
//space for Extension's button in item table
#define TABLE_BUTTONS_EXTENTION 120
//space for Command's button in item table
#define TABLE_BUTTONS_COMMANDS 75
//scan button
#define SCAN_BUTTON_TAG 1000
//pref button
#define PREF_BUTTON_TAG 1001
//pref button
#define SAVE_BUTTON_TAG 1002
//compare button
#define COMPARE_BUTTON_TAG 1003
//logo button
#define LOGO_BUTTON_TAG 1004
//category table
//id (tag) for detailed text in category table
#define TABLE_ROW_NAME_TAG 100
//id (tag) for detailed text in category table
#define TABLE_ROW_SUB_TEXT_TAG 101
//id (tag) for total's msg
#define TABLE_ROW_TOTAL_TAG 102
//item table
//id (tag) for signed icon
#define TABLE_ROW_SIGNATURE_ICON 100
//id (tag) for path
#define TABLE_ROW_PATH_LABEL 101
//id (tag) for plist
#define TABLE_ROW_PLIST_LABEL 102
//id (tag) for 'virus total' button
#define TABLE_ROW_VT_BUTTON 103
//id (tag) for 'info' button
#define TABLE_ROW_INFO_BUTTON 105
//id (tag) for 'show' button
#define TABLE_ROW_SHOW_BUTTON 107
//known kexts
#define WHITE_LISTED_KEXTS @"whitelistedKexts"
//known file hashes
#define WHITE_LISTED_FILES @"whitelistedFiles"
//known commands
#define WHITE_LISTED_COMMANDS @"whitelistedCommands"
//known extension hashes
#define WHITE_LISTED_EXTENSIONS @"whitelistedExtensions"
//scanner option key
// ->filter apple signed/known items
#define KEY_SCANNER_FILTER @"filterItems"
//plugin key
#define KEY_RESULT_PLUGIN @"plugin"
//name key
#define KEY_RESULT_NAME @"name"
//path key
#define KEY_RESULT_PATH @"path"
//plist key
#define KEY_RESULT_PLIST @"plist"
//command key
#define KEY_RESULT_COMMAND @"command"
//extension id key
#define KEY_EXTENSION_ID @"id"
//extension description key
#define KEY_EXTENSION_DETAILS @"details"
//extension (host) browser key
#define KEY_EXTENSION_BROWSER @"browser"
/* VIRUS TOTAL */
//query url
#define VT_QUERY_URL @"https://www.virustotal.com/partners/sysinternals/file-reports?apikey="
//requery url
#define VT_REQUERY_URL @"https://www.virustotal.com/vtapi/v2/file/report"
//rescan url
#define VT_RESCAN_URL @"https://www.virustotal.com/vtapi/v2/file/rescan"
//submit url
#define VT_SUBMIT_URL @"https://www.virustotal.com/vtapi/v2/file/scan"
//api key
#define VT_API_KEY @"233f22e200ca5822bd91103043ccac138b910db79f29af5616a9afe8b6f215ad"
//user agent
#define VT_USER_AGENT @"VirusTotal"
//query count
#define VT_MAX_QUERY_COUNT 25
//results
#define VT_RESULTS @"data"
//results response code
#define VT_RESULTS_RESPONSE @"response_code"
//result url
#define VT_RESULTS_URL @"permalink"
//result hash
#define VT_RESULT_HASH @"hash"
//results positives
#define VT_RESULTS_POSITIVES @"positives"
//results total
#define VT_RESULTS_TOTAL @"total"
//results scan id
#define VT_RESULTS_SCANID @"scan_id"
//HTTP response
#define VT_HTTP_RESPONSE @"http_response"
//output file
#define OUTPUT_FILE @"kkResults.txt"
//support us button tag
#define BUTTON_SUPPORT_US 100
//more info button tag
#define BUTTON_MORE_INFO 101
//patreon url
#define PATREON_URL @"https://www.patreon.com/bePatron?c=701171"
//product url
#define PRODUCT_URL @"https://objective-see.org/products/knockknock.html"
//product name
// ...for version check
#define PRODUCT_NAME @"KnockKnock"
//product version url
#define PRODUCT_VERSIONS_URL @"https://objective-see.org/products.json"
//update error
#define UPDATE_ERROR -1
//update no new version
#define UPDATE_NOTHING_NEW 0
//update new version
#define UPDATE_NEW_VERSION 1
#endif