FileCreate event
@MarioHewardt arbeitet bereits daran.
Seit 28.6.2024.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Describe the bug
When utilizing the creat system call to generate a new file, a FileCreate event is triggered. Conversely, no such event is reported when employing the open system call for file creation. Additionally, attempting to open an already existing file with the creat system call results in a FileCreate event being generated
To Reproduce
I wrote a simple programm to test it.
create a new file with creat system call
#include
#include
#include
int main(int, char**)
{
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
char* pathname = "./test";
int fd = creat(pathname, mode); //A call to creat() is equivalent to calling open() with flags equal to O_CREAT|O_WRONLY|_TRUNC.
if(fd < 0)
{
printf("failed\n");
}
else{
printf("successfull\n");
}
}
create a new file with open system call
#include
#include
#include
int main()
{
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
char* pathname = "./test";
int fd = open(pathname, O_CREAT|O_WRONLY|O_TRUNC, mode); //this is equivalent to creat
if(fd < 0)
{
printf("failed\n");
}
else{
printf("successfull\n");
}
}
Sysmon version
Sysmon v1.3.3
Distro/kernel version
Ubuntu 22.04.2 LTS 6.5.0-28-generic
Sysmon configuration
Additional context
I discovered that Sysmon logs a FileCreate event upon receiving the syscall number __NR_CREAT, and it records a FileOpen event when encountering __NR_OPEN during the open system call. Within the open system call hook point handler, Sysmon evaluates the equivalence of the access, change, and modification times associated with the file. If all these timestamps match and the duration between the event times is under 100 milliseconds, it triggers a FileOpen event (which seemingly contradicts the notion of file creation). Notably, Sysmon does not perform this timestamp comparison in the creat system call hook point, consequently report FileCreate event in each creat system call even if the file already exist.
- Vorherrschende Sprache
- C
- Sterne
- 2.2k
- Forks
- 224
- Ø Merge
- 4 Std. 50 Min.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/Sysmon-Linux
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
microsoft/Sysmon-Linux#253 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
microsoft/Sysmon-Linux#252 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
microsoft/Sysmon-Linux#247 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 12/100
microsoft/Sysmon-Linux#246 · 3 Kommentare ·
-
Sysmon service executable remains `(deleted)` after restart, causing repeated needrestart restarts and systemd start-limit-hitEvtl. wieder frei @MarioHewardt hat das vor 31 Tagen übernommen, und es ist kein Pull Request offen. Offen
microsoft/Sysmon-Linux#244 · 1 zugewiesene Person ·
Alle Issues in microsoft/Sysmon-Linux
Ähnliche Issues
-
Issue-Bug Needs-Triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
ly05010419/MacNativeGames#2001 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area/docdb kind/bug priority/medium status/awaiting-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
yugabyte/yugabyte-db#37426 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area/documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
obsproject/obs-studio#14184 ·
Maintainer antworten meist innerhalb von 1 Tag