Genian EDR

Download 0
Last updated Nov 17, 2026

지니언 EDR - 디코딩·mshta 실행 고리와 다중 정찰 복합 행위 - 원전 캠페인형 악성코드 감염 의심

지니언 EDR 로그에서 certutil 디코딩, mshta·regsvr32 실행, Run 키 등록과 여러 정찰 행위가 한 단말에서 연달아 나타나는 Kimsuky 원전 캠페인형 악성코드 감염을 탐지합니다.

Overview

Priority High
Type Batch
Schedule Every month/Every day/Every hour/Every 10 mins */10 * * * *
Message 지니언 EDR - Kimsuky 원전 캠페인형 복합 행위: $host_ip
Output field order hostname, host_ip, grp_cnt, anchor_cnt, disc_cnt, groups, techs, first_seen, last_seen
MITRE Techniques T1140· T1218.005· T1218.010· T1547.001· T1016· T1057· T1033· T1082· T1069.002· T1518.001· T1083· T1105· T1071.001· T1041· T1074.001
MITRE tactics TA0003 Persistence· TA0005 Defense Evasion· TA0007 Discovery· TA0009 Collection· TA0011 Command and Control· TA0010 Exfiltration
Origin User proposal letsgo

Query

1table duration=30m EDR_GENIAN 2| search (_schema == "genian-edr-file" and in(event_subtype, "FileCopy", "FileCreate")) 3 or (_schema == "genian-edr-network" and event_subtype == "NetworkConnect") 4 or (_schema == "genian-edr-process" and event_subtype == "ProcessStart") 5 or (_schema == "genian-edr-reg" and event_subtype == "RegSetValue") 6| search len(trim(hostname)) > 0 7| eval psrc = if(len(trim(image_path)) > 0, trim(image_path), trim(image)) 8| eval proc = lower(substr(psrc, lastindexof(psrc, "\\") + 1)), ipath = lower(psrc), cmd_l = lower(nvl(cmd_line, "")), 9 i_dir = if(lastindexof(psrc, "\\") >= 0, lower(substr(psrc, 0, lastindexof(psrc, "\\"))), ""), 10 par = lower(nvl(substr(parent_image, lastindexof(parent_image, "\\") + 1), "")), hostname = lower(trim(hostname)) 11| 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) 12| 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) 13| eval fpath = lower(nvl(file_path, "")), f_dir = if(lastindexof(file_path, "\\") >= 0, lower(substr(file_path, 0, lastindexof(file_path, "\\"))), "") 14| eval rkey = lower(nvl(reg_key_path, "")), vname = lower(nvl(reg_value_name, "")), rval = lower(nvl(reg_value, "")) 15| eval grp = case( 16 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (((proc == "certutil.exe" or (proc == "cmd.exe" and match(cmd_l, "/[ck]\\s+(?:.*&\\s*)?\"?certutil(?:\\.exe)?\"?\\s"))) and match(cmd_l, "(?:^|\\s)[-/]decode(?:hex)?\\s+\\S+\\s+\\S+")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "frombase64string[\\s\\S]*(?:writeallbytes|set-content|out-file)"))), "decode", 17 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (proc == "mshta.exe" and (match(cmd_l, "mshta(?:\\.exe)?\"?\\s+\"?(?:https?://|\\\\\\\\|vbscript:|javascript:|about:)") or match(cmd_l, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\|%(?:temp|tmp|appdata|public|programdata)%"))), "mshta", 18 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (proc == "regsvr32.exe" and (match(cmd_l, "[-/]i:\\s*\"?(?:https?://|\\\\\\\\)|scrobj") or match(cmd_l, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\") or match(cmd_l, "\\.(?:txt|dat|bin|log|tmp|jpg|png|gif|ini|cfg)\"?\\s*$"))), "regsvr32", 19 _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", 20 _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", 21 _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", 22 _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", 23 _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", 24 _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", 25 _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", 26 _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", 27 _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", 28 _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", 29 _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", 30 _schema == "genian-edr-file" and in(event_subtype, "FileCreate", "FileCopy") and (in(proc, "cmd.exe", "powershell.exe", "pwsh.exe", "robocopy.exe", "xcopy.exe") and match(fpath, "\\.(?:docx?|xlsx?|pptx?|pdf|hwpx?|csv|zip|rar|7z)$") and match(f_dir, "\\\\appdata\\\\local\\\\temp\\\\[^\\\\]+$|^c:\\\\users\\\\public\\\\|^c:\\\\programdata\\\\[^\\\\]+$|^c:\\\\windows\\\\temp\\\\[^\\\\]+$")), "staging") 31| search isnotnull(grp) 32| eval tech = case(grp == "decode", "T1140", grp == "mshta", "T1218.005", grp == "regsvr32", "T1218.010", grp == "runkey", "T1547.001", grp == "netconf", "T1016", grp == "proclist", "T1057", grp == "user", "T1033", grp == "sysinfo", "T1082", grp == "domgroup", "T1069.002", grp == "secsw", "T1518.001", grp == "filedisc", "T1083", grp == "drop", "T1105", grp == "webc2", "T1071.001", grp == "exfil", "T1041", grp == "staging", "T1074.001") 33| eval anchor_g = if(in(grp, "decode", "mshta", "regsvr32", "runkey"), grp, null), disc_g = if(in(grp, "netconf", "proclist", "user", "sysinfo", "domgroup", "secsw", "filedisc"), grp, null) 34| 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 35| search anchor_cnt >= 1 and disc_cnt >= 3 and grp_cnt >= 5 36| eval groups = strjoin(", ", groups), techs = strjoin(", ", techs), 37 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)를 집계합니다. certutil 디코딩·mshta 실행·regsvr32 실행·Run 키 등록 중 1개 이상이 있고(필수 행위군), 네트워크·프로세스·사용자·시스템·도메인 그룹·보안 제품·파일 정찰 행위군이 3개 이상(disc_cnt)이며, 서로 다른 행위군이 5개 이상이면 탐지합니다. 탐지 결과에는 관찰된 행위군 목록(groups)과 기법 목록(techs), 첫 발생 시각(first_seen)과 마지막 발생 시각(last_seen)을 함께 제공합니다.

Threat analysis

스피어피싱 첨부 문서로 유입된 스크립트가 certutil로 페이로드를 디코딩하고 mshta·regsvr32 같은 Windows 기본 프로그램으로 실행한 뒤 Run 키로 지속성을 확보하는 것은 Kimsuky 계열 캠페인에서 반복 확인되는 흐름입니다. 이어지는 다중 정찰과 외부 웹 통신은 수집한 단말 정보를 C2로 보내는 단계이므로, 유출 여부를 함께 확인해야 합니다.

False positives

로그온 스크립트나 자산 점검 도구가 ipconfig·systeminfo·tasklist 등을 연달아 실행하는 경우 정찰 행위군이 관찰될 수 있습니다. 여기에 정상 프로그램의 Run 키 등록이 겹치면 탐지될 수 있으므로, 확인된 점검 스크립트의 부모 프로세스나 경로를 예외 조건으로 추가하여 조정합니다.

Response actions

실행 고리의 부모 프로세스를 따라가 최초 유입 경로(메일 첨부·문서·바로 가기)를 확인하고, certutil이 디코딩한 파일과 Run 키에 등록된 값을 확보합니다. 외부 웹 통신의 목적지와 전송량을 확인하여 유출 여부를 판단합니다. 정탐으로 확인되면 단말을 격리하고 Run 키와 반입 스크립트를 제거하며, 같은 메일을 받은 사용자의 단말을 조회합니다.

No comments yet.