Skip to content

Commit 868d9d7

Browse files
[Memory Protection] Add fields for trampoline detection. (#344)
* added new fields for memory_protection alerts
1 parent 469cdb3 commit 868d9d7

File tree

6 files changed

+323
-21
lines changed

6 files changed

+323
-21
lines changed

custom_schemas/custom_api.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@
1818
type: keyword
1919
description: >
2020
The name of the API, usually the name of the function or system call.
21-
22-

custom_schemas/custom_process.yml

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
description: Parent process' pid.
6363
example: 4241
6464
default_field: false
65-
65+
6666
- name: Ext
6767
level: custom
6868
type: object
@@ -95,7 +95,7 @@
9595
level: custom
9696
type: object
9797
description: Object for all custom defined fields to live in.
98-
98+
9999
- name: thread.Ext.call_stack_contains_unbacked
100100
level: custom
101101
type: boolean
@@ -193,9 +193,9 @@
193193
type: boolean
194194
short: Whether a hardware breakpoint was set for the thread.
195195
description: >
196-
Whether a hardware breakpoint was set for the thread.
197-
This field is omitted if false.
198-
example: "true"
196+
Whether a hardware breakpoint was set for the thread.
197+
This field is omitted if false.
198+
example: "true"
199199

200200
- name: thread.Ext.start
201201
level: custom
@@ -252,6 +252,54 @@
252252
description: >
253253
Additional information about the memory containing the thread start address.
254254
255+
- name: thread.Ext.original_start_address
256+
level: custom
257+
type: unsigned_long
258+
example: 4194304
259+
description: >
260+
When a trampoline was detected, this indicates the original content for the thread start address in memory.
261+
262+
- name: thread.Ext.original_start_address_allocation_offset
263+
level: custom
264+
type: unsigned_long
265+
example: 0
266+
description: >
267+
When a trampoline was detected, this indicates the original content for the offset of original_start_address to the allocation base.
268+
269+
- name: thread.Ext.original_start_address_bytes
270+
level: custom
271+
type: keyword
272+
example: "48b84141414141414141ffe000ccccccccccccccccccccccccccccccccccccccc"
273+
description: >
274+
When a trampoline was detected, this holds the original content of the hex-encoded bytes at the original thread start address.
275+
276+
- name: thread.Ext.original_start_address_bytes_disasm
277+
level: custom
278+
type: keyword
279+
example: "mov rax, 0x4141414141414141\\njmp rax"
280+
description: >
281+
When a trampoline was detected, this indicates the original content for the disassembled code pointed by the thread start address.
282+
283+
- name: thread.Ext.original_start_address_bytes_disasm_hash
284+
level: custom
285+
type: keyword
286+
example: "aacb1c801f9030f799e2f7350f053ebb760d42cbe81cd65021063c1c4d1a9c9c"
287+
description: >
288+
When a trampoline was detected, this indicates the hash of original content for the disassembled code pointed by the thread start address.
289+
290+
- name: thread.Ext.original_start_address_module
291+
level: custom
292+
type: keyword
293+
example: "C:\\Program Files\\VMware\\VMware Tools\\vmtoolsd.exe"
294+
description: >
295+
When a trampoline was detected, this indicates the original content for the dll/module where the thread began execution.
296+
297+
- name: thread.Ext.start_address_details
298+
level: custom
299+
type: object
300+
description: >
301+
Additional information about the memory containing the thread start address.
302+
255303
- name: thread.Ext.service
256304
level: custom
257305
type: keyword
@@ -405,19 +453,19 @@
405453
type: keyword
406454
description: >
407455
Session logon type. Examples include Interactive, Network, and Service.
408-
456+
409457
- name: Ext.session_info.client_address
410458
level: custom
411459
type: keyword
412460
description: >
413461
Client's IPv4 or IPv6 address as a string, if available.
414-
462+
415463
- name: Ext.session_info.id
416464
level: custom
417465
type: unsigned_long
418466
description: >
419467
Session ID
420-
468+
421469
- name: Ext.session_info.authentication_package
422470
level: custom
423471
type: keyword
@@ -429,7 +477,7 @@
429477
type: double
430478
description: >
431479
Process creation time, relative to logon time, in seconds.
432-
480+
433481
- name: Ext.session_info.relative_password_age
434482
level: custom
435483
type: double
@@ -656,14 +704,14 @@
656704
657705
- name: io.total_bytes_captured
658706
level: extended
659-
type: long
707+
type: long
660708
beta: This field is beta and subject to change.
661709
description: >
662710
The total number of bytes captured in this event.
663711
664712
- name: io.total_bytes_skipped
665713
level: extended
666-
type: long
714+
type: long
667715
beta: This field is beta and subject to change.
668716
short: The total number of bytes that were not captured due to implementation restrictions such as buffer size limits.
669717
description: >
@@ -687,14 +735,14 @@
687735

688736
- name: io.bytes_skipped.offset
689737
level: extended
690-
type: long
738+
type: long
691739
beta: This field is beta and subject to change.
692740
description: >
693741
The byte offset into this event's io.text (or io.bytes in the future) where length bytes were skipped.
694742
695743
- name: io.bytes_skipped.length
696744
level: extended
697-
type: long
745+
type: long
698746
beta: This field is beta and subject to change.
699747
description: >
700748
The length of bytes skipped.

custom_subsets/elastic_endpoint/alerts/memory_protection_event.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,12 @@ fields:
610610
start_address_bytes: {}
611611
start_address_bytes_disasm: {}
612612
start_address_bytes_disasm_hash: {}
613+
original_start_address: {}
614+
original_start_address_module: {}
615+
original_start_address_allocation_offset: {}
616+
original_start_address_bytes: {}
617+
original_start_address_bytes_disasm: {}
618+
original_start_address_bytes_disasm_hash: {}
613619
service: {}
614620
token:
615621
fields:

package/endpoint/data_stream/alerts/fields/fields.yml

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,9 +2411,49 @@
24112411
- name: process.thread.Ext.hardware_breakpoint_set
24122412
level: custom
24132413
type: boolean
2414-
description: Whether a hardware breakpoint was set for the thread. This field is omitted if false.
2414+
description: Whether a hardware breakpoint was set for the thread. This field is omitted if false.
24152415
example: 'true'
24162416
default_field: false
2417+
- name: process.thread.Ext.original_start_address
2418+
level: custom
2419+
type: unsigned_long
2420+
description: When a trampoline was detected, this indicates the original content for the thread start address in memory.
2421+
example: 4194304
2422+
default_field: false
2423+
- name: process.thread.Ext.original_start_address_allocation_offset
2424+
level: custom
2425+
type: unsigned_long
2426+
description: When a trampoline was detected, this indicates the original content for the offset of original_start_address to the allocation base.
2427+
example: 0
2428+
default_field: false
2429+
- name: process.thread.Ext.original_start_address_bytes
2430+
level: custom
2431+
type: keyword
2432+
ignore_above: 1024
2433+
description: When a trampoline was detected, this holds the original content of the hex-encoded bytes at the original thread start address.
2434+
example: 48b84141414141414141ffe000ccccccccccccccccccccccccccccccccccccccc
2435+
default_field: false
2436+
- name: process.thread.Ext.original_start_address_bytes_disasm
2437+
level: custom
2438+
type: keyword
2439+
ignore_above: 1024
2440+
description: When a trampoline was detected, this indicates the original content for the disassembled code pointed by the thread start address.
2441+
example: mov rax, 0x4141414141414141\njmp rax
2442+
default_field: false
2443+
- name: process.thread.Ext.original_start_address_bytes_disasm_hash
2444+
level: custom
2445+
type: keyword
2446+
ignore_above: 1024
2447+
description: When a trampoline was detected, this indicates the hash of original content for the disassembled code pointed by the thread start address.
2448+
example: aacb1c801f9030f799e2f7350f053ebb760d42cbe81cd65021063c1c4d1a9c9c
2449+
default_field: false
2450+
- name: process.thread.Ext.original_start_address_module
2451+
level: custom
2452+
type: keyword
2453+
ignore_above: 1024
2454+
description: When a trampoline was detected, this indicates the original content for the dll/module where the thread began execution.
2455+
example: C:\Program Files\VMware\VMware Tools\vmtoolsd.exe
2456+
default_field: false
24172457
- name: process.thread.Ext.parameter
24182458
level: custom
24192459
type: unsigned_long
@@ -7208,9 +7248,49 @@
72087248
- name: thread.Ext.hardware_breakpoint_set
72097249
level: custom
72107250
type: boolean
7211-
description: Whether a hardware breakpoint was set for the thread. This field is omitted if false.
7251+
description: Whether a hardware breakpoint was set for the thread. This field is omitted if false.
72127252
example: 'true'
72137253
default_field: false
7254+
- name: thread.Ext.original_start_address
7255+
level: custom
7256+
type: unsigned_long
7257+
description: When a trampoline was detected, this indicates the original content for the thread start address in memory.
7258+
example: 4194304
7259+
default_field: false
7260+
- name: thread.Ext.original_start_address_allocation_offset
7261+
level: custom
7262+
type: unsigned_long
7263+
description: When a trampoline was detected, this indicates the original content for the offset of original_start_address to the allocation base.
7264+
example: 0
7265+
default_field: false
7266+
- name: thread.Ext.original_start_address_bytes
7267+
level: custom
7268+
type: keyword
7269+
ignore_above: 1024
7270+
description: When a trampoline was detected, this holds the original content of the hex-encoded bytes at the original thread start address.
7271+
example: 48b84141414141414141ffe000ccccccccccccccccccccccccccccccccccccccc
7272+
default_field: false
7273+
- name: thread.Ext.original_start_address_bytes_disasm
7274+
level: custom
7275+
type: keyword
7276+
ignore_above: 1024
7277+
description: When a trampoline was detected, this indicates the original content for the disassembled code pointed by the thread start address.
7278+
example: mov rax, 0x4141414141414141\njmp rax
7279+
default_field: false
7280+
- name: thread.Ext.original_start_address_bytes_disasm_hash
7281+
level: custom
7282+
type: keyword
7283+
ignore_above: 1024
7284+
description: When a trampoline was detected, this indicates the hash of original content for the disassembled code pointed by the thread start address.
7285+
example: aacb1c801f9030f799e2f7350f053ebb760d42cbe81cd65021063c1c4d1a9c9c
7286+
default_field: false
7287+
- name: thread.Ext.original_start_address_module
7288+
level: custom
7289+
type: keyword
7290+
ignore_above: 1024
7291+
description: When a trampoline was detected, this indicates the original content for the dll/module where the thread began execution.
7292+
example: C:\Program Files\VMware\VMware Tools\vmtoolsd.exe
7293+
default_field: false
72147294
- name: thread.Ext.parameter
72157295
level: custom
72167296
type: unsigned_long

package/endpoint/docs/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,13 @@ sent by the endpoint.
337337
| Target.process.ppid | Parent process' pid. | long |
338338
| Target.process.start | The time the process started. | date |
339339
| Target.process.thread.Ext | Object for all custom defined fields to live in. | object |
340-
| Target.process.thread.Ext.hardware_breakpoint_set | Whether a hardware breakpoint was set for the thread. This field is omitted if false. | boolean |
340+
| Target.process.thread.Ext.hardware_breakpoint_set | Whether a hardware breakpoint was set for the thread. This field is omitted if false. | boolean |
341+
| Target.process.thread.Ext.original_start_address | When a trampoline was detected, this indicates the original content for the thread start address in memory. | unsigned_long |
342+
| Target.process.thread.Ext.original_start_address_allocation_offset | When a trampoline was detected, this indicates the original content for the offset of original_start_address to the allocation base. | unsigned_long |
343+
| Target.process.thread.Ext.original_start_address_bytes | When a trampoline was detected, this holds the original content of the hex-encoded bytes at the original thread start address. | keyword |
344+
| Target.process.thread.Ext.original_start_address_bytes_disasm | When a trampoline was detected, this indicates the original content for the disassembled code pointed by the thread start address. | keyword |
345+
| Target.process.thread.Ext.original_start_address_bytes_disasm_hash | When a trampoline was detected, this indicates the hash of original content for the disassembled code pointed by the thread start address. | keyword |
346+
| Target.process.thread.Ext.original_start_address_module | When a trampoline was detected, this indicates the original content for the dll/module where the thread began execution. | keyword |
341347
| Target.process.thread.Ext.parameter | When a thread is created, this is the raw numerical value of its parameter. | unsigned_long |
342348
| Target.process.thread.Ext.parameter_bytes_compressed | Up to 512KB of raw data from the thread parameter, if it is a valid pointer. This is compressed with zlib. To reduce data volume, this is de-duplicated on the endpoint, and may be missing from many alerts if the same data would be sent multiple times. | keyword |
343349
| Target.process.thread.Ext.parameter_bytes_compressed_present | Whether parameter_bytes_compressed is present in this event. | boolean |
@@ -960,7 +966,13 @@ sent by the endpoint.
960966
| process.supplemental_groups.id | Unique identifier for the group on the system/platform. | keyword |
961967
| process.supplemental_groups.name | Name of the group. | keyword |
962968
| process.thread.Ext | Object for all custom defined fields to live in. | object |
963-
| process.thread.Ext.hardware_breakpoint_set | Whether a hardware breakpoint was set for the thread. This field is omitted if false. | boolean |
969+
| process.thread.Ext.hardware_breakpoint_set | Whether a hardware breakpoint was set for the thread. This field is omitted if false. | boolean |
970+
| process.thread.Ext.original_start_address | When a trampoline was detected, this indicates the original content for the thread start address in memory. | unsigned_long |
971+
| process.thread.Ext.original_start_address_allocation_offset | When a trampoline was detected, this indicates the original content for the offset of original_start_address to the allocation base. | unsigned_long |
972+
| process.thread.Ext.original_start_address_bytes | When a trampoline was detected, this holds the original content of the hex-encoded bytes at the original thread start address. | keyword |
973+
| process.thread.Ext.original_start_address_bytes_disasm | When a trampoline was detected, this indicates the original content for the disassembled code pointed by the thread start address. | keyword |
974+
| process.thread.Ext.original_start_address_bytes_disasm_hash | When a trampoline was detected, this indicates the hash of original content for the disassembled code pointed by the thread start address. | keyword |
975+
| process.thread.Ext.original_start_address_module | When a trampoline was detected, this indicates the original content for the dll/module where the thread began execution. | keyword |
964976
| process.thread.Ext.parameter | When a thread is created, this is the raw numerical value of its parameter. | unsigned_long |
965977
| process.thread.Ext.parameter_bytes_compressed | Up to 512KB of raw data from the thread parameter, if it is a valid pointer. This is compressed with zlib. To reduce data volume, this is de-duplicated on the endpoint, and may be missing from many alerts if the same data would be sent multiple times. | keyword |
966978
| process.thread.Ext.parameter_bytes_compressed_present | Whether parameter_bytes_compressed is present in this event. | boolean |

0 commit comments

Comments
 (0)