Genian EDR

Download 0
Last updated Nov 17, 2026

지니언 EDR - 리눅스 SUID 부여·로컬 계정 생성·타임스톰프·숨김 파일·자격 증명 덤프 도구 실행과 계정·암호 정책·파일 정찰 복합 행위 - 리눅스 침투 후 상위 기법 연쇄 의심

지니언 EDR의 리눅스 호스트 로그에서 SUID 부여, 로컬 계정 생성, 타임스톰프, 숨김 파일 생성, 자격 증명 덤프 도구 실행이 계정·암호 정책·파일 정찰과 겹치는 침투 후 행위 연쇄를 탐지합니다.

Overview

Priority High
Type Batch
Schedule Every month/Every day/Every hour/Every 10 mins */10 * * * *
Message 지니언 EDR - 리눅스 상위 기법형 복합 행위: $host_ip
Output field order hostname, host_ip, grp_cnt, anchor_cnt, disc_cnt, groups, techs, first_seen, last_seen
MITRE Techniques T1548.001· T1136.001· T1070.006· T1564.001· T1003· T1087.001· T1201· T1083· T1105· T1070.004
MITRE tactics TA0003 Persistence· TA0004 Privilege Escalation· TA0005 Defense Evasion· TA0006 Credential Access· TA0007 Discovery· TA0011 Command and Control
Origin User proposal letsgo

Query

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| search len(trim(hostname)) > 0 5| eval psrc = if(len(trim(image_path)) > 0, trim(image_path), trim(image)) 6| eval proc = lower(substr(psrc, lastindexof(psrc, "\\") + 1)), ipath = lower(psrc), cmd_l = lower(nvl(cmd_line, "")), 7 i_dir = if(lastindexof(psrc, "\\") >= 0, lower(substr(psrc, 0, lastindexof(psrc, "\\"))), ""), 8 par = lower(nvl(substr(parent_image, lastindexof(parent_image, "\\") + 1), "")), hostname = lower(trim(hostname)) 9| 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) 10| 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) 11| eval fpath = lower(nvl(file_path, "")), f_dir = if(lastindexof(file_path, "\\") >= 0, lower(substr(file_path, 0, lastindexof(file_path, "\\"))), "") 12| eval grp = case( 13 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and match(ipath, "/chmod$") and match(cmd_l, "\\s(?:[0-7]?[2467][0-7]{3}|[ugoa]*\\+[rwxt]*s[rwxt]*)\\s")), "suid", 14 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and ((match(ipath, "/(?:useradd|adduser|newusers)$") and not(match(cmd_l, "--system\\b|\\s-r(?:\\s|$)|\\s(?:-s|--shell)\\s+\\S*/(?:nologin|false)\\b"))) or (match(ipath, "/usermod$") and match(cmd_l, "\\s-[a-z]*g\\s+\\S*\\b(?:sudo|wheel|root|adm)\\b")) or (match(ipath, "/gpasswd$") and match(cmd_l, "\\s-a\\s+\\S+\\s+(?:sudo|wheel|root|adm)\\b")))), "lx_useradd", 15 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and match(ipath, "/touch$") and match(cmd_l, "touch\\s+(?:-[a-z]+\\s+)*(?:-[acm]*[tdr]\\s|--(?:date|reference|time)[= ])")), "timestomp", 16 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and match(ipath, "/(?:touch|mkdir|cp|mv|install|tee)$") and match(cmd_l, "\\s/(?:tmp|var/tmp|dev/shm)/\\.[^\\s/.][^\\s/]*/?(?:\\s|$)") and not(match(cmd_l, "/tmp/\\.(?:x11-unix|ice-unix|font-unix|xim-unix|test-unix|x[0-9]+-lock)"))), "hidden", 17 _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"))), "credtool", 18 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and match(ipath, "/(?:cat|less|more|head|tail|awk|cut|grep|sed|strings|nl)$") and match(cmd_l, "\\s/etc/passwd(?:\\s|$)")), "lx_acct", 19 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and ((match(ipath, "/chage$") and match(cmd_l, "\\s(?:-l|--list)(?:\\s|$)")) or (match(ipath, "/(?:cat|less|more|head|tail|grep|awk|sed)$") and match(cmd_l, "/etc/pam\\.d/(?:common-password|system-auth|password-auth)|/etc/login\\.defs|/etc/security/pwquality\\.conf")))), "lx_pwpolicy", 20 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and ((match(ipath, "/find$") and match(cmd_l, "\\s/etc/?\\s") and match(cmd_l, "-i?name\\s+\\S*\\.(?:conf|cfg|cnf|ini|key|pem)")) or (match(ipath, "/ls$") and match(cmd_l, "\\s-[a-z]*[la][a-z]*\\s+(?:/etc/init\\.d|/etc/cron[^\\s/]*|/var/spool/cron[^\\s]*|/home|/root)/?(?:\\s|$)")))), "lx_filedisc", 21 _schema == "genian-edr-file" and in(event_subtype, "FileCreate", "FileMove") and (match(fpath, "^/[^/]+\\.(?:sh|py|pl|rb|php)$") and not(match(lower(psrc), "^/usr/bin/(?:dpkg|apt|apt-get|snap)$|^/usr/lib/snapd/"))), "rootdrop", 22 _schema == "genian-edr-process" and event_subtype == "ProcessStart" and (indexof(ipath, "/") == 0 and ((match(ipath, "/(?:rm|shred|unlink|truncate)$") and match(cmd_l, "\\s/(?:usr/)?s?bin/\\.[^/\\s]+|\\s/dev/shm/[^/\\s]+|\\.(?:bash|zsh)_history|/var/log/(?:auth\\.log|secure|wtmp|btmp|lastlog|syslog|messages|audit/)|^shred\\b|/shred\\s")) or match(cmd_l, "\\bhistory\\s+-c\\b|unset\\s+histfile|histfile=/dev/null") or (match(ipath, "/(?:cp|mv)$") and match(cmd_l, "\\.(?:bash|zsh)_history")))), "lx_wipe") 23| search isnotnull(grp) 24| eval tech = case(grp == "suid", "T1548.001", grp == "lx_useradd", "T1136.001", grp == "timestomp", "T1070.006", grp == "hidden", "T1564.001", grp == "credtool", "T1003", grp == "lx_acct", "T1087.001", grp == "lx_pwpolicy", "T1201", grp == "lx_filedisc", "T1083", grp == "rootdrop", "T1105", grp == "lx_wipe", "T1070.004") 25| eval anchor_g = if(in(grp, "suid", "lx_useradd", "timestomp", "hidden", "credtool"), grp, null), disc_g = if(in(grp, "lx_acct", "lx_pwpolicy", "lx_filedisc"), grp, null) 26| 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 27| search anchor_cnt >= 3 and disc_cnt >= 2 and grp_cnt >= 6 28| eval groups = strjoin(", ", groups), techs = strjoin(", ", techs), 29 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)를 집계합니다. chmod SUID·SGID 부여·로컬 계정 생성·touch 타임스톰프·임시 경로 숨김 파일과 디렉터리 생성·자격 증명 덤프 도구 실행 중 3개 이상이 있고(필수 행위군), 로컬 계정 열거·암호 정책 조회·파일과 디렉터리 정찰 중 2개 이상(disc_cnt)이며, 서로 다른 행위군이 6개 이상이면 탐지합니다. 탐지 결과에는 관찰된 행위군 목록(groups)과 기법 목록(techs), 첫 발생 시각(first_seen)과 마지막 발생 시각(last_seen)을 함께 제공합니다.

Threat analysis

루트 권한을 얻은 공격자는 SUID 비트를 붙인 실행 파일과 새 계정으로 재진입 경로를 만들고, 파일 시각을 조작하고 숨김 파일을 사용해 흔적을 감춥니다. 저장된 자격 증명을 덤프 도구로 추출하면 다른 서버로 이동할 수 있게 됩니다. 각 행위는 관리 작업에서도 나타나지만 권한·은닉·자격 증명 행위가 정찰과 함께 겹치면 침투 후 활동으로 판단합니다.

False positives

서버 초기 구성 스크립트가 계정을 만들고 권한 비트를 설정하며 파일 시각을 맞추는 경우 필수 행위군이 관찰될 수 있습니다. 구성 관리 도구가 실행하는 작업은 실행 주체 기준으로 예외 조건을 추가하여 조정합니다.

Response actions

SUID·SGID가 부여된 파일과 생성된 계정, 시각이 조작된 파일을 확인합니다. 덤프 도구가 실행됐다면 서버에 저장된 계정·키를 교체합니다. 정탐으로 확인되면 호스트를 격리하고 SUID 파일과 계정을 제거하며, 루트 권한을 얻은 경로를 로그인 이력과 sudo 로그에서 추적합니다.

No comments yet.