-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathBOF-Z-Labs.yaml
More file actions
670 lines (653 loc) · 17.4 KB
/
Copy pathBOF-Z-Labs.yaml
File metadata and controls
670 lines (653 loc) · 17.4 KB
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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
---
name: wProcessInjectionSrdi
description: "Injects any BOF to any process"
author: Z-Labs
Arch: ["x64", "x86"]
tags: ['windows','srdi','z-labs','TA0005','TA0004','T1055.001']
category: "Injection-BOF"
OS: Windows
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/wProcessInjectionSrdi.zig'
examples: '
wProcessInjectionSrdi i:<bof_len_in_bytes> z:<pointer_to_bof_bytes> i:<pid>
'
arguments:
- name: bof_data_len
desc: "Length in bytes of BOF to be injected"
type: integer
required: true
- name: bof_data_ptr
desc: "Pointer to the bytes of the BOF to be injected"
type: string
required: true
- name: pid
desc: "PID"
type: integer
required: true
- name: dump_shellcode
desc: "When --dump-shellcode string is present final shellcode will be written to 'shellcode.bin' file."
type: string
required: false
errors:
- name: UnknownError
code: 0xff
message: "Unknown error"
---
name: "udpScanner"
description: "Universal UDP port sweeper"
author: "Z-Labs"
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','T0007','T0846.001', 'z-labs']
category: "SAR-BOF"
OS: "cross-platform"
entrypoint: "go"
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/udpScanner.zig'
examples: '
Scanning provided IP range on most common UDP ports with builtin UDP probes:
udpScanner str:192.168.0.1-32
Scanning only cherry-picked ports (if no builtin UDP probe for the chosen port is available then length and content of the packet payload will be randomly generated:
udpScanner str:192.168.0.1:123,161
udpScanner str:102.168.1.1-128:53,427,137
udpScanner str:192.168.0.1:100-200
Example of running with provided UDP probes:
udpScanner str:192.168.0.1-32 int:BUF_LEN str:BUF_MEMORY_ADDRESS
UDP probe syntax (with example):
<portSpec> <probeName> <hexadecimal encoded probe data>\n
53,69,135,1761 dnsReq 000010000000000000000000
Example of running udpScanner using cli4bofs tool and with UDP probes provided from the file:
cli4bofs exec udpScanner 102.168.1.1-4:161,427 file:/tmp/udpPayloads
'
arguments:
- name: IPSpec
desc: "IP addresses specification, ex: 192.168.0.1; 10.0.0-255.1-254; 192.168.0.1:161,427,10-15"
type: string
required: true
- name: BufLen
desc: "length of UDP probes buffer"
type: integer
required: false
- name: BufMemoryAddress
desc: "memory address of UDP probes buffer"
type: string
required: false
---
name: "tcpScanner"
description: "TCP connect() port scanner"
author: "Z-Labs"
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','T0007','T0846.001', 'z-labs']
category: "SAR-BOF"
OS: "cross-platform"
entrypoint: "go"
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/tcpScanner.zig'
examples: '
Scanning selected hosts and ports:
tcpScanner str:192.168.0.1:80,22,443
tcpScanner str:192.168.0.1:100-200
tcpScanner str:102.168.1.1-128:445,81,8080-8089
arguments:
- name: IPSpec
desc: "IP addresses specification, ex: 192.168.0.1; 10.0.0-255.1-254; 192.168.0.1:161,427,10-15"
type: string
required: true
'
---
name: whoami
description: "Print current user"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','TA0007','T1033', 'z-labs']
category: "SAL-BOF"
OS: cross-platform
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/whoami.zig'
examples: '
whoami
'
---
name: uname
description: "Print system information. With no flag, same as -s"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['linux','TA0007', 'T1082','z-labs']
category: 'SAL-BOF'
OS: Linux
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/coreutils/uname.zig'
examples: '
uname
uname -a
Flags:
-a print all information
-s print the kernel name
-n print the network node hostname
-r print the kernel release
-v print the kernel version
-m print the machine hardware name
'
arguments:
- name: option
desc: "Print only chosen system information. Supported options: -asnrvm"
type: string
required: false
---
name: hostid
description: "Print the numeric identifier for the current host"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['linux','TA0007', 'T1016','z-labs']
category: 'SAL-BOF'
OS: Linux
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/coreutils/hostid.zig'
examples: '
hostid
'
---
name: hostname
description: "Show system host name"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['linux','TA0007', 'T1016','z-labs']
category: 'SAL-BOF'
OS: Linux
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/coreutils/hostname.zig'
examples: '
hostname
'
---
name: uptime
description: "Tell how long the system has been running"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['linux','TA0007', 'T1082','z-labs']
category: 'SAL-BOF'
OS: Linux
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/coreutils/uptime.zig'
examples: '
uptime
'
---
name: id
description: "Print user and group information for each specified USER, or (when USER omitted) for the current process"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','TA0007','T1033', 'z-labs']
category: "SAL-BOF"
OS: Linux
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/coreutils/id.zig'
examples: '
id
id root
'
arguments:
- name: user
desc: "Prints user and group information for this user"
type: string
required: false
---
name: who
description: "Show who is logged on"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['linux','TA0007', 'T1082','z-labs']
category: 'SAL-BOF'
OS: Linux
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/coreutils/who.zig'
examples: '
who
'
---
name: cat
description: "Print content of a file"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','TA0007', 'T1083', 'z-labs']
category: "FILES-BOF"
OS: cross-platform
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/cat.zig'
examples: '
cat /etc/passwd
cat C:\Windows\System32\drivers\etc\hosts
'
arguments:
- name: file_path
desc: "path to the file to be printed"
type: string
required: true
errors:
- name: AccessDenied
code: 0x1
message: "Failed to open provided file"
- name: FileNotFound
code: 0x2
message: "File not found"
- name: AntivirusInterference
code: 0x3
message: "Possible Antivirus Interference while opening the file"
- name: FileNotProvided
code: 0x4
message: "No file provided"
- name: StreamTooLong
code: 0x5
message: "File is very large"
- name: UnknownError
code: 0x6
message: "Unknown error"
---
name: pwd
description: "Print name of current/working directory"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','TA0007', 'T1083', 'z-labs']
category: "FILES-BOF"
OS: cross-platform
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/pwd.zig'
examples: '
pwd
'
errors:
- name: AccesDenied
code: 0x1
message: "Permission to read or search a component of the filename was denied"
- name: CwdUnlinked
code: 0x2
message: "The current working directory has been unlinked"
- name: NameTooLong
code: 0x3
message: "Name too long"
- name: UnknownError
code: 0x4
message: "Unknown error"
---
name: cd
description: "Change current working directory"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','TA0007', 'T1083', 'z-labs']
category: "FILES-BOF"
OS: cross-platform
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/cd.zig'
examples: '
cd /etc
cd C:\Windows
'
arguments:
- name: dir_path
desc: "path to change to"
type: string
required: true
errors:
- name: AccessDenied
code: 0x1
message: "Access to the directory denied"
- name: SymLinkLoop
code: 0x2
message: "Symlink loop"
- name: NameTooLong
code: 0x3
message: "Directory too long"
- name: FileNotFound
code: 0x4
message: "No such directory"
- name: SystemResources
code: 0x5
message: "System resources"
- name: NotDir
code: 0x6
message: "No directory"
- name: DirNotProvided
code: 0x7
message: "Directory not provided"
- name: UnknownError
code: 0x8
message: "Unknown error"
---
name: ls
description: "List given directory content"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','TA0007', 'T1083', 'z-labs']
category: "FILES-BOF"
OS: cross-platform
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/ls.zig'
examples: '
ls /
ls C:\Windows\System32\
'
arguments:
- name: dir_path
desc: "path to the directory to be listed"
type: string
required: true
errors:
- name: AccessDenied
code: 0x1
message: "Failed to open provided file"
- name: FileNotFound
code: 0x2
message: "File not found"
- name: AntivirusInterference
code: 0x3
message: "Possible Antivirus Interference while opening the file"
- name: DirNotProvided
code: 0x4
message: "No directory provided"
- name: UnknownError
code: 0x5
message: "Unknown error"
---
name: grep
description: "Print lines that match patterns"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','TA0007', 'T1083', 'z-labs']
category: "TEXT-BOF"
OS: cross-platform
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/grep.zig'
examples: '
grep root /etc/passwd
grep ^[^#\n] /etc/hosts
'
arguments:
- name: pattern
desc: "Searched pattern in an extended regular expression syntax"
type: string
required: true
- name: file_path
desc: "Path to the file for searching"
type: string
required: true
errors:
- name: AccessDenied
code: 0x1
message: "Failed to open provided file"
- name: FileNotFound
code: 0x2
message: "File not found"
- name: AntivirusInterference
code: 0x3
message: "Possible Antivirus Interference while opening the file"
- name: FileNotProvided
code: 0x4
message: "No file provided"
- name: StreamTooLong
code: 0x5
message: "File is very large"
- name: UnknownError
code: 0x6
message: "Unknown error"
---
name: find
description: "Search for files in a directory hierarchy. Simple version of find(1) utility"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','TA0007', 'T1083', 'z-labs']
category: "FILES-BOF"
OS: cross-platform
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/find.zig'
examples: '
Considerations:
-maxdepth hardcoded to 3
symbolic links are not followed
one find "test" supported at a time
Find and list unix socket in a given directory:
find /home/user -type s
List files hich have r and w permission for their owner and group and only r for other users, without regard to the presence of any extra permission bits:
find . -perm -664
Search for set-user-ID files and directories, without regard to the presence of any extra permission bits:
find . -perm -4000
List files matching provided regex (match on the whole path, not a search):
find /etc/apt -regex .*archive.*
'
arguments:
- name: dir_path
desc: "path to the directory to be listed"
type: string
required: true
- name: test
desc: "Type of test to conduct, supported: -type|-regex|-perm"
type: string
required: false
- name: test_param
desc: "Parameter for selected test"
type: string
required: false
errors:
- name: AccessDenied
code: 0x1
message: "Failed to open provided file"
- name: FileNotFound
code: 0x2
message: "File not found"
- name: AntivirusInterference
code: 0x3
message: "Possible Antivirus Interference while opening the file"
- name: DirNotProvided
code: 0x4
message: "No directory provided"
- name: TestParamNotProvided
code: 0x5
message: "Test param (e.g. -type *file_type*) not provided"
- name: OutOfMemory
code: 0x6
message: "Not sufficient memory available"
- name: NoSuchTest
code: 0x7
message: "Urecognized test type provided"
- name: BadParameter
code: 0x8
message: "Parameter for chosen test is badly formatted"
- name: UnknownError
code: 0x9
message: "Unknown error"
---
name: "ifconfig"
description: "Displays the status of the currently active network interfaces; Manipulates current state of the device (euid = 0 or CAP_NET_ADMIN is required for that)"
author: "Z-Labs"
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['linux','TA0007', 'T1016','z-labs']
category: 'SAL-BOF'
OS: 'Linux'
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/net-tools/ifconfig.zig'
arguments:
- name: User
desc: "Prints user and group information for this user"
type: string
required: false
examples: '
ifconfig
ifconfig eth0 down
ifconfig eth0 promisc
ifconfig eth0 -promisc
'
---
name: kmodLoader
description: "Loads and unloads Linux kernel modules images directly from memory"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['linux','TA0003', 'TA0004', 'T1547.006', 'DC0031', 'z-labs']
category: "Postex-BOF"
OS: Linux
api:
- 'kmodLoad(module_image: [*]const u8, len: usize, param_values: [*:0]const u8) callconv(.c) u8'
- 'kmodRemove(module_name: [*:0]const u8, flags: u32) callconv(.c) u8'
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/kmodLoader.zig'
examples: '
See BOF-stager for an example of using this BOF.
'
arguments:
- name: module_image
desc: "memory address of kernel image module"
type: string
required: true
api: kmodLoad
- name: len
desc: "size of kernel module image"
type: integer
required: true
api: kmodLoad
- name: param_values
desc: "kernel module parameters in a form of: name[=value[,value...]] for each parameter"
type: string
required: true
api: kmodLoad
- name: module_name
desc: "kernel module name to remove"
type: string
required: true
api: kmodRemove
- name: flags
desc: "special flags"
type: integer
required: true
api: kmodRemove
errors:
- name: NoRootPermissions
code: 0x1
message: "Root privileges are required to load kernel module"
---
name: lskmod
description: "Print the currently loaded kernel modules"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['linux','T0007','T1082', 'z-labs']
category: "SAL-BOF"
OS: Linux
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/lskmod.zig'
examples: '
lskmod
'
errors:
- name: FaileOpenFailure
code: 0x1
message: "Failed to open '/proc/modules' file"
- name: UnknownError
code: 0x2
message: "Unknown error"
---
name: whereami
description: "Print hypervisor vendor signature from CPUID"
author: Z-Labs
Arch: ["x64", "x86"]
tags: ['windows', 'linux','T0007','T1082', 'z-labs']
category: "SAL-BOF"
OS: cross-platform
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/whereami.zig'
examples: '
whereami
'
errors:
- name: UnknownHypervisor
code: 0x1
message: "Unknown vendor signature"
- name: UnknownError
code: 0x2
message: "Unknown error"
---
name: zcat
description: "Print content of a gzip compressed file"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['windows', 'linux','TA0007','T1083', 'z-labs']
category: "FILES-BOF"
OS: cross-platform
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/zcat.zig'
examples: '
zcat /boot/config.gz
'
arguments:
- name: file_path
desc: "path to the file to be printed"
type: string
required: true
errors:
- name: AccessDenied
code: 0x1
message: "Failed to open provided file"
- name: FileNotFound
code: 0x2
message: "File not found"
- name: AntivirusInterference
code: 0x3
message: "Possible Antivirus Interference while opening the file"
- name: FileNotProvided
code: 0x4
message: "No file provided"
- name: StreamTooLong
code: 0x5
message: "File is very large"
- name: UnknownError
code: 0x6
message: "Unknown error"
---
name: dirtypipe
description: "Privilege escalation exploit for 'dirtypipe' vulnerability (CVE-2022-0847) against Linux Kernel"
author: Z-Labs
Arch: ["x64", "x86", "aarch64", "arm"]
tags: ['linux','TA0004', 'T1068', 'z-labs']
category: "Elevation-BOF"
OS: Linux
sources:
- 'https://raw.githubusercontent.com/The-Z-Labs/bof-launcher/main/bofs/src/dirtypipe.zig'
examples: '
Basic usage of the BOF:
dirtypipe /etc/shadow 913 "backdoor:xxx:10123::::::"
Details about vulnerability and PoC exploit (author: Max Kellermann):
https://dirtypipe.cm4all.com/
'
arguments:
- name: file_path
desc: "path to a file that will be overwritten"
type: string
required: true
- name: offset
desc: "offset in overwritten file"
type: string
required: true
- name: data
desc: "data to be written to the provided at provided offset"
type: string
required: true
errors:
- name: FdProcessLimit
code: 0x1
message: "Too many file descriptors for a process"
- name: InvalidPipe
code: 0x2
message: "Pipe is invalid"
- name: PageBoundryOffset
code: 0x3
message: "Page boundry would be crossed (offset % PAGE_SIZE == 0)"
- name: FileOpenFailure
code: 0x4
message: "Failed to open file"
- name: SpliceFailure
code: 0x5
message: "Failure during splicing"
- name: WriteFailure
code: 0x6
message: "Failure during file write"
- name: ShortWrite
code: 0x7
message: "File write not fully complete"
- name: UnknownError
code: 0x8
message: "Unknown error"