지니언 EDR 로그에서 rundll32 사용자 DLL 로더 실행과 광범위한 정찰, 공용 폴더 DLL의 PowerShell 로드, 원격 세션 파일 전송 중 한 축이 다른 침투 행위와 겹치는 Wizard Spider/Sandworm형 침투 체인을 탐지합니다.
Overview
Query
1table duration=30m EDR_GENIAN
2| search (_schema == "genian-edr-file" and in(event_subtype, "FileCreate", "FileDelete", "FileMove"))
3 or (_schema == "genian-edr-module" and event_subtype == "DllInjected")
4 or (_schema == "genian-edr-network" and event_subtype == "NetworkConnect")
5 or (_schema == "genian-edr-process" and in(event_subtype, "ProcessStart", "RequestProcessCreate"))
6 or (_schema == "genian-edr-reg" and event_subtype == "RegSetValue")
7| search len(trim(hostname)) > 0
8| eval psrc = if(len(trim(image_path)) > 0, trim(image_path), trim(image))
9| eval proc = lower(substr(psrc, lastindexof(psrc, "\\") + 1)), ipath = lower(psrc), cmd_l = lower(nvl(cmd_line, "")),
10 i_dir = if(lastindexof(psrc, "\\") >= 0, lower(substr(psrc, 0, lastindexof(psrc, "\\"))), ""),
11 par = lower(nvl(substr(parent_image, lastindexof(parent_image, "\\") + 1), "")), hostname = lower(trim(hostname))
12| eval b64 = if(in(proc, "powershell.exe", "pwsh.exe"), valueof(groups(cmd_line, "(?i)(?:^|\\s)\"?-(?:e|ec|en|enc|enco|encod|encode|encoded|encodedc|encodedco|encodedcom|encodedcomm|encodedcomma|encodedcomman|encodedcommand)\"?\\s+\"?([a-z0-9+/]{20,}={0,2})\"?(?:\\s|$)"), 0), null)
13| eval ps_text = if(in(proc, "powershell.exe", "pwsh.exe"), lower(concat(cmd_line, " ", nvl(decode(frombase64(substr(b64, 0, len(b64) - mod(len(b64), 4))), "UTF-16LE"), ""))), cmd_l)
14| eval fpath = lower(nvl(file_path, "")), f_dir = if(lastindexof(file_path, "\\") >= 0, lower(substr(file_path, 0, lastindexof(file_path, "\\"))), "")
15| eval rkey = lower(nvl(reg_key_path, "")), vname = lower(nvl(reg_value_name, "")), rval = lower(nvl(reg_value, ""))
16| eval grp = case(
17 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (proc == "rundll32.exe" and match(cmd_l, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\[^\\r\\n]*?\\.(?:dll|ocx|cpl|dat|bin|tmp)\\b")), "rundll",
18 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "dllimport") and match(ps_text, "(?:\\\\users\\\\public\\\\|\\\\users\\\\[^\\\\]+\\\\appdata\\\\|\\\\programdata\\\\|\\\\windows\\\\temp\\\\|\\\\perflogs\\\\|\\\\temp\\\\|\\\\tmp\\\\|\\\\downloads\\\\)[^\"\\r\\n]*\\.dll")), "pubload",
19 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "copy-item\\b[\\s\\S]*-(?:tosession|fromsession)\\b")), "lateralpush",
20 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (match(cmd_l, "hashcat(?:64)?(?:\\.exe|\\.bin)?\\s+-[a-z]") or match(cmd_l, "(?:^|[\\s/\\\\])john(?:\\.exe)?\\s+[^\\r\\n]*--(?:wordlist|format|show|rules)\\b") or match(cmd_l, "hashcat\\.(?:txt|out|log|potfile)\\b|\\.potfile\\b|john\\.pot\\b")), "pwcrack",
21 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "python.exe", "pythonw.exe", "python3.exe", "py.exe") and (match(ipath, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\") or match(cmd_l, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\[^\"\\s]*\\.pyw?\\b") or match(cmd_l, "\\s-c\\s[\\s\\S]*(?:urllib|urlopen|requests\\.get|socket\\.|base64\\.b64decode|exec\\(|subprocess)"))), "inject",
22 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "add-type[\\s\\S]*dllimport|dllimport[\\s\\S]*add-type")), "nativeapi",
23 _schema == "genian-edr-file" and event_subtype == "FileCreate" and ((match(fpath, "\\.(?:exe|dll|sys|scr|cpl|bat|cmd|ps1|vbs|vbe|js|jse|wsf|hta)$") or (nvl(file_type, "") == "PE" and not(match(fpath, "\\.[a-z0-9]{2,4}$")))) and (indexof(fpath, "c:\\users\\public\\") == 0 or indexof(fpath, "c:\\perflogs\\") == 0 or in(f_dir, "c:\\programdata", "c:\\windows\\temp")) and not(match(fpath, "\\\\__psscriptpolicytest_[^\\\\]+\\.ps1$")) and not(in(proc, "msiexec.exe", "trustedinstaller.exe", "tiworker.exe", "mpsigstub.exe", "mpcmdrun.exe", "msmpeng.exe", "dismhost.exe", "system"))), "drop",
24 _schema == "genian-edr-file" and event_subtype == "FileDelete" and (match(proc, "^(?:msmpeng|mssense|sentinelagent|csfalconservice|cylancesvc|mcshield|bdservicehost|savservice|sophos|ekrn|avp\\.exe|ntrtscan|tmbmsrv|cbdefense|repmgr|xagt|elastic-endpoint|vsserv|ccsvchst|avastsvc|v3svc|ayagent)") and match(fpath, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\") and match(fpath, "\\.(?:exe|dll|scr|com|pif|cpl|sys|swf|jar|js|jse|vbs|vbe|wsf|hta|ps1|bat|cmd|lnk|docm|xlsm|zip|rar|7z|iso|img|txt)$") and not(match(fpath, "^c:\\\\programdata\\\\microsoft\\\\"))), "avquar",
25 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "systeminfo.exe", "hostname.exe") or (proc == "wmic.exe" and match(cmd_l, "\\b(?:os|computersystem|bios|qfe|csproduct|path\\s+win32_(?:operatingsystem|bios|baseboard|computersystemproduct))\\b[\\s\\S]*\\b(?:get|list)\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "getnativesysteminfo|getsysteminfo\\b|get-computerinfo|win32_operatingsystem|\\.partofdomain\\b|dllimport[\\s\\S]*\\b(?:getlogicaldrivestringsw?|getdrivetypew?|getlogicaldrives)\\b"))), "sysinfo",
26 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "whoami.exe", "quser.exe") or (proc == "query.exe" and match(cmd_l, "\\bquery(?:\\.exe)?\"?\\s+(?:user|session)\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "windowsidentity\\]::getcurrent\\(\\)[\\s\\S]*isinrole|isinrole\\([\\s\\S]*administrator")) or (in(proc, "wmic.exe", "powershell.exe", "pwsh.exe") and match(ps_text, "\\b(?:win32_logonsession|win32_loggedonuser)\\b"))), "user",
27 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "sc.exe" and match(cmd_l, "\\s(?:query|queryex|qc|qdescription|enumdepend)\\b")) or (proc == "tasklist.exe" and match(cmd_l, "\\s/svc\\b")) or ((proc == "net.exe" or (proc == "net1.exe" and par != "net.exe")) and match(cmd_l, "\\bnet1?(?:\\.exe)?\"?\\s+start\\s*$")) or (proc == "wmic.exe" and match(cmd_l, "\\bservice\\b[\\s\\S]*\\b(?:get|list)\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "get-service\\b|win32_service\\b"))), "svcdisc",
28 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (((proc == "net.exe" or (proc == "net1.exe" and par != "net.exe")) and match(cmd_l, "\\bnet1?(?:\\.exe)?\"?\\s+(?:user|users|accounts)\\b") and not(match(cmd_l, "/(?:add|del|delete|do|dom|doma|domai|domain)\\b"))) or (proc == "wmic.exe" and match(cmd_l, "\\buseraccount\\b[\\s\\S]*\\b(?:get|list)\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "get-localuser\\b|get-aduser\\b|win32_useraccount\\b"))), "acct",
29 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (proc == "netstat.exe" or ((proc == "net.exe" or (proc == "net1.exe" and par != "net.exe")) and match(cmd_l, "\\bnet1?(?:\\.exe)?\"?\\s+(?:session|sessions|use)\\s*$")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "get-nettcpconnection\\b|get-netudpendpoint\\b|get-smbsession\\b"))), "netconn",
30 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "ipconfig.exe", "nbtstat.exe", "getmac.exe") or (proc == "route.exe" and match(cmd_l, "\\bprint\\b")) or (proc == "arp.exe" and match(cmd_l, "\\s-[ag]\\b")) or (proc == "netsh.exe" and match(cmd_l, "\\b(?:interface\\s+(?:ip|ipv4)?\\s*show|wlan\\s+show|(?:advfirewall\\s+(?:firewall\\s+)?|firewall\\s+)show|ip\\s+show\\s+config)\\b")) or (proc == "wmic.exe" and match(cmd_l, "\\b(?:nicconfig|nic|win32_networkadapterconfiguration|win32_ip4routetable)\\b[\\s\\S]*\\b(?:get|list)\\b")) or (proc == "nltest.exe" and match(cmd_l, "[/-]dsgetdc\\b"))), "netconf",
31 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((in(proc, "tasklist.exe", "qprocess.exe") and not(contains(cmd_line, "/?"))) or (proc == "query.exe" and match(cmd_l, "\\bquery(?:\\.exe)?\"?\\s+process\\b")) or (proc == "wmic.exe" and match(cmd_l, "\\bprocess\\b[\\s\\S]*\\b(?:get|list)\\b") and not(match(cmd_l, "\\bcall\\b"))) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "get-process|\\bgps\\b") and match(ps_text, "(?:msmpeng|mssense|sentinelagent|csfalconservice|cylancesvc|mcshield|bdservicehost|savservice|sophos|ekrn|avp\\.exe|ntrtscan|tmbmsrv|cbdefense|repmgr|xagt|elastic-endpoint|vsserv|ccsvchst|avastsvc|v3svc|ayagent)[\\s\\S]*(?:msmpeng|mssense|sentinelagent|csfalconservice|cylancesvc|mcshield|bdservicehost|savservice|sophos|ekrn|avp\\.exe|ntrtscan|tmbmsrv|cbdefense|repmgr|xagt|elastic-endpoint|vsserv|ccsvchst|avastsvc|v3svc|ayagent)"))), "procdisc",
32 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "cmd.exe", "powershell.exe", "pwsh.exe", "where.exe", "tree.com", "wmic.exe") and match(ps_text, "\\b(?:cim_datafile|cim_directory|win32_directory)\\b[\\s\\S]*\\bget\\b|\\bdir\\b[^|&\\r\\n]*\\s/s\\b|\\btree(?:\\.com)?\\b[^|&\\r\\n]*\\s/f\\b|\\bwhere(?:\\.exe)?\\s+/r\\s|get-childitem[^|\\r\\n]*-recurse|\\bgci\\b[^|\\r\\n]*-recurse|dllimport[\\s\\S]*\\bfind(?:first|next)filew?\\b")), "filedisc",
33 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "nltest.exe" and match(cmd_l, "[/-](?:dclist|parentdomain|dnsgetdc)\\b")) or proc == "adfind.exe" or (in(proc, "powershell.exe", "pwsh.exe", "cmd.exe") and match(ps_text, "adfind(?:\\.exe)?\"?\\s+-")) or (proc == "dsquery.exe" and match(cmd_l, "dsquery(?:\\.exe)?\"?\\s+(?:computer|server)\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "get-adcomputer\\b|get-addomaincontroller\\b|get-netcomputer\\b|get-domaincomputer\\b"))), "remotesys",
34 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (((proc == "net.exe" or (proc == "net1.exe" and par != "net.exe")) and match(cmd_l, "\\bnet1?(?:\\.exe)?\"?\\s+user\\s+\\S+[\\s\\S]*\\s/add\\b") and not(match(cmd_l, "/do(?:m|ma|mai|main)?\\b"))) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "new-localuser\\b|\\[adsi\\][\\s\\S]*winnt://[\\s\\S]*create\\(\\s*['\"]user"))), "localacct",
35 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (((proc == "net.exe" or (proc == "net1.exe" and par != "net.exe")) and match(cmd_l, "\\bnet1?(?:\\.exe)?\"?\\s+localgroup\\b")) or (proc == "wmic.exe" and match(cmd_l, "\\bgroup\\b[\\s\\S]*\\b(?:get|list)\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "get-localgroup(?:member)?\\b|add-localgroupmember\\b|win32_group\\b"))), "localgroup",
36 _schema == "genian-edr-reg" and event_subtype == "RegSetValue" and (match(rkey, "\\\\software\\\\(?:wow6432node\\\\)?microsoft\\\\windows\\\\currentversion\\\\(?:run|runonce|runonceex|runservices|runservicesonce|policies\\\\explorer\\\\run)$") and match(rval, "c:\\\\users\\\\public\\\\|c:\\\\perflogs\\\\|\\\\windows\\\\temp\\\\|\\\\appdata\\\\local\\\\temp\\\\|%temp%|%public%|https?://|(?:^|\\\\|\")(?:powershell|pwsh|mshta|wscript|cscript|rundll32|regsvr32)(?:\\.exe)?\"?\\s")), "runkey",
37 _schema == "genian-edr-reg" and event_subtype == "RegSetValue" and (match(rkey, "\\\\software\\\\(?:wow6432node\\\\)?microsoft\\\\windows\\\\currentversion\\\\runonceex\\\\[^\\\\]+\\\\depend$")), "runkey",
38 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "schtasks.exe" and match(cmd_l, "[/-]create\\b") and match(cmd_l, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\|%(?:temp|tmp|appdata|public|programdata)%|/tr\\s+\"?[^/]*(?:powershell|pwsh|mshta|wscript|cscript|rundll32|regsvr32|cmd)(?:\\.exe)?\\b|/ru\\s+\"?(?:system|nt authority)")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "(?:^|[^a-z])register-scheduledtask") and match(ps_text, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\|-execute\\s+['\"]?[^'\"\\s]*(?:powershell|pwsh|mshta|wscript|cscript|rundll32|regsvr32|cmd)(?:\\.exe)?\\b|-user(?:id)?\\s+['\"]?(?:system|nt authority)"))), "schtask",
39 _schema == "genian-edr-reg" and event_subtype == "RegSetValue" and ((match(rkey, "\\\\microsoft\\\\windows nt\\\\currentversion\\\\winlogon$") and in(vname, "shell", "userinit", "taskman", "vmapplet", "appsetup") and (match(rval, "c:\\\\users\\\\public\\\\|c:\\\\perflogs\\\\|\\\\windows\\\\temp\\\\|\\\\appdata\\\\|%temp%|%public%|https?://|(?:^|,|\\\\\\\\)(?:powershell|pwsh|mshta|wscript|cscript|rundll32|regsvr32|cmd)(?:\\.exe)?\\\\b") or match(rval, ",[^,]*\\.(?:exe|dll|bat|cmd|ps1|vbs|scr|com)\\\\b"))) or match(rkey, "\\\\microsoft\\\\windows nt\\\\currentversion\\\\winlogon\\\\notify\\\\")), "winlogon",
40 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "rundll32.exe" and match(cmd_l, "comsvcs(?:\\.dll)?[\\s\\S]*minidump|#\\+?24\\b")) or (in(proc, "procdump.exe", "procdump64.exe", "procdump64a.exe") and match(cmd_l, "\\s-m[ap]\\b[\\s\\S]*lsass|lsass[\\s\\S]*\\s-m[ap]\\b")) or in(proc, "mimikatz.exe", "nanodump.exe", "pypykatz.exe") or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "invoke-mimikatz|sekurlsa::|lsadump::|comsvcs(?:\\.dll)?[\\s\\S]*minidump|minidumpwritedump|out-minidump"))), "lsass",
41 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "reg.exe" and match(cmd_l, "\\\\b(?:save|export)\\\\b") and match(cmd_l, "hk(?:lm|ey_local_machine)\\\\\\\\(?:sam|system|security)\\\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "reg(?:\\.exe)?\\\\s+(?:save|export)\\\\b[\\\\s\\\\S]{0,40}(?:sam|system|security)\\\\b")) or (proc == "esentutl.exe" and match(cmd_l, "/y\\\\b") and match(cmd_l, "sam|system|security|ntds"))), "samdump",
42 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (proc == "ntdsutil.exe" or (proc == "vssadmin.exe" and match(cmd_l, "\\\\bcreate\\\\b") and match(cmd_l, "\\\\bshadow\\\\b")) or (proc == "wbadmin.exe" and match(cmd_l, "\\\\bstart\\\\b") and match(cmd_l, "backup")) or (in(proc, "cmd.exe", "powershell.exe", "pwsh.exe", "esentutl.exe") and match(ps_text, "ntds\\.dit")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "ntdsutil"))), "ntds",
43 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (proc == "rubeus.exe" or match(cmd_l, "\\b(?:kerberoast(?:ing)?|asreproast(?:ing)?)\\b") or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "invoke-kerberoast|invoke-rubeus|kerberosrequestorsecuritytoken|\\b(?:kerberoast(?:ing)?|asreproast(?:ing)?)\\b"))), "kerberoast",
44 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "esentutl.exe" and match(cmd_l, "[/-]y\\b") and match(cmd_l, "webcache|login data|cookies|web data|\\\\user data\\\\|\\\\profiles\\\\")) or (in(proc, "cmd.exe", "powershell.exe", "pwsh.exe", "robocopy.exe", "xcopy.exe") and match(ps_text, "\\b(?:copy|copy-item|cp|cpi|xcopy|robocopy|esentutl)\\b[^\\r\\n]*(?:\\\\user data\\\\[^\\r\\n]*(?:login data|cookies|web data|local state)|key4\\.db|logins\\.json|webcachev01\\.dat)"))), "browsercred",
45 _schema == "genian-edr-process" and event_subtype == "RequestProcessCreate" and ((in(proc, "python.exe", "pythonw.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe") or match(ipath, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\")) and match(cmd_l, "(?:^|\\\\|\")(?:cmd|powershell|pwsh)(?:\\.exe)?\"?\\s")), "token",
46 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "(?:new-pssession|enter-pssession)\\b[\\s\\S]*-computername\\b|invoke-command\\b[\\s\\S]*-(?:computername|session)\\b")) or (proc == "winrs.exe" and match(cmd_l, "[-/]r(?:emote)?:"))), "winrm",
47 _schema == "genian-edr-module" and event_subtype == "DllInjected" and (match(fpath, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\") and match(fpath, "\\.dll$")), "reflect",
48 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and not(match(ipath, "runc")) and (match(ipath, "^/proc/(?:self|[0-9]+)/fd/[0-9]+$") or indexof(ipath, "memfd:") == 0 or match(cmd_l, "memfd_create|(?:^|\\s)/proc/(?:self|[0-9]+)/fd/[0-9]+(?:\\s|$)"))), "reflect",
49 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "start-hollow\\s+-|-sponsor\\s+['\"]?[a-z]:[^\\r\\n]*-hollow\\s|\\b(?:nt|zw)unmapviewofsection\\b")), "hollow",
50 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "set-mppreference[\\s\\S]*-disable(?:realtimemonitoring|behaviormonitoring|ioavprotection|scriptscanning|blockatfirstseen|intrusionpreventionsystem|archivescanning)\\s+\\W?(?:true|1)\\b|add-mppreference[\\s\\S]*-exclusion(?:path|process|extension)\\b")) or (proc == "reg.exe" and match(cmd_l, "\\badd\\b[\\s\\S]*windows defender[\\s\\S]*/v\\s+\"?disable(?:antispyware|antivirus|realtimemonitoring|behaviormonitoring|onaccessprotection|scanonrealtimeenable|ioavprotection)\"?[\\s\\S]*/d\\s+\"?1\\b")) or (in(proc, "sc.exe", "net.exe", "net1.exe") and match(cmd_l, "\\b(?:stop|delete|config)\\s+\"?(?:windefend|sense|wdnissvc|wdboot|wdfilter|wscsvc|securityhealthservice)\\b")) or (proc == "taskkill.exe" and match(cmd_l, "(?:msmpeng|mssense|sentinelagent|csfalconservice|cylancesvc|mcshield|bdservicehost|savservice|sophos|ekrn|avp\\.exe|ntrtscan|tmbmsrv|cbdefense|repmgr|xagt|elastic-endpoint|vsserv|ccsvchst|avastsvc|v3svc|ayagent)"))), "defimpair",
51 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (((in(proc, "net.exe", "net1.exe") and match(cmd_l, "\\\\bstop\\\\b")) or (proc == "sc.exe" and match(cmd_l, "\\\\b(?:stop|config)\\\\b")) or (proc == "taskkill.exe" and match(cmd_l, "/im\\\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "stop-service\\\\b|set-service\\\\b[\\\\s\\\\S]*stopped"))) and match(ps_text, "sql|veeam|backupexec|backup exec|acronis|sophos|mssql|msexchange|exchange|memtas|mepocs|sage|agntsvc|encsvc|xfssvccon|dbsnmp|dbeng|ocssd|ocautoupds|sqbcoreservice|macmnsvc|mcafee|savservice|wbengine|storagecraft|vmms|veeamdeploy")), "servicestop",
52 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "vssadmin.exe" and match(cmd_l, "\\bdelete\\s+shadows\\b|\\bresize\\s+shadowstorage\\b")) or (proc == "wmic.exe" and match(cmd_l, "shadowcopy[\\s\\S]*\\bdelete\\b")) or (proc == "bcdedit.exe" and match(cmd_l, "recoveryenabled\\s+no|bootstatuspolicy\\s+ignoreallfailures")) or (proc == "wbadmin.exe" and match(cmd_l, "\\bdelete\\s+(?:catalog|systemstatebackup|backup)\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "win32_shadowcopy[\\s\\S]*(?:\\.delete\\(\\)|remove-(?:cim|wmi)(?:instance|object))|remove-(?:cim|wmi)(?:instance|object)[\\s\\S]*win32_shadowcopy|vssadmin[^\\r\\n]*delete\\s+shadows"))), "shadow",
53 _schema == "genian-edr-file" and in(event_subtype, "FileCreate", "FileMove") and (match(fpath, "\\.(?:conti|vanhelsing|vanlocker|locked|lockbit|encrypted|crypted|ryk|babyk|akira|royal|basta|hive|clop|medusa|rhysida|8base|phobos|makop|djvu)$") or match(fpath, "\\\\(?:how[_-]?to[_-]?(?:decrypt|restore|recover)|restore[_-]?(?:my[_-]?)?files|decrypt[_-]?(?:my[_-]?)?files|readme[_-]?(?:for[_-]?)?decrypt|_readme_|ransom)[^\\\\]*\\.(?:txt|html?|hta)$")), "ransom",
54 _schema == "genian-edr-reg" and event_subtype == "RegSetValue" and (match(rkey, "\\\\control panel\\\\desktop$|\\\\policies\\\\system$|\\\\policies\\\\activedesktop$") and vname == "wallpaper" and not(in(proc, "explorer.exe", "systemsettings.exe", "systemsettingsadminflows.exe", "svchost.exe"))), "deface",
55 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "remove-item|\\bdel\\b|\\bri\\b|\\brm\\b") and match(ps_text, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\windows\\\\temp|c:\\\\programdata)\\\\[^\\r\\n\"']*\\.(?:exe|dll|sys|ps1|bat|cmd|vbs|js|jse|hta|cs|bin|zip|7z|rar)\\b")) or (proc == "cmd.exe" and match(cmd_l, "\\b(?:del|erase)\\b[^&|]*(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\windows\\\\temp|c:\\\\programdata|%temp%|\\\\appdata\\\\local\\\\temp)\\\\[^&|\"]*\\.(?:exe|dll|sys|ps1|bat|cmd|vbs|js|jse|hta|bin)\\b")) or in(proc, "sdelete.exe", "sdelete64.exe")), "wipe",
56 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "wevtutil.exe" and match(cmd_l, "\\s(?:cl|clear-log)\\s")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "clear-eventlog\\b|remove-eventlog\\b|\\.clearlog\\(|wevtutil(?:\\.exe)?\\s+(?:cl|clear-log)\\s"))), "logclear",
57 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "(?:invoke-(?:webrequest|restmethod)|\\biwr\\b|\\birm\\b)[\\s\\S]*-method\\s+['\"]?(?:post|put)\\b[\\s\\S]*-(?:infile|body)\\b|(?:invoke-(?:webrequest|restmethod)|\\biwr\\b|\\birm\\b)[\\s\\S]*-(?:infile|body)\\b[\\s\\S]*-method\\s+['\"]?(?:post|put)\\b|\\.upload(?:file|data|string)(?:async)?\\s*\\(")) or (proc == "curl.exe" and match(cmd_l, "(?:^|\\s)(?:-t|--upload-file)\\s+\\S|(?:^|\\s)(?:-f|--form)\\s+['\"]?[^\\s'\"]*=@|(?:^|\\s)(?:--data-binary|-d|--data)\\s+['\"]?@")) or (proc == "bitsadmin.exe" and match(cmd_l, "/transfer\\b[\\s\\S]*/upload\\b"))), "exfil",
58 _schema == "genian-edr-network" and event_subtype == "NetworkConnect" and (in(proc, "powershell.exe", "pwsh.exe", "mshta.exe", "wscript.exe", "cscript.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe", "bitsadmin.exe") and isnotnull(remote_ip) and not(match(remote_ip, "^(?:10\\.|127\\.|192\\.168\\.|172\\.(?:1[6-9]|2\\d|3[01])\\.|169\\.254\\.|0\\.|::1|fe80)"))), "webc2",
59 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "powershell.exe", "pwsh.exe") and match(cmd_line, "(?i)(?:^|\\s)\"?-(?:ep|ex|exe|exec|execu|execut|executi|executio|execution|executionp|executionpo|executionpol|executionpoli|executionpolic|executionpolicy)\"?\\s+\"?bypass\"?(?:\\s|$)") and (isnotnull(b64) or match(cmd_l, "(?:^|\\s)\"?-(?:f|fi|fil|file)\"?\\s+\"?(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\windows\\\\temp|c:\\\\programdata|c:\\\\users\\\\[^\\\\]+\\\\appdata\\\\local\\\\temp)\\\\"))), "psbypass")
60| search isnotnull(grp)
61| eval tech = case(grp == "rundll", "T1218.011", grp == "pubload", "T1620", grp == "lateralpush", "T1570", grp == "pwcrack", "T1110.002", grp == "inject", "T1059.006", grp == "nativeapi", "T1106", grp == "drop", "T1105", grp == "avquar", "T1587.001", grp == "sysinfo", "T1082", grp == "user", "T1033", grp == "svcdisc", "T1007", grp == "acct", "T1087", grp == "netconn", "T1049", grp == "netconf", "T1016", grp == "procdisc", "T1057", grp == "filedisc", "T1083", grp == "remotesys", "T1018", grp == "localacct", "T1136.001", grp == "localgroup", "T1069.001", grp == "runkey", "T1547.001/T1547.001", grp == "schtask", "T1053.005", grp == "winlogon", "T1547.004", grp == "lsass", "T1003.001", grp == "samdump", "T1003.002", grp == "ntds", "T1003.003", grp == "kerberoast", "T1558.003", grp == "browsercred", "T1555.003", grp == "token", "T1134.001", grp == "winrm", "T1021.006", grp == "reflect", "T1620/T1620", grp == "hollow", "T1055.012", grp == "defimpair", "T1685", grp == "servicestop", "T1489", grp == "shadow", "T1490", grp == "ransom", "T1486", grp == "deface", "T1491", grp == "wipe", "T1070.004", grp == "logclear", "T1685.005", grp == "exfil", "T1041", grp == "webc2", "T1071.001", grp == "psbypass", "T1059.001")
62| eval anchor_g = if(in(grp, "rundll", "pubload", "lateralpush"), grp, null), disc_g = if(in(grp, "sysinfo", "user", "svcdisc", "acct", "netconn", "netconf", "procdisc", "filedisc", "remotesys"), grp, null), has_rundll_v = if(grp == "rundll", 1, 0), has_pubload_v = if(grp == "pubload", 1, 0), has_lateralpush_v = if(grp == "lateralpush", 1, 0)
63| stats dc(grp) as grp_cnt, dc(anchor_g) as anchor_cnt, dc(disc_g) as disc_cnt, max(has_rundll_v) as has_rundll, max(has_pubload_v) as has_pubload, max(has_lateralpush_v) as has_lateralpush, values(grp) as groups, values(tech) as techs, min(_time) as first_seen, max(_time) as last_seen by hostname, host_ip
64| search (has_rundll == 1 and disc_cnt >= 4 and grp_cnt >= 6) or (has_pubload == 1 and grp_cnt >= 5) or (has_lateralpush == 1 and grp_cnt >= 4)
65| eval groups = strjoin(", ", groups), techs = strjoin(", ", techs),
66 first_seen = string(first_seen, "yyyy-MM-dd HH:mm:ss"), last_seen = string(last_seen, "yyyy-MM-dd HH:mm:ss")
10분마다 직전 30분의 지니언 EDR 프로세스·파일·레지스트리·네트워크·모듈 로그를 조회하여, 각 이벤트를 조건에 따라 행위군(grp)으로 분류하고 해당하는 MITRE 기법 번호(tech)를 붙입니다. 이후 hostname·host_ip별로 서로 다른 행위군 수(grp_cnt)와 필수 행위군 수(anchor_cnt)를 집계합니다. 세 조건 중 하나를 충족하면 탐지합니다. 첫째, rundll32의 사용자 쓰기 위치 DLL 실행이 있고 정찰 행위군이 4개 이상(disc_cnt)이며 서로 다른 행위군이 6개 이상인 경우입니다. 둘째, PowerShell이 사용자 쓰기 위치 DLL을 P/Invoke로 로드하고 서로 다른 행위군이 5개 이상인 경우입니다. 셋째, PowerShell 원격 세션으로 다른 호스트에 파일을 전송하고 서로 다른 행위군이 4개 이상인 경우입니다. 탐지 결과에는 관찰된 행위군 목록(groups)과 기법 목록(techs), 첫 발생 시각(first_seen)과 마지막 발생 시각(last_seen)을 함께 제공합니다.
Threat analysis
로더 악성코드가 rundll32로 실행된 뒤 광범위한 정찰을 수행하고, 후속 악성코드가 자격 증명을 탈취해 도메인 컨트롤러로 이동한 다음 랜섬웨어를 배포하는 흐름은 Emotet·Trickbot·Ryuk로 이어지는 침투 체인의 전형입니다. 각 단계는 서로 다른 시점에 진행될 수 있으므로 세 조건을 독립적으로 판정하며, 원격 세션 파일 전송이 탐지되면 도메인 컨트롤러 침해 여부를 우선 확인합니다.
False positives
관리자가 PowerShell 원격 세션으로 서버에 파일을 복사하고 조회 명령을 실행하는 경우 셋째 조건이 충족될 수 있습니다. 관리 단말은 hostname과 실행 계정 기준으로 예외 조건을 추가하고, 운영 스크립트가 공용 폴더의 DLL을 로드하는 경우 경로 기준으로 조정합니다.
Response actions
groups에서 탐지 조건을 충족한 행위군을 확인합니다. rundll32가 실행한 DLL과 내려받기 주소, P/Invoke로 로드된 DLL, 원격 세션의 대상 호스트와 전송 파일을 각각 확인합니다. 정탐으로 확인되면 단말을 격리하고, 대상이 도메인 컨트롤러라면 NTDS 접근 이력과 도메인 관리자 계정 사용 이력을 조회합니다.