-
Notifications
You must be signed in to change notification settings - Fork 450
Closed
Description
We need to add a fieldset for Windows registry event. Both Sysmon/winlogbeat and Endgame/Elastic endpoint can collect these. I'm less focused on the creation of registry keys, but thinking more about the creation/modification of values. For more background on how the registry works, here's the wikipedia page.
Here's an example event collected from Endgame
{
"bytes_written": "QwA6AFwAcgB0AGEAXAByAGUAZABfAHQAdABwAFwAYgBpAG4AXABtAHkAYQBwAHAALgBlAHgAZQAAAA==",
"bytes_written_count": 58,
"bytes_written_string": "C:\\rta\\red_ttp\\bin\\myapp.exe",
"event_subtype_full": "registry_modify_event",
"event_type_full": "registry_event",
"hostname": "RTA-TESTING",
"key_path": "\\REGISTRY\\MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\normalprogram.exe\\Debugger",
"key_type": "sz",
"opcode": 1,
"pid": 9108,
"process_name": "python.exe",
"process_path": "C:\\Python27\\python.exe",
"serial_event_id": 77803,
"timestamp": 131762384629155140,
"timestamp_utc": "2018-07-16 18:14:22Z",
"unique_pid": 77788,
"user_name": "tester",
"user_sid": "S-1-5-21-4215045029-3277270250-148079304-1004"
}Some of the keys worth adding to the field set:
hive: If we stick with the abbreviated names, the values are HKLM, HKCC, HKCR, HKCU, HKU. if we go unabbreviated names, this means HKEY_LOCAL_MACHINE, HKEY_CURRENT_CONFIG, etc. in the above example, this isHKLM/HKEY_LOCAL_MACHINEkey: the hive relative path to the key. this doesn't include the value name. this is somewhat analogous to a directory path in na file system. in the above example this isSOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\normalprogram.exevalue: the name of the value written to. this is somewhat analogous to a file name. in the above example, this is Debuggerpath: the full path, including hive, key, and value. essentiallykey_pathin the above example
It also may be worth nesting a field set at registry.data which contains
type: the representation of the data. basically tells you how to interpret the bytes written. possible values are: REG_NONE, REG_SZ, REG_EXPAND_SZ, REG_DWORD, etc. in the above example, this is REG_SZ.int_value: open for naming suggestions, but we could store (+/- careful casting) DWORD/QWORD as i64, orlongwithin ESstring_values: type:array[string]again, open for a better name, but this would store the strings for any string types -- REG_SZ, REG_EXPAND_SZ, REG_LINNK, REG_MULTI_SZ. in the above example, we would store["C:\\rta\\red_ttp\\bin\\myapp.exe"]num_strings: type: long. this would be the number of strings for REG_MULTI_SZ. I'm not sure how often this would need to be queried over, so this could be derived withlength(string_values)original_bytes: type string - I'm not sure the best representation, but this could be base64 to store arbitrary bytes without worrying about unicode. this would be most used for REG_BINARY, but could be stored for any data type.
Metadata
Metadata
Assignees
Labels
No labels