지니안 EDR

다운로드 0
업데이트 2026. 11. 17.

지니언 EDR - DLL 사이드로딩 준비·공용 폴더 실행 파일 서비스 등록·DNS TXT 통신·키로거 복합 행위 - Sogu/PlugX 침투 의심

지니언 EDR 로그에서 DLL 사이드로딩 준비, 공용 폴더 실행 파일의 서비스 등록, DNS TXT 통신, 키로거 실행이 한 단말에서 이어지는 Sogu/PlugX형 침투를 탐지합니다.

개요

중요도 상
유형 배치 탐지
실행 주기 매달/매일/매시/10분간격 */10 * * * *
메시지 지니언 EDR - Sogu/PlugX형 복합 행위: $host_ip
출력 필드 순서 hostname, host_ip, grp_cnt, anchor_cnt, groups, techs, first_seen, last_seen
MITRE 기술 T1574.001· T1543.003· T1071.004· T1056.001· T1055.001· T1007· T1547.001· T1033· T1016· T1082· T1059.006· T1105· T1204· T1587.001· T1059.001· T1071.001· T1070.004
MITRE 전술 TA0042 Resource Development· TA0002 Execution· TA0003 Persistence· TA0005 Defense Evasion· TA0006 Credential Access· TA0007 Discovery· TA0011 Command and Control
출처 사용자 제안 letsgo

쿼리

1table duration=30m EDR_GENIAN 2| search (_schema == "genian-edr-file" and in(event_subtype, "FileCreate", "FileDelete")) 3 or (_schema == "genian-edr-module" and event_subtype == "ModuleLoad") 4 or (_schema == "genian-edr-network" and event_subtype == "NetworkConnect") 5 or (_schema == "genian-edr-process" and event_subtype == "ProcessStart") 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 (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "\\b(?:copy-item|copy|cpi|cp|move-item|move|mi|mv)\\s+(?:-path\\s+)?['\"]?(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\[^'\"\\s]*\\.dll['\"]?\\s+(?:-destination\\s+)?['\"]?(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\[^'\"\\s]*\\.dll\\b")), "sideload", 18 _schema == "genian-edr-module" and event_subtype == "ModuleLoad" and (f_dir == i_dir and match(fpath, "(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\") and match(fpath, "\\.dll$") and not(match(fpath, "\\\\(?:python[0-9]*|msys-[^\\\\]+|cyg[^\\\\]+|lib[^\\\\]+|zlib[^\\\\]*|vcruntime[^\\\\]*|msvc[pr][^\\\\]*|ucrtbase|api-ms-win-[^\\\\]+|concrt[^\\\\]*|qt[0-9][^\\\\]*)\\.dll$"))), "sideload", 19 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "sc.exe" and match(cmd_l, "\\bcreate\\b[\\s\\S]*binpath=\\s*\"?[^\"]*(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\[^\"]*\\.exe\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "new-service\\b[\\s\\S]*-binarypathname\\s+['\"]?[^'\"]*(?:c:\\\\users\\\\public|c:\\\\perflogs|c:\\\\programdata|c:\\\\windows\\\\temp|\\\\appdata\\\\local\\\\temp|\\\\appdata\\\\roaming|\\\\downloads)\\\\[^'\"]*\\.exe\\b"))), "svcreg", 20 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "resolve-dnsname\\b[^\\r\\n|;]*-type\\s+['\"]?txt\\b")) or (proc == "nslookup.exe" and match(cmd_l, "-(?:type|q|querytype)=txt\\b"))), "dnstxt", 21 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "wh_keyboard_ll|getasynckeystate|setwindowshookex[\\s\\S]{0,300}\\b13\\b")) or match(proc, "keylog|keystroke") or (proc == "taskkill.exe" and match(cmd_l, "keylog"))), "keylog", 22 _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", 23 _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", 24 _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", 25 _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", 26 _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", 27 _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", 28 _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)"))), "python", 29 _schema == "genian-edr-file" and event_subtype == "FileCreate" and (match(fpath, "\\.(?:zip|7z|rar)$") and (indexof(fpath, "c:\\users\\public\\") == 0 or indexof(fpath, "c:\\perflogs\\") == 0 or in(f_dir, "c:\\programdata", "c:\\windows\\temp")) and not(in(proc, "msiexec.exe", "trustedinstaller.exe", "tiworker.exe", "mpsigstub.exe", "mpcmdrun.exe", "msmpeng.exe", "dismhost.exe", "system", "svchost.exe"))), "archdrop", 30 _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", 31 _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", 32 _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", 33 _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", 34 _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", 35 _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") 36| search isnotnull(grp) 37| eval tech = case(grp == "sideload", "T1574.001/T1574.001", grp == "svcreg", "T1543.003", grp == "dnstxt", "T1071.004", grp == "keylog", "T1056.001", grp == "inject", "T1055.001", grp == "svcdisc", "T1007", grp == "runkey", "T1547.001", grp == "user", "T1033", grp == "netconf", "T1016", grp == "sysinfo", "T1082", grp == "python", "T1059.006", grp == "archdrop", "T1105", grp == "drop", "T1105", grp == "exec", "T1204", grp == "avquar", "T1587.001", grp == "psbypass", "T1059.001", grp == "webc2", "T1071.001", grp == "wipe", "T1070.004") 38| eval anchor_g = if(in(grp, "sideload", "svcreg", "dnstxt", "keylog"), grp, null) 39| stats dc(grp) as grp_cnt, dc(anchor_g) as anchor_cnt, values(grp) as groups, values(tech) as techs, min(_time) as first_seen, max(_time) as last_seen by hostname, host_ip 40| search anchor_cnt >= 3 and grp_cnt >= 6 41| eval groups = strjoin(", ", groups), techs = strjoin(", ", techs), 42 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 사이드로딩(DLL 이름 바꿔 복제·같은 폴더 DLL 로드)·사용자 쓰기 위치 실행 파일 서비스 등록·DNS TXT 조회·키로거 실행 중 3개 이상이 있고(필수 행위군), 서로 다른 행위군이 6개 이상이면 탐지합니다. 탐지 결과에는 관찰된 행위군 목록(groups)과 기법 목록(techs), 첫 발생 시각(first_seen)과 마지막 발생 시각(last_seen)을 함께 제공합니다.

위협 분석

정상적으로 서명된 실행 파일이 같은 폴더의 악성 DLL을 로드하도록 하는 사이드로딩은 PlugX 계열이 오랫동안 사용해 온 실행 방식입니다. 공격자는 정상 프로세스 이름을 이용해 탐지를 회피합니다. 공용 폴더 실행 파일을 서비스로 등록해 지속성을 확보하고 DNS TXT 조회로 명령을 주고받으면 웹 프록시를 거치지 않는 C2 채널이 만들어집니다.

오탐 유형

휴대용 프로그램이 사용자 폴더에서 같은 폴더의 DLL을 로드하는 것은 정상 동작이며, 메일 보안 점검 도구가 DNS TXT 레코드를 조회하는 경우가 있습니다. 필수 행위군 3개가 요구되어 단독으로는 탐지되지 않으나, 반복 탐지되는 휴대용 프로그램은 서명자 기준으로 예외 조건을 추가합니다.

대응 방안

사이드로딩에 쓰인 실행 파일과 DLL을 확보하고 DLL의 서명·해시를 확인합니다. 등록된 서비스와 DNS TXT 조회 대상 도메인을 확인합니다. 정탐으로 확인되면 서비스를 제거하고 단말을 격리하며, 해당 도메인을 DNS에서 차단하고 같은 도메인을 조회한 단말을 찾습니다.

아직 댓글이 없습니다.