microsoft / microsoft/SysmonForLinux

ProcessGUIDs are not necessarily unique, especially for non-PIEs

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

Dieses Issue hat noch niemand übernommen.

investigate
Vorherrschende Sprache
C
Sterne
2.2k
Forks
220
Ø Merge
11 T. 22 Std.
Gemergte PRs (30 T.)
2

Beschreibung

One can reliably create ProcessGUID collisions from different ProcessCreate events by launching non-Position Independent Executables (PIE) within a second. This has been an issue for me, trying to correlate events.

It looks like ProcessGUIDs are created by combining a few pieces of information:

  1. 32 bits for machine ID
  2. 32 bits for process start in Unix time in seconds
  3. 64 bits for the memory address of the end of the text segment, for a process. https://github.com/Sysinternals/SysmonForLinux/blob/main/ebpfKern/sysmonProcCreate.c#L144-L147

Although most executables on Linux distributions are compiled as PIE, it's not a guaranteed and it's not obvious that Sysmon GUID generation could produce duplicates in this scenario.

Perhaps instead of just using something like the text segment location, other data could be packed into the ProcessKey as well. There's 64 bits to work with and these addresses for PIEs will only have ~28 bits of randomness (measured on default Ubuntu systems with paxtest).

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie in ebpfKern/sysmonProcCreate.c etwa bei den Zeilen 144-147 und verfolgen Sie, wie die Maschinen-ID, die Prozessstartzeit und die Adresse des Textsegments die ProcessGUID bilden. Reproduzieren Sie die Kollision, indem Sie nicht-PIE-Executables innerhalb einer Sekunde starten, und ermitteln und dokumentieren Sie anschließend eine ProcessKey-Darstellung, die doppelte ProcessGUIDs für unterschiedliche ProcessCreate-Ereignisse vermeidet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c
Bereich
operating-systems, security
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

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