FileCreate event
@MarioHewardt 已经在做这个了。
开始于 2024年6月28日。
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- C
- 星标
- 2.2k
- 派生
- 220
- 平均合并
- 11 天 22 小时
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/SysmonForLinux 的其他 Issue
-
microsoft/SysmonForLinux#238 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 35/100
microsoft/SysmonForLinux#233 ·
-
microsoft/SysmonForLinux#230 · 已指派 1 人 ·
-
microsoft/SysmonForLinux#226 · 已指派 1 人 ·
-
难度 5/5 一周以上 新手友好度 25/100
microsoft/SysmonForLinux#220 · 2 个 reaction ·
查看 microsoft/SysmonForLinux 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
bradcypert/plum#53 ·
-
Component: GLib
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Status: Opened
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
nextbsd/nextbsd-userland#285 ·