FileCreate event
@MarioHewardt y travaille déjà.
Depuis le 28/6/2024.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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.
- Langage dominant
- C
- Étoiles
- 2.2k
- Forks
- 224
- Merge moyen
- 4 h 50 min
- PR mergées (30 j)
- 3
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/Sysmon-Linux
-
ProcessCreate: ParentImage is empty when the parent starts the process from a non-main threadOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
microsoft/Sysmon-Linux#253 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
microsoft/Sysmon-Linux#252 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
microsoft/Sysmon-Linux#247 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 12/100
microsoft/Sysmon-Linux#246 · 3 commentaires ·
-
Sysmon service executable remains `(deleted)` after restart, causing repeated needrestart restarts and systemd start-limit-hitPeut-être à nouveau libre @MarioHewardt l’a pris il y a 31 jours, et aucune pull request n’est ouverte. Ouverte
microsoft/Sysmon-Linux#244 · 1 personne assignée ·
Toutes les issues de microsoft/Sysmon-Linux
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
ly05010419/MacNativeGames#2001 ·
Les mainteneurs répondent en général sous 1 jour
-
area/docdb kind/bug priority/medium status/awaiting-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
yugabyte/yugabyte-db#37426 ·
Les mainteneurs répondent en général sous 1 jour
-
area/documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
obsproject/obs-studio#14184 ·
Les mainteneurs répondent en général sous 1 jour
-
extension-modules type-bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
30-minutes algorithm any-language beginner-friendly c community cpp csharp data-structures go good first issue hacktoberfest help wanted kotlin learning leetcode php ruby rust swift
Difficulté 2/5 Moins d'une heure Accessibilité débutants 85/100
Huerte/algo-solutions-python#211 ·
Les mainteneurs répondent en général sous 1 jour