From ec25ca9fc76fc679c71c3c7ac7c060dae0bbd4f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 15 Apr 2024 19:59:48 +0800 Subject: [PATCH] Shell: ignore `time` --- src/detection/terminalshell/terminalshell_linux.c | 1 + src/detection/terminalshell/terminalshell_windows.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index d62d7275e..6d46a552a 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -231,6 +231,7 @@ static pid_t getShellInfo(FFShellResult* result, pid_t pid) ffStrEquals(name, "ltrace") || ffStrEquals(name, "perf") || ffStrEquals(name, "guake-wrapped") || + ffStrEquals(name, "time") || ffStrContainsIgnCase(name, "debug") || ffStrContainsIgnCase(name, "not-found") || ffStrEndsWith(name, ".sh") diff --git a/src/detection/terminalshell/terminalshell_windows.c b/src/detection/terminalshell/terminalshell_windows.c index 11f5c4c71..a0d533584 100644 --- a/src/detection/terminalshell/terminalshell_windows.c +++ b/src/detection/terminalshell/terminalshell_windows.c @@ -98,16 +98,14 @@ static uint32_t getShellInfo(FFShellResult* result, uint32_t pid) if( ffStrbufIgnCaseEqualS(&result->prettyName, "sudo") || ffStrbufIgnCaseEqualS(&result->prettyName, "su") || - ffStrbufIgnCaseEqualS(&result->prettyName, "doas") || - ffStrbufIgnCaseEqualS(&result->prettyName, "strace") || ffStrbufIgnCaseEqualS(&result->prettyName, "sshd") || ffStrbufIgnCaseEqualS(&result->prettyName, "gdb") || ffStrbufIgnCaseEqualS(&result->prettyName, "lldb") || - ffStrbufIgnCaseEqualS(&result->prettyName, "guake-wrapped") || ffStrbufIgnCaseEqualS(&result->prettyName, "python") || // python on windows generates shim executables ffStrbufIgnCaseEqualS(&result->prettyName, "fastfetch") || // scoop warps the real binaries with a "shim" exe ffStrbufIgnCaseEqualS(&result->prettyName, "flashfetch") || ffStrbufContainIgnCaseS(&result->prettyName, "debug") || + ffStrbufContainIgnCaseS(&result->prettyName, "time") || ffStrbufStartsWithIgnCaseS(&result->prettyName, "ConEmu") // https://github.com/fastfetch-cli/fastfetch/issues/488#issuecomment-1619982014 ) { ffStrbufClear(&result->processName);