지니언 EDR 로그에서 자격 증명 탈취가 대량 도메인 정찰 또는 웹셸·SMB 측면 이동·SSH 터널·RDP 피벗 체인과 한 호스트에서 겹치는 OilRig(APT34)형 침투 체인을 탐지합니다.
Overview
Query
1table duration=30m EDR_GENIAN
2| search (_schema == "genian-edr-file" and in(event_subtype, "FileCopy", "FileCreate", "FileMove"))
3 or (_schema == "genian-edr-network" and event_subtype == "NetworkConnect")
4 or (_schema == "genian-edr-process" and event_subtype == "ProcessStart")
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 grp = case(
14 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (match(cmd_l, "sekurlsa::pth\\b") or (match(cmd_l, "freerdp") and match(cmd_l, "\\s/pth:")) or match(cmd_l, "\\s-hashes\\s+\\S*:[0-9a-f]{32}\\b") or match(cmd_l, "\\bpth-(?:winexe|net|smbclient|wmic|rpcclient|curl)\\b") or (match(cmd_l, "\\b(?:crackmapexec|cme|nxc|netexec|evil-winrm)\\b") and match(cmd_l, "\\s-h\\s+\\S*[0-9a-f]{32}\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "invoke-(?:thehash|smbexec|wmiexec|smbclient|smbenum)\\b[\\s\\S]*-hash\\b"))), "pth",
15 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "vaultcmd.exe" and match(cmd_l, "/list")) or (proc == "cmdkey.exe" and match(cmd_l, "/list\\b")) or (proc == "rundll32.exe" and match(cmd_l, "keymgr\\.dll\\s*,\\s*krshowkeymgr")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "passwordvault|credenumerate\\b|get-storedcredential\\b|windows\\.security\\.credentials"))), "credmgr",
16 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (match(cmd_l, "\\b(?:sekurlsa|lsadump|kerberos|crypto|privilege|vault|dpapi|misc|token|event|ts)::[a-z]") or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "invoke-mimikatz\\b|sekurlsa::|lsadump::"))), "mimikatz",
17 _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",
18 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "lazagne.exe", "secretsdump.exe", "pwdump.exe", "fgdump.exe", "gsecdump.exe", "wce.exe") or match(cmd_l, "\\blazagne(?:\\.exe|\\.py)?\"?\\s+(?:all|browsers|windows|sysadmin|wifi|mails|chats|databases|memory)\\b") or (proc == "reg.exe" and match(cmd_l, "\\b(?:save|export)\\s+\"?(?:hklm|hkey_local_machine)\\\\(?:sam|security|system)\"?\\s")) or (proc == "ntdsutil.exe" and match(cmd_l, "\\bifm\\b|ac(?:tivate)?\\s+i(?:nstance)?\\s+ntds"))), "oscred",
19 _schema == "genian-edr-file" and in(event_subtype, "FileCreate", "FileCopy", "FileMove") and (match(fpath, "\\\\[^\\\\]*(?:lazagne|pwdump\\d*|gsecdump|mimikatz|mimilib|mimidrv|mimispool|wce|fgdump|secretsdump|nanodump|dumpert|safetykatz|sharpkatz|pypykatz|quarkspwdump|cachedump|procdump(?:64)?|handlekatz|lsassy)[^\\\\]*\\.(?:exe|dll|sys|zip|7z|rar|ps1)$") and not(match(fpath, "^c:\\\\program files"))), "oscred",
20 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and match(ipath, "/sqlite3$") and match(cmd_l, "\\blogins\\b|moz_logins|passw|credential")), "lx_creddb",
21 _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"))), "domrecon",
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, "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",
24 _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",
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 ((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",
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, "\\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",
28 _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",
29 _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",
30 _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",
31 _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+accounts\\b")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "get-addefaultdomainpasswordpolicy\\b|(?:^|\\s)net\\s+accounts\\b"))), "pwpolicy",
32 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "reg.exe" and match(cmd_l, "\\bquery\\b") and match(cmd_l, "securityproviders\\\\wdigest|control\\\\lsa\\b|winlogon|terminal server|simontatham\\\\putty|martin prikryl|realvnc|tightvnc|control\\\\systemstartoptions|/v\\s+systemstartoptions")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "get-item(?:property)?(?:value)?\\b|\\bgp\\b|\\bgpv\\b|regread|opensubkey") and match(ps_text, "securityproviders\\\\wdigest|control\\\\lsa\\b|winlogon\\b[\\s\\S]*(?:defaultpassword|autoadminlogon)|terminal server\\\\(?:winstations|fdenytsconnections)|simontatham\\\\putty|systemstartoptions"))), "regquery",
33 _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"))), "ingress",
34 _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",
35 _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",
36 _schema == "genian-edr-file" and in(event_subtype, "FileCreate", "FileCopy", "FileMove") and (match(fpath, "\\\\inetpub\\\\wwwroot\\\\") and match(fpath, "\\.(?:aspx|asp|ashx|asmx|jsp|jspx|php)$") and not(in(proc, "w3wp.exe", "msdeploy.exe", "inetmgr.exe", "msiexec.exe", "trustedinstaller.exe", "tiworker.exe", "devenv.exe", "system"))), "webshell",
37 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((par == "w3wp.exe" and in(proc, "cmd.exe", "powershell.exe", "pwsh.exe", "whoami.exe", "net.exe", "net1.exe", "ipconfig.exe", "netstat.exe", "systeminfo.exe", "tasklist.exe", "hostname.exe", "certutil.exe", "bitsadmin.exe", "cscript.exe", "wscript.exe", "mshta.exe", "rundll32.exe", "sc.exe", "reg.exe")) or (in(proc, "cmd.exe", "powershell.exe", "pwsh.exe", "xcopy.exe", "robocopy.exe") and match(ps_text, "\\b(?:copy|copy-item|cp|cpi|xcopy|robocopy|move|move-item)\\b[^\\r\\n]*inetpub\\\\wwwroot") and match(ps_text, "\\.(?:aspx|asp|ashx|asmx|jsp|jspx|php)\\b"))), "webshell",
38 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (match(ipath, "/(?:curl|wget)$") and (match(cmd_l, "\\bcmd\\.exe\\b") or match(cmd_l, "\\bpro=cmd\\b") or (match(cmd_l, "\\s-f\\s+\\S*=@") and match(cmd_l, "\\.(?:aspx|asp|php|jsp|jspx)\\b")))), "lx_webshell",
39 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (match(ipath, "/mutt$") and (match(cmd_l, "\\s-a\\s+\\S") or (match(cmd_l, "\\s-s\\s") and match(cmd_l, "\\s-[cb]\\s")))), "lx_phish",
40 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (match(cmd_l, "\\bxdotool\\b") and match(cmd_l, "--window\\b") and match(cmd_l, "\\b(?:type|key|keyup|keydown|windowactivate)\\b")), "lx_rdp",
41 _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)"))), "webc2dl",
42 _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+use\\b") and not(match(cmd_l, "\\s/d(?:elete)?\\b")) and match(cmd_l, "\\$(?:\\s|$|\\\\)|\\\\\\\\[a-z0-9._-]+\\\\")) or (in(proc, "powershell.exe", "pwsh.exe") and match(ps_text, "new-smbmapping\\b|new-psdrive\\b[^\\n]*\\\\\\\\[a-z0-9._-]"))), "smblateral",
43 _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")), "filedel",
44 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((proc == "attrib.exe" and match(cmd_l, "(?:^|\\s)\\+[hs]\\b")) or (proc == "cmd.exe" and match(cmd_l, "\\b(?:mkdir|md)\\s+\"?c:\\\\windows\\\\temp\\\\[^\\\\\\s\"&]+") and match(cmd_l, "\\becho\\b[^&|]*>\\s*\"?c:\\\\windows\\\\temp\\\\"))), "hidden",
45 _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)\\\\"))), "encps",
46 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (((in(proc, "plink.exe", "ssh.exe", "kitty.exe", "kitty_portable.exe", "putty.exe") or match(cmd_l, "\\s-ssh\\b")) and match(cmd_l, "\\s-[rld]\\s*\\S*:[0-9]")) or (in(proc, "chisel.exe", "ligolo.exe", "gost.exe", "frpc.exe", "frps.exe", "revsocks.exe", "iox.exe", "ngrok.exe", "bore.exe", "rathole.exe") and not(in(proc, "msiexec.exe", "trustedinstaller.exe")))), "tunnel",
47 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and ((in(proc, "plink.exe", "ssh.exe", "kitty.exe", "kitty_portable.exe") or match(cmd_l, "\\s-ssh\\s")) and match(cmd_l, "\\S+@\\S+|\\s-pw\\s")), "sshlateral",
48 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (in(proc, "wfreerdp.exe", "wfreerdp_win64.exe", "xfreerdp.exe", "sdl-freerdp.exe") or match(cmd_l, "freerdp[^\\s]*\\.exe\"?\\s+/v:") or (proc == "mstsc.exe" and match(cmd_l, "/v:")) or (proc == "cmdkey.exe" and match(cmd_l, "/(?:generic|add):\"?termsrv/"))), "rdp",
49 _schema == "genian-edr-file" and event_subtype == "FileCreate" and (match(fpath, "\\\\(?:plink|chisel|ngrok|frpc|frps|ligolo[^\\\\]*|revsocks|gost|bore|rathole|iox)\\.exe$") and not(in(proc, "msiexec.exe", "trustedinstaller.exe", "tiworker.exe")) and not(match(fpath, "\\\\program files(?: \\(x86\\))?\\\\putty\\\\"))), "tunnelfile")
50| search isnotnull(grp)
51| eval tech = case(grp == "pth", "T1550.002", grp == "credmgr", "T1555.004", grp == "mimikatz", "T1003.001", grp == "lsass", "T1003.001", grp == "oscred", "T1003/T1003", grp == "lx_creddb", "T1552.001", grp == "domrecon", "T1069.002", grp == "user", "T1033", grp == "procdisc", "T1057", grp == "netconf", "T1016", grp == "sysinfo", "T1082", grp == "svcdisc", "T1007", grp == "acct", "T1087", grp == "netconn", "T1049", grp == "localgroup", "T1069.001", grp == "remotesys", "T1018", grp == "pwpolicy", "T1201", grp == "regquery", "T1012", grp == "ingress", "T1204", grp == "exfil", "T1041", grp == "browsercred", "T1555.003", grp == "webshell", "T1505.003/T1505.003", grp == "lx_webshell", "T1071.001", grp == "lx_phish", "T1566.002", grp == "lx_rdp", "T1021.001", grp == "webc2dl", "T1071.001", grp == "smblateral", "T1021.002", grp == "filedel", "T1070.004", grp == "hidden", "T1564.005", grp == "encps", "T1059.001", grp == "tunnel", "T1572", grp == "sshlateral", "T1021.004", grp == "rdp", "T1021.001", grp == "tunnelfile", "T1572")
52| eval anchor_g = if(in(grp, "pth", "credmgr", "mimikatz", "lsass", "oscred", "lx_creddb"), grp, null), disc_g = if(in(grp, "domrecon", "user", "procdisc", "netconf", "sysinfo", "svcdisc", "acct", "netconn", "localgroup", "remotesys", "pwpolicy", "regquery"), grp, null), disc2_g = if(in(grp, "webshell", "lx_webshell", "lx_phish", "lx_rdp", "webc2dl", "smblateral", "filedel", "hidden", "encps", "tunnel", "sshlateral", "rdp", "tunnelfile"), grp, null)
53| stats dc(grp) as grp_cnt, dc(anchor_g) as anchor_cnt, dc(disc_g) as disc_cnt, dc(disc2_g) as disc2_cnt, values(grp) as groups, values(tech) as techs, min(_time) as first_seen, max(_time) as last_seen by hostname, host_ip
54| search anchor_cnt >= 1 and (disc_cnt >= 4 or disc2_cnt >= 2) and grp_cnt >= 5
55| eval groups = strjoin(", ", groups), techs = strjoin(", ", techs),
56 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)를 집계합니다. Windows 자격 증명 관리자 열거·Mimikatz 모듈 구문·LSASS 덤프·자격 증명 탈취 도구 실행·Pass the Hash 실행·리눅스 자격 증명 저장소 추출 중 1개 이상이 있고(필수 행위군), 정찰 행위군이 4개 이상(disc_cnt)이거나 웹셸·SMB 측면 이동·터널·RDP 체인 행위군이 2개 이상(disc2_cnt)이며, 서로 다른 행위군이 5개 이상이면 탐지합니다. 탐지 결과에는 관찰된 행위군 목록(groups)과 기법 목록(techs), 첫 발생 시각(first_seen)과 마지막 발생 시각(last_seen)을 함께 제공합니다.
Threat analysis
OilRig는 스피어피싱으로 침투한 단말에서 대량의 도메인 정찰을 수행하고 자격 증명을 탈취합니다. 이후 웹셸과 SMB 관리 공유를 이용해 서버로 이동하고, SSH 역터널로 내부 RDP를 외부에 노출하여 데이터베이스 서버까지 접근합니다. 정찰 중심 단계와 측면 이동 중심 단계는 행위 구성이 달라 두 경로를 각각 판정하며, 공통 목표인 자격 증명 탈취를 필수로 둡니다.
False positives
관리자가 도메인 계정·그룹을 조회하면서 저장된 자격 증명 목록을 확인하는 경우 정찰 경로의 조건이 충족될 수 있습니다. AD 관리 단말은 hostname 기준으로 예외 조건을 추가하되, 덤프 도구나 Pass the Hash가 포함된 탐지는 예외로 두지 않습니다.
Response actions
탈취 대상이 된 자격 증명(자격 증명 관리자·LSASS)을 식별하여 암호를 변경합니다. 웹 서버라면 웹 루트에 새로 생성된 스크립트 파일과 웹 서버 프로세스의 자식 프로세스를 확인하고, 터널 도구의 접속 대상과 포워딩 포트를 확인합니다. 정탐으로 확인되면 호스트를 격리하고 터널 목적지를 차단하며, RDP·SMB로 연결된 서버를 조회합니다.