Capture `NtFsControlFile` syscall as a new `FsControlFile` event type

Offen
#707 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
30/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
go

Rechercherichtung

Start with the existing ParamDecoder path for the SetFileInformation/RenameFile binary layout, since the issue says FsControlFile should reuse it, and check how the NT Kernel Logger opcode 75 (NtFsControlFile) would be routed to it. Done means NtFsControlFile events are emitted as a new FsControlFile type with the IOCTL code split into DeviceType, Access, Function and Method fields. The open question of whether those sub-fields are exposed separately or bundled is unresolved, so confirm it with a maintainer before writing code.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

needs: docs scope: events/telemetry type: feature

Motivation

Fibratus doesn't currently surface NtFsControlFile calls, which are used to send device I/O control (IOCTL) codes to file system drivers/devices. This syscall is of interest for detecting abuse of raw disk access, filter driver manipulation, reparse point/symlink tricks, and other low-level filesystem interactions that bypass normal file I/O APIs.

Expectation

Fibratus gains a new FsControlFile event type that captures NtFsControlFile invocations, including the IOCTL code being issued.

Proposal

  • Capture the NtFsControlFile syscall and emit it as a new FsControlFile event type. This syscall is emitted by the NT Kernel Logger provider with opcode 75.
  • Reuse the existing binary layout already used for SetFileInformation/RenameFile events, since FsControlFile shares the same underlying structure
  • The key difference is semantic: the info-class parameter in this shared layout represents the IOCTL code for FsControlFile, rather than a file information class. The IOCTL code should be decoded per the standard Windows IOCTL bit layout:
  31                16 15 14 13     2  1   0
  +------------------+-----+---------+-----+
  | DeviceType    |Access| Function |Method|
  +------------------+-----+---------+-----+
       16 bits          2      12 bits   2 bits
  • DeviceType (bits 31–16): identifies the device/driver type the IOCTL targets
  • Access (bits 15–14): required access rights (read/write/either)
  • Function (bits 13–2): the driver-specific function code
  • Method (bits 1–0): the buffering method (buffered, direct in/out, neither)

Decode these four sub-fields from the raw IOCTL code, so filter rules can match on DeviceType/Function individually rather than only the raw numeric code.

Additional context

  • Since the binary layout is shared with SetFileInformation/RenameFile, this should slot into the existing ParamDecoder path for that layout rather than requiring a new decoder. The differentiator is purely in how the info-class field is interpreted and exposed to filters
  • Well-known IOCTL codes (e.g. those tied to FSCTL_SET_REPARSE_POINT, raw volume access, or filter communication ports) are likely good candidates to expose as named constants for rule authors, rather than requiring raw numeric matching
  • Worth checking whether DeviceType/Method/Access decomposition is exposed as separate filterable fields (e.g. file.fsctl.device_type, file.fsctl.method) or bundled into one enriched field. Separate fields would make sequence/detection rules easier to write
Vorherrschende Sprache
Go
Sterne
2.6k
Forks
222
Ø Merge
16 Std. 23 Min.
Gemergte PRs (30 T.)
11

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rabbitstack/fibratus

Alle Issues in rabbitstack/fibratus

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.