tlog 터미널 로그에서 명령어 실행 기록 삭제 명령을 탐지합니다.
Overview
| Priority | High |
|---|---|
| Type | Stream |
| Log schema | scribery-tlog-recording |
| Message | $hostname에서 $user 계정이 명령어 실행 기록 삭제 ($pattern) |
| Output field order | _log_time, pattern, hostname, user, term_type, cmd_line, output, in_bin, out_bin |
| MITRE Techniques | T1070.003 Indicator Removal: Clear Command History |
| MITRE tactics | TA0005 Defense Evasion |
Query
1| eval pattern = groups(cmd_line, "(\\bhistory\\s+-c\\b)|(\\brm\\s+~/\\.bash_history\\b)|(\\bunset\\s+HISTFILE\\b)")
2| search isnotnull(pattern)
3| eval pattern = trim(strjoin("\n", foreach(if(isnull(_1), "", _1), pattern)))
명령줄에서 아래 명령어 패턴을 탐지합니다.
- history -c
- rm ~/.bash_history
- unset HISTFILE
Threat analysis
- 공격자는 추적을 어렵게 하고 악성 행위의 증거를 인멸하기 위하여 명령어 실행 기록을 삭제합니다.
False positives
- 일반적인 행위는 아니지만 정상적인 명령어 실행 기록 삭제 시에도 탐지되므로, 전후의 TTP 이벤트를 추적하여 이상 여부를 확인해야 합니다.
Response actions
- 터미널 입출력이 이미 중앙집중적으로 수집되고 있으므로, 이 이벤트 자체에 대해서는 대응할 필요는 없습니다.
- 단, 이 이벤트의 이전에 악성 행위가 발생했다면 침해 조사 및 대응이 필요합니다.