Skip to content

Commit 3fd25bf

Browse files
authored
docs: 1.5.0 version docs (#115)
* docs for the 1.5.0 version * wording fix * explain HTTP request load balancing
1 parent d4c2f6e commit 3fd25bf

File tree

12 files changed

+535
-20
lines changed

12 files changed

+535
-20
lines changed

docs/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<img src='logo.png'></img>
55
</div>
66

7-
# fibratus <small>1.4.2</small>
7+
# fibratus <small>1.5.0</small>
88

99
> A modern tool for the Windows kernel exploration and observability
1010

docs/_sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
* [Null](outputs/null.md)
3838
* [RabbitMQ](outputs/rabbitmq.md)
3939
* [Elasticsearch](outputs/elasticsearch.md)
40+
* [HTTP](outputs/http.md)
41+
* [Eventlog](outputs/eventlog.md)
4042
* <ion-icon name="color-wand-outline"></ion-icon> Transformers
4143
* [Parsing, Enriching, Transforming](transformers/introduction.md)
4244
* <ion-icon name="remove-circle-outline"></ion-icon> [Remove](transformers/remove.md)

docs/filters/fields.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ The following tables summarize available field names that can be used in filter
4747
| ps.args | Process command line arguments | `ps.args in ('/cdir', '/-C')` |
4848
| ps.cwd | Process current working directory | `ps.cwd = 'C:\\Users\\Default'` |
4949
| ps.sid | Security identifier under which this process is run | `ps.sid contains 'SYSTEM'` |
50+
| ps.domain | Process domain name | `ps.domain = 'NT AUTHORITY'` |
51+
| ps.username | Process user name | `ps.username = 'SYSTEM'` |
5052
| ps.sessionid | Unique identifier for the current session | `ps.sessionid = 1` |
53+
| ps.access.mask | Process access rights | `ps.access.mask = '0x1000'` |
54+
| ps.access.mask.names | Process access human-readable rights | `ps.access.mask.names in ('TERMINATE', 'QUERY_INFORMATION')` |
55+
| ps.access.status | Process access status | `ps.access.status = 'success'` |
5156
| ps.envs | Process environment variables | `ps.envs in ('MOZ_CRASHREPORTER_DATA_DIRECTORY')` |
5257
| ps.envs[] | Accesses a specific environment variable. Prefix matches are supported | `ps.envs['MOZ_CRASHREPORTER'] = 'C:\\Program Files\\Firefox'` |
5358
| ps.dtb | Process directory table base address | `ps.dtb = '7ffe0000'` |
@@ -56,16 +61,27 @@ The following tables summarize available field names that can be used in filter
5661
| ps.modules | Modules loaded by the process | `ps.modules in ('crypt32.dll', 'xul.dll')` |
5762
| ps.modules[] | Accesses a specific process module. Prefix matches are supported | `ps.modules['crypt'].size > 1024` |
5863
| ps.parent.name | Parent process name | `ps.parent.name = 'powershell.exe'` |
64+
| ps.parent.pid | Parent process identifier | `ps.parent.pid = 2340` |
5965
| ps.parent.comm | Parent process command line | `ps.parent.comm contains 'attrib'` |
6066
| ps.parent.exe | Full name of the parent process executable | `ps.parent.exe = 'C:\\Windows\\system32\\cmd.exe'` |
6167
| ps.parent.cwd | Parent process current working directory | `ps.parent.cwd = 'C:\\Users\\Default'` |
6268
| ps.parent.sid | Security identifier under which the parent process is run | `ps.parent.sid contains 'SYSTEM'` |
69+
| ps.parent.domain | Parent process domain name | `ps.parent.domain = 'NT AUTHORITY'` |
70+
| ps.parent.username | Parent process user name | `ps.parent.username = 'SYSTEM'` |
6371
| ps.parent.sessionid | Unique identifier for the current session of the parent process | `ps.parent.session = 1` |
6472
| ps.parent.dtb | Parent process directory table base address | `ps.parent.dtb = 'powershell.exe'` |
6573
| ps.parent.envs | Parent process environment variables | `ps.parent.envs in ('PROCESSOR_LEVEL')'` |
6674
| ps.parent.handles | Allocated parent process handles | `ps.parent.handles in ('\\...\\Cor_SxSPublic_IPCBlock')` |
6775
| ps.parent.handle.types | Allocated parent process handles types | `ps.parent.handle.types in ('Key', 'Mutant', 'Section')` |
6876
| ps.ancestor[] | Process ancestry traversing | `ps.ancestor[2].name in ('winword.exe', 'powershell.exe')` |
77+
| ps.sibling.name | Sibling process name | `ps.sibling.name = 'cmd.exe'` |
78+
| ps.sibling.pid | Sibling process identifier | `ps.sibling.id = 6050` |
79+
| ps.sibling.comm | Sibling process command line | `ps.sibling.name contains '/k /v'` |
80+
| ps.sibling.exe | Sibling process executable full path | `ps.sibling.exe = 'C:\\Windows\\system32\\cmd.exe'` |
81+
| ps.sibling.sid | Sibling process security identifier | `ps.sibling.sid contains 'SYSTEM'` |
82+
| ps.sibling.sessionid | Sibling process session identifier | `ps.sibling.sessionid = 1` |
83+
| ps.sibling.domain | Sibling process domain name | `ps.sibling.domain = 'NT AUTHORITY'` |
84+
| ps.sibling.username | Sibling process user name | `ps.sibling.username = 'SYSTEM'` |
6985

7086
### Thread
7187
| Field Name | Description | Example |
@@ -78,6 +94,10 @@ The following tables summarize available field names that can be used in filter
7894
| thread.ustack.base | Base address of the thread's user space stack | `thread.ustack.base = '7ffe0000'` |
7995
| thread.ustack.limit | Limit of the thread's user space stack | `thread.ustack.limit = '8ffe0000'` |
8096
| thread.entrypoint | Starting address of the function to be executed by the thread | `thread.entrypoint = '7efe0000'` |
97+
| thread.access.mask | Thread access rights | `thread.access.mask = '0x1800'` |
98+
| thread.access.mask.names | Thread access human-readable rights | `thread.access.mask.names in ('QUERY_LIMITED_INFORMATION')` |
99+
| thread.access.status | Thread access status | `thread.access.status = 'success'` |
100+
81101

82102
### Image
83103
| Field Name | Description | Example |

docs/filters/functions.md

Lines changed: 247 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Functions
22

3-
Functions expand the scope of the filtering language by bringing a plethora of capabilities. The function can return a primitive value, including integers, strings, and booleans. Additionally, some functions may return a collection of values. Function names are case insensitive.
3+
Functions expand the scope of the filtering language by bringing a plethora of capabilities. The function can return a primitive value, including integers, strings, and booleans. Function calls can be nested where the result of one function is used as an input in another function. For example, `lower(ltrim(file.name, 'C:'))`, removes the `C` drive letter from the file path and converts it to a lower case string.
4+
5+
Additionally, some functions may return a collection of values. Function names are case insensitive.
46

57
### Network functions
68

@@ -18,7 +20,7 @@ Functions expand the scope of the filtering language by bringing a plethora of c
1820
1921
- **Examples**
2022
21-
Assuming the `net.sip` contains the `192.168.1.20` IP address, the following filter
23+
Assuming the `net.sip` field contains the `192.168.1.20` IP address, the following filter
2224
would match on this event.
2325
2426
```
@@ -40,8 +42,249 @@ Functions expand the scope of the filtering language by bringing a plethora of c
4042
4143
- **Examples**
4244
43-
Assuming the `registry.key.name` contains `HKEY_LOCAL_MACHINE\SYSTEM\Setup\Pid`, the following would filter events for the matching md5 hash.
45+
Assuming the `registry.key.name` field contains `HKEY_LOCAL_MACHINE\SYSTEM\Setup\Pid`, the following would filter events for the matching md5 hash.
4446
4547
```
4648
fibratus run kevt.category = 'net' and md5(registry.key.name) = 'eab870b2a516206575d2ffa2b98d8af5'
47-
```
49+
```
50+
51+
### String functions
52+
53+
#### concat
54+
55+
`concat` concatenates string/integer input arguments.
56+
57+
- **Specification**
58+
```
59+
concat(args: <string|int>...) :: <string>
60+
```
61+
- `args`: Strings or integers to be concatenated. This function requires at least 2 input arguments
62+
- `return` a concatenated string of all input arguments
63+
64+
- **Examples**
65+
66+
Assuming the `ps.domain` field contains `NT_AUTHORITY` and `ps.username` field contains `admin`, the following would filter events for the matching concatenated string.
67+
68+
```
69+
fibratus run concat(ps.domain, '-', ps.username) = 'NT_AUTHORITY-admin'
70+
```
71+
72+
#### ltrim
73+
74+
`ltrim` trims the specified prefix from a string.
75+
76+
- **Specification**
77+
```
78+
ltrim(string: <string>, prefix: <string>) :: <string>
79+
```
80+
- `string`: Input string
81+
- `prefix`: Prefix that is removed from the original input string
82+
- `return` a string with the specified prefix removed
83+
84+
- **Examples**
85+
86+
Assuming the `registry.key.name` field contains `HKEY_LOCAL_MACHINE\SYSTEM\Setup\Pid`, the following filter expression would match on all events where the resulting string is equal to `SYSTEM\Setup\Pid`
87+
88+
```
89+
fibratus run ltrim(registry.key.name, 'HKEY_LOCAL_MACHINE\\') = 'SYSTEM\\Setup\\Pid'
90+
```
91+
92+
#### rtrim
93+
94+
`rtrim` trims the specified suffix from a string.
95+
96+
- **Specification**
97+
```
98+
rtrim(string: <string>, suffix: <string>) :: <string>
99+
```
100+
- `string`: Input string
101+
- `prefix`: Suffix that is removed from the original string
102+
- `return` a string with the specified suffix removed
103+
104+
- **Examples**
105+
106+
Assuming the `registry.key.name` field contains `HKEY_LOCAL_MACHINE\SYSTEM\Setup\Pid`, the following filter expression would match on all events where the resulting string is equal to `HKEY_LOCAL_MACHINE\SYSTEM\Setup`
107+
108+
```
109+
fibratus run rtrim(registry.key.name, '\\Pid') = 'HKEY_LOCAL_MACHINE\\SYSTEM\\Setup'
110+
```
111+
112+
#### lower
113+
114+
`lower` converts the string with all Unicode letters mapped to their lower case.
115+
116+
- **Specification**
117+
```
118+
lower(string: <string>) :: <string>
119+
```
120+
- `string`: Input string
121+
- `return` a string converted to lower case
122+
123+
- **Examples**
124+
125+
Assuming the `registry.key.name` field contains `HKEY_LOCAL_MACHINE\SYSTEM\Setup`, the following filter expression would match on all events where the resulting string is equal to `hkey_local_machine\system\setup`
126+
127+
```
128+
fibratus run lower(registry.key.name) = 'hkey_local_machine\\system\\setup'
129+
```
130+
131+
#### upper
132+
133+
`upper` converts the string with all Unicode letters mapped to their upper case.
134+
135+
- **Specification**
136+
```
137+
upper(string: <string>) :: <string>
138+
```
139+
- `string`: Input string
140+
- `return` a string converted to upper case
141+
142+
- **Examples**
143+
144+
Assuming the `registry.key.name` field contains `HKEY_LOCAL_MACHINE\SYSTEM\Setup`, the following filter expression would match on all events where the resulting string is equal to `HKEY_LOCAL_MACHINE\SYSTEM\SETUP`
145+
146+
```
147+
fibratus run upper(registry.key.name) = 'HKEY_LOCAL_MACHINE\\SYSTEM\\SETUP'
148+
```
149+
150+
#### replace
151+
152+
`replace` replaces all occurrences in the string as given by arbitrary old/new replacement pairs.
153+
154+
- **Specification**
155+
```
156+
replace(string: <string>, old: <string>, new: <string>, ..., old-n: <string>, new-n: <string>) :: <string>
157+
```
158+
- `string`: Input string
159+
- `old`: substring in the original string that is replaced with the `new` string
160+
- `new`: the replacement string
161+
- `return` a string with all occurrences replaced by old/new pairs
162+
163+
- **Examples**
164+
165+
Assuming the `registry.key.name` field contains `HKEY_LOCAL_MACHINE\SYSTEM\Setup`, the following filter expression would match on all events where the resulting string is equal to `HKLM\SYS\Setup`
166+
167+
```
168+
fibratus run replace(registry.key.name, 'HKEY_LOCAL_MACHINE', 'HKLM', 'SYSTEM', 'SYS') = 'HKLM\\SYS\\Setup'
169+
```
170+
171+
#### split
172+
173+
`split` produces a slice of substrings separated by the given delimiter.
174+
175+
- **Specification**
176+
```
177+
split(string: <string>, sep: <string>) :: <[]string>
178+
```
179+
- `string`: Input string
180+
- `prefix`: The separator that is used to split the string
181+
- `return` a slice of substrings
182+
183+
- **Examples**
184+
185+
Assuming the `file.name` field contains `C:\Windows\System32\kernel32.dll`, the following filter expression would match on all events where the `kernel32.dll` or `System32` strings are present in the resulting slice.
186+
187+
```
188+
fibratus run split(file.name, '\\') in ('kernel32.dll', 'System32')
189+
```
190+
191+
#### length
192+
193+
`length` returns the number of characters for string arguments and the size of the slice for slice arguments.
194+
195+
- **Specification**
196+
```
197+
length(string: <string|slice>) :: <int>
198+
```
199+
- `string`: Input string or slice
200+
- `return` the number of characters or array length
201+
202+
- **Examples**
203+
204+
Assuming the `ps.domain` field contains `"こんにちは"`, the following would filter events with 5 symbols in the process domain.
205+
206+
```
207+
fibratus run length(ps.domain) = 5
208+
```
209+
210+
#### indexof
211+
212+
`indexof` returns the index of the instance of substring in a given string depending on the provided search order.
213+
214+
- **Specification**
215+
```
216+
indexof(string: <string>, substring: <string>, order: <string>) :: <int>
217+
```
218+
- `string`: Input string
219+
- `prefix`: Substring for which the search is performed
220+
- `order`: Specifies the string index search order. It can be `first`, `any`, `last`, `lastany`. This is an optional argument.
221+
- `return` the index of the substring
222+
223+
- **Examples**
224+
225+
Assuming the `ps.domain` field contains `NT_AUTHORITY`, the following would filter events for the matching substring index.
226+
227+
```
228+
fibratus run indexof(ps.domain, 'NT') = 0
229+
```
230+
231+
#### substr
232+
233+
`substr` creates a substring of a given string.
234+
235+
- **Specification**
236+
```
237+
substr(string: <string>, start: <int>, end: <int>) :: <string>
238+
```
239+
- `string`: Input string
240+
- `start`: Substring start index
241+
- `end`: Substring end index
242+
- `return` a substring contained within start and end indices
243+
244+
- **Examples**
245+
246+
Assuming the `file.name` field contains `\Device\HarddiskVolume2\Windows\system32\user32.dll`, the following filter expression would match on all events where the substring is equal to `\Device`
247+
248+
```
249+
fibratus run substr(file.name, indexof(file.name, '\\'), indexof(file.name, '\\Hard')) = '\\Device'
250+
```
251+
252+
#### entropy
253+
254+
`entropy` measures the string entropy.
255+
256+
- **Specification**
257+
```
258+
entropy(string: <string>, algo: <string>) :: <int>
259+
```
260+
- `string`: Input string
261+
- `algo`: The algorithm used to calculate the string entropy. `shannon` is the default entropy type. This argument is optional
262+
- `return` the string entropy
263+
264+
- **Examples**
265+
266+
Assuming the `file.name` field contains `\Device\HarddiskVolume2\Windows\system32\user32.dll`, the following filter expression would match on all events where file name entropy is greater than 255.
267+
268+
```
269+
fibratus run entropy(file.name) > 255
270+
```
271+
272+
#### regex
273+
274+
`regex` applies single/multiple regular expressions on the provided string argument.
275+
276+
- **Specification**
277+
```
278+
regex(string: <string>, patterns: <string>...) :: <bool>
279+
```
280+
- `string`: Input string
281+
- `patterns`: Regular expression patterns
282+
- `return` `true` if at least one regular expression matches or `false` otherwise
283+
284+
- **Examples**
285+
286+
Assuming the `ps.name` field contains `powershell.exe`, the following would filter events matching the regular expressions.
287+
288+
```
289+
fibratus run regex(ps.name, 'power.*(shell|hell).dll', '.*hell.exe')
290+
```

docs/kevents/process.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Process events
22

3+
#### CreateProcess and TerminateProcess
4+
35
Process events are fired up as a stimulus to the process' life-cycle changes. When the kernel puts into motion a process or terminates it, the `CreateProcess` and `TerminateProcess` events are emitted respectively. The following list summarizes all the distinct event parameters that are associated with process events.
46

57
- `pid` is the process' identifier. This value is valid from the time a process is created until it is terminated.
@@ -15,6 +17,17 @@ Process events are fired up as a stimulus to the process' life-cycle changes. Wh
1517
- `status` is the exit status of the stopped process.
1618
- `start_time` designates the instant when the process was started.
1719

20+
#### OpenProcess
21+
22+
`OpenProcess` event is triggered when a process tries to acquire an existing local process object. This event contains the following parameters:
23+
24+
- `desired_access` is the hexadecimal value that represents the desired access to the process object.
25+
- `desired_access_names` is the list of human-readable desired access strings (e.g. `TERMINATE,QUERY_INFORMATION`). For a full list and detailed explanation of available access rights, head to the official [docs](https://docs.microsoft.com/en-us/windows/win32/procthread/process-security-and-access-rights).
26+
- `name` is the name of the local process that was opened.
27+
- `exe` is the full path of the local process object that was open.
28+
- `pid` is the identifier of the local process that was opened.
29+
- `status` contains the result of the process object open operation. (e.g. `success`)
30+
1831
### Process state {docsify-ignore}
1932

2033
Fibratus keeps a snapshot of all running processes including their state such as basic process attributes, allocated file handles, dynamically-linked libraries, PE (Portable Executable) metadata and other resources. The snapshot is updated dynamically as processes get spawn or die. Each time a kernel event is triggered, its process' state is fetched from the snapshot and attached to the event. This state machine semantically enriches each individual event with the aim on providing a powerful context for [filtering](/filters/introduction.md) and [scripting](/filaments/introduction.md).

docs/kevents/thread.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Thread events
22

3+
#### CreateThread and TerminateThread
4+
35
Thread events notify the creation (`CreateThread`) or termination (`TerminateThread`) of threads within the process' address space. In situations where a process spawns a remote thread that runs in other process' address space, the `CreateThread` event is also triggered.
46
Thread events are comprised of the following parameters:
57

@@ -13,3 +15,16 @@ Thread events are comprised of the following parameters:
1315
- `kstack_base` is the base address of the thread's kernel space stack.
1416
- `kstack_limit` is the limit of the thread's kernel space stack.
1517
- `entrypoint` is the starting address of the function to be executed by the thread.
18+
19+
#### OpenThread
20+
21+
`OpenProcess` event is triggered when a process opens an existing local thread object. This event contains the following parameters:
22+
23+
- `desired_access` is the hexadecimal value that represents the desired access to the thread object.
24+
- `desired_access_names` is the list of human-readable desired access strings (e.g. `QUERY_LIMITED_INFORMATION`). For a full list and detailed explanation of available access rights, head to the official [docs](https://docs.microsoft.com/en-us/windows/win32/procthread/thread-security-and-access-rights).
25+
- `name` is the name of the local process whose thread object was open.
26+
- `exe` is the full path of the local process image whose thread object was open.
27+
- `pid` is the identifier of the local process whose thread object was opened.
28+
- `tid` is the identifier of the local thread that was opened.
29+
- `status` contains the result of the thread object open operation. (e.g. `success`)
30+

0 commit comments

Comments
 (0)