지니언 EDR 로그에서 DLL 주입 도구 실행과 압축 해제 뒤 보안 기능 무력화·로그 삭제·암호화로 이어지는 Rhysida 랜섬웨어 실행 준비를 탐지합니다.
개요
쿼리
1table duration=30m EDR_GENIAN
2| search (_schema == "genian-edr-file" and in(event_subtype, "FileCreate", "FileMove"))
3 or (_schema == "genian-edr-process" and event_subtype == "ProcessStart")
4 or (_schema == "genian-edr-reg" and event_subtype == "RegSetValue")
5| search len(trim(hostname)) > 0
6| eval psrc = if(len(trim(image_path)) > 0, trim(image_path), trim(image))
7| eval proc = lower(substr(psrc, lastindexof(psrc, "\\") + 1)), ipath = lower(psrc), cmd_l = lower(nvl(cmd_line, "")),
8 i_dir = if(lastindexof(psrc, "\\") >= 0, lower(substr(psrc, 0, lastindexof(psrc, "\\"))), ""),
9 par = lower(nvl(substr(parent_image, lastindexof(parent_image, "\\") + 1), "")), hostname = lower(trim(hostname))
10| 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)
11| 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)
12| eval fpath = lower(nvl(file_path, "")), f_dir = if(lastindexof(file_path, "\\") >= 0, lower(substr(file_path, 0, lastindexof(file_path, "\\"))), "")
13| eval rkey = lower(nvl(reg_key_path, "")), vname = lower(nvl(reg_value_name, "")), rval = lower(nvl(reg_value, ""))
14| eval grp = case(
15 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (match(ipath, "\\.exe$") and match(ipath, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\") and match(cmd_l, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\[^\"\\s]*\\.dll\\b")), "inject",
16 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((in(proc, "powershell.exe", "pwsh.exe") and (match(ps_text, "(?:compress|expand)-archive\\b[^\\r\\n]*(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\windows\\\\temp|c:\\\\programdata\\\\[^\\\\\"]+\\.zip)") or (match(ps_text, "compress-archive\\b") and match(ps_text, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\windows\\\\temp|c:\\\\programdata)\\\\[^\\\\\"]+\\.zip")))) or (in(proc, "7z.exe", "7za.exe", "7zr.exe", "rar.exe", "winrar.exe", "tar.exe", "makecab.exe") and match(cmd_l, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\") and not(par == "tiworker.exe"))), "archive",
17 _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",
18 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "netsh.exe" and match(cmd_l, "\\b(?:advfirewall\\s+(?:firewall\\s+(?:add|set)\\s+rule|set\\s+\\w+profile\\s+state\\s+off)|firewall\\s+(?:add|set)\\s+(?:allowedprogram|portopening|opmode\\s+(?:mode=)?disable))")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "new-netfirewallrule\\b|set-netfirewallprofile\\b[\\s\\S]*-enabled\\s+\\W?(?:false|0)\\b|set-netfirewallrule\\b[\\s\\S]*-action\\s+allow|hnetcfg\\.fwpolicy2"))), "firewall",
19 _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",
20 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (((proc == "reg.exe" and match(cmd_l, "\\s(?:add|delete|import)\\s")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "(?:set|new)-itemproperty\\b|\\bsp\\s+-path|remove-itemproperty\\b"))) and match(ps_text, "policies\\\\microsoft\\\\windows defender|control panel\\\\desktop[\\s\\S]*wallpaper|policies\\\\system\\b|image file execution options|control\\\\lsa\\b|securityproviders\\\\wdigest|terminal server[\\s\\S]*fdenytsconnections|safeboot|currentversion\\\\winlogon")), "regmod",
21 _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",
22 _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)$")), "encrypt",
23 _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",
24 _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",
25 _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)"))), "proclist",
26 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "wmic.exe" and match(cmd_l, "securitycenter2|antivirusproduct|antispywareproduct|firewallproduct")) or (in(proc, "powershell.exe", "pwsh.exe") and (match(ps_text, "securitycenter2|antivirusproduct|get-mpcomputerstatus") or 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)")))), "secsw",
27 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (((proc == "net.exe" or (proc == "net1.exe" and par != "net.exe")) and match(cmd_l, "\\s(?:group|groups|user|users)\\b[^/]*\\s/do(?:m|ma|mai|main)?\\b") and not(match(cmd_l, "/(?:add|del|delete)\\b"))) or (proc == "dsquery.exe" and match(cmd_l, "dsquery(?:\\.exe)?\"?\\s+group\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "get-adgroup(?:member)?\\b|get-domaingroup\\b|\\bnet(?:\\.exe)?\\s+(?:user|users|group|groups)\\b[^\\r\\n|;]*\\s/do(?:m|ma|mai|main)?\\b"))), "domgroup",
28 _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",
29 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (match(ipath, "\\.(?:exe|scr|com|pif)$") and (indexof(ipath, "c:\\users\\public\\") == 0 or indexof(ipath, "c:\\perflogs\\") == 0 or in(i_dir, "c:\\programdata", "c:\\windows\\temp"))), "exec",
30 _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",
31 _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")
32| search isnotnull(grp)
33| eval tech = case(grp == "inject", "T1055.001", grp == "archive", "T1560", grp == "defimpair", "T1685", grp == "firewall", "T1686", grp == "logclear", "T1685.005", grp == "regmod", "T1112", grp == "shadow", "T1490", grp == "encrypt", "T1486", grp == "deface", "T1491", grp == "sysinfo", "T1082", grp == "proclist", "T1057", grp == "secsw", "T1518.001", grp == "domgroup", "T1069.002", grp == "drop", "T1105", grp == "exec", "T1204", grp == "schtask", "T1053.005", grp == "wipe", "T1070.004")
34| eval anchor_g = if(in(grp, "inject", "archive"), grp, null), disc_g = if(in(grp, "sysinfo", "proclist", "secsw", "domgroup"), grp, null)
35| stats dc(grp) as grp_cnt, dc(anchor_g) as anchor_cnt, dc(disc_g) as disc_cnt, values(grp) as groups, values(tech) as techs, min(_time) as first_seen, max(_time) as last_seen by hostname, host_ip
36| search anchor_cnt >= 2 and disc_cnt >= 2 and grp_cnt >= 6
37| eval groups = strjoin(", ", groups), techs = strjoin(", ", techs),
38 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)를 집계합니다. 사용자 쓰기 위치 DLL 주입 도구 실행과 사용자 쓰기 위치 압축 해제가 모두 있고(필수 행위군 2개), 시스템·프로세스·보안 제품·도메인 그룹 정찰 행위군이 2개 이상(disc_cnt)이며, 서로 다른 행위군이 6개 이상이면 탐지합니다. 탐지 결과에는 관찰된 행위군 목록(groups)과 기법 목록(techs), 첫 발생 시각(first_seen)과 마지막 발생 시각(last_seen)을 함께 제공합니다.
위협 분석
공용 폴더에 내려받은 압축 파일을 해제한 뒤 주입 도구로 정상 프로세스에 DLL을 주입하는 것은 보안 제품의 탐지를 피하면서 랜섬웨어 모듈을 실행하려는 준비 단계입니다. 이후 Defender·방화벽 무력화와 이벤트 로그·섀도 복사본 삭제가 이어지면 암호화 직전이거나 진행 중이므로, 암호화 파일 생성 여부를 바로 확인해야 합니다.
오탐 유형
소프트웨어 배포 도구가 공용 폴더에 압축을 풀고 실행 파일을 실행하는 경우 일부 행위군이 관찰될 수 있습니다. 주입 도구 형태의 실행이 필수로 요구되어 오탐 가능성은 낮으나, 확인된 배포 도구는 실행 경로 기준으로 예외 조건을 추가합니다.
대응 방안
단말을 우선 격리하고, Defender·방화벽 설정 변경과 이벤트 로그 삭제 여부, 섀도 복사본 상태를 확인합니다. 압축 파일의 출처와 주입 대상 프로세스를 확인하고, 도메인 관리자 그룹 조회가 있었다면 해당 계정의 사용 이력을 조회합니다. 정탐으로 확인되면 변경된 보안 설정을 복구하고 같은 압축 파일이 유입된 단말을 찾습니다.