랜섬웨어 찾기

참고

Microsoft Defender XDR 경험하고 싶으신가요? Microsoft Defender XDR 평가하고 파일럿하는 방법에 대해 자세히 알아보세요.

적용 대상:

  • Microsoft Defender XDR

랜섬웨어는 개별 컴퓨터 사용자에게 영향을 미치는 간단한 상품 맬웨어에서 산업 및 정부 기관에 심각한 영향을 미치는 엔터프라이즈 위협에 이르기까지 빠르게 발전했습니다. Microsoft Defender XDR 랜섬웨어 및 관련 침입 활동을 감지하고 차단하는 많은 기능을 제공하지만 손상 징후에 대한 사전 예방적 검사를 수행하면 네트워크를 보호하는 데 도움이 될 수 있습니다.

사람이 운영하는 랜섬웨어에 대해 읽어보세요.

Microsoft Defender XDR 고급 헌팅을 사용하면 랜섬웨어 활동과 관련된 개별 아티팩트 찾기 쿼리를 만들 수 있습니다. 또한 활동의 징후를 찾고 이러한 징후를 계량하여 즉각적인 주의가 필요한 디바이스를 찾을 수 있는 보다 정교한 쿼리를 실행할 수도 있습니다.

랜섬웨어 활동의 징후

Microsoft 보안 연구원들은 정교한 침입자가 시작한 많은 랜섬웨어 캠페인에서 다양한 공통적이면서도 미묘한 아티팩트들을 관찰했습니다. 이러한 징후는 주로 시스템 도구를 사용하여 암호화를 준비하고, 탐지를 방지하고, 법의학적 증거를 명확히 하는 것을 포함합니다.

랜섬웨어 활동 일반적인 도구 의도
프로세스 중지 taskkill.exe, net stop 암호화 대상 파일이 다양한 애플리케이션에 의해 잠겨 있지 않은지 확인합니다.
서비스 끄기 sc.exe - 암호화 대상 파일이 다양한 애플리케이션에 의해 잠기지 않도록 합니다.
- 보안 소프트웨어가 암호화 및 기타 랜섬웨어 활동을 방해하지 않도록 방지합니다.
- 백업 소프트웨어가 복구 가능한 복사본을 만들지 못하도록 중지합니다.
로그 및 파일 삭제 cipher.exe, wevtutil, fsutil.exe 법의학적 증거를 제거합니다.
섀도 복사본 삭제 vsadmin.exe, wmic.exe 암호화된 파일을 복구하는 데 사용할 수 있는 드라이브 섀도 복사본을 제거합니다.
백업 삭제 및 중지 wbadmin.exe 기존 백업을 삭제하고 예약된 백업 작업을 중지하여 암호화 후 복구를 방지합니다.
부팅 설정 수정 bcdedit.exe 암호화 프로세스로 인해 발생할 수 있는 부팅 실패 후 경고 및 자동 복구를 끕니다.
복구 도구 끄기 schtasks.exe, regedit.exe, 시스템 복원 및 기타 시스템 복구 옵션을 끕니다.

랜섬웨어 활동의 개별 징후 확인

이전 섹션에 설명된 활동을 포함하여 랜섬웨어 동작을 구성하는 많은 활동은 무해할 수 있습니다. 다음 쿼리를 사용하여 랜섬웨어를 찾는 경우 둘 이상의 쿼리를 실행하여 동일한 디바이스가 가능한 랜섬웨어 활동의 다양한 징후를 보이는지 여부를 검사.

taskkill.exe 사용하여 여러 프로세스 중지

이 쿼리는 taskkill.exe 유틸리티를 사용하여 10개 이상의 개별 프로세스를 중지하려는 시도를 확인합니다. 쿼리 실행

// Find attempts to stop processes using taskkill.exe
DeviceProcessEvents
| where Timestamp > ago(1d)
| where FileName =~ "taskkill.exe" 
| summarize taskKillCount = dcount(ProcessCommandLine), TaskKillList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 2m)
| where taskKillCount > 10

net stop을 사용하여 프로세스 중지

이 쿼리는 net stop 명령을 사용하여 10개 이상의 개별 프로세스를 중지하려는 시도를 확인합니다. 쿼리 실행

// Find attempts to stop processes using net stop
DeviceProcessEvents
| where Timestamp > ago(1d)
| where FileName =~ "net.exe" and ProcessCommandLine has "stop"
| summarize netStopCount = dcount(ProcessCommandLine), NetStopList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 2m)
| where netStopCount > 10

cipher.exe 사용하여 여러 드라이브에서 데이터 삭제

이 쿼리는 cipher.exe를 사용하여 여러 드라이브에서 데이터를 삭제하려는 시도를 확인합니다. 이 활동은 일반적으로 암호화 후 데이터 복구를 방지하기 위해 랜섬웨어에서 수행됩니다. 쿼리 실행

// Look for cipher.exe deleting data from multiple drives
DeviceProcessEvents
| where Timestamp > ago(1d)
| where FileName =~ "cipher.exe" 
// cipher.exe /w flag used for deleting data 
| where ProcessCommandLine has "/w" 
| summarize CipherCount = dcount(ProcessCommandLine),
CipherList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 1m) 
// cipher.exe accessing multiple drives in a short timeframe 
| where CipherCount > 1

wevtutil을 사용하여 이벤트 로그에서 포렌식 증거 지우기

이 쿼리는 wevtutil을 사용하여 이벤트 로그에서 10개 이상의 로그 항목을 지우려는 시도를 확인합니다. 쿼리 실행

// Look for use of wevtutil to clear multiple logs
DeviceProcessEvents
| where Timestamp > ago(1d)
| where ProcessCommandLine has "WEVTUTIL" and ProcessCommandLine has "CL"
| summarize LogClearCount = dcount(ProcessCommandLine), ClearedLogList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 5m)
| where LogClearCount > 10

sc.exe 사용하여 서비스 해제

이 쿼리는 sc.exe를 사용하여 10개 이상의 기존 서비스를 끄려는 시도를 확인합니다. 쿼리 실행

// Look for sc.exe disabling services
DeviceProcessEvents
| where Timestamp > ago(1d)
| where ProcessCommandLine has "sc" and ProcessCommandLine has "config" and ProcessCommandLine has "disabled"
| summarize ScDisableCount = dcount(ProcessCommandLine), ScDisableList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 5m)
| where ScDisableCount > 10

시스템 복원 해제

이 쿼리는 시스템 복원을 중지하고 시스템이 랜섬웨어로 암호화된 데이터를 복구하는 데 사용할 수 있는 복원 지점을 만들지 못하게 하려는 시도를 식별합니다. 쿼리 실행

DeviceProcessEvents
//Pivoting for rundll32  
| where InitiatingProcessFileName =~ 'rundll32.exe'   
//Looking for empty command line   
and InitiatingProcessCommandLine !contains " " and InitiatingProcessCommandLine != ""  
//Looking for schtasks.exe as the created process  
and FileName in~ ('schtasks.exe')  
//Disabling system restore   
and ProcessCommandLine has 'Change' and ProcessCommandLine has 'SystemRestore' 
and ProcessCommandLine has 'disable'

백업 삭제

이 쿼리는 암호화 전에wmic.exe 사용하여 섀도 복사본 스냅샷을 삭제하는 방법을 식별합니다. 쿼리 실행

DeviceProcessEvents
| where FileName =~ "wmic.exe"
| where ProcessCommandLine has "shadowcopy" and ProcessCommandLine has "delete"
| project DeviceId, Timestamp, InitiatingProcessFileName, FileName,
ProcessCommandLine, InitiatingProcessIntegrityLevel, InitiatingProcessParentFileName

랜섬웨어 활동의 여러 징후 확인

여러 쿼리를 별도로 실행하는 대신 랜섬웨어 활동의 여러 징후를 확인하는 포괄적인 쿼리를 사용하여 영향을 받는 디바이스를 식별할 수도 있습니다. 다음 통합 쿼리:

  • 랜섬웨어 활동의 비교적 구체적이고 미묘한 징후를 모두 찾습니다.
  • 이러한 징후의 존재를 무게
  • 랜섬웨어의 대상이 될 가능성이 높은 디바이스 식별

이 통합 쿼리를 실행하면 여러 공격 징후가 표시된 디바이스 목록이 반환됩니다. 각 유형의 랜섬웨어 활동 수도 표시됩니다. 이 통합 쿼리를 실행하려면 고급 헌팅 쿼리 편집기로 직접 복사합니다.

// Find attempts to stop processes using taskkill.exe
let taskKill = DeviceProcessEvents
| where Timestamp > ago(1d)
| where FileName =~ "taskkill.exe" 
| summarize taskKillCount = dcount(ProcessCommandLine), TaskKillList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 2m)
| where taskKillCount > 10;
// Find attempts to stop processes using net stop
let netStop = DeviceProcessEvents
| where Timestamp > ago(1d)
| where FileName =~ "net.exe" and ProcessCommandLine has "stop"
| summarize netStopCount = dcount(ProcessCommandLine), NetStopList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 2m)
| where netStopCount > 10;
// Look for cipher.exe deleting data from multiple drives
let cipher = DeviceProcessEvents
| where Timestamp > ago(1d)
| where FileName =~ "cipher.exe" 
// cipher.exe /w flag used for deleting data 
| where ProcessCommandLine has "/w" 
| summarize CipherCount = dcount(ProcessCommandLine), 
CipherList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 1m) 
// cipher.exe accessing multiple drives in a short timeframe 
| where CipherCount > 1;
// Look for use of wevtutil to clear multiple logs
let wevtutilClear = DeviceProcessEvents
| where Timestamp > ago(1d)
| where ProcessCommandLine has "WEVTUTIL" and ProcessCommandLine has "CL"
| summarize LogClearCount = dcount(ProcessCommandLine), ClearedLogList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 5m)
| where LogClearCount > 10;
// Look for sc.exe disabling services
let scDisable = DeviceProcessEvents
| where Timestamp > ago(1d)
| where ProcessCommandLine has "sc" and ProcessCommandLine has "config" and ProcessCommandLine has "disabled"
| summarize ScDisableCount = dcount(ProcessCommandLine), ScDisableList = make_set(ProcessCommandLine) by DeviceId, bin(Timestamp, 5m)
| where ScDisableCount > 10;
// Main query for counting and aggregating evidence
DeviceProcessEvents
| where Timestamp > ago(1d)
| where FileName =~ "vssadmin.exe" and ProcessCommandLine has_any("list shadows", "delete shadows")
or FileName =~ "fsutil.exe" and ProcessCommandLine has "usn" and ProcessCommandLine has "deletejournal"
or ProcessCommandLine has("bcdedit") and ProcessCommandLine has_any("recoveryenabled no", "bootstatuspolicy ignoreallfailures")
or ProcessCommandLine has "wbadmin" and ProcessCommandLine has "delete" and ProcessCommandLine has_any("backup", "catalog", "systemstatebackup")
or (ProcessCommandLine has "wevtutil" and ProcessCommandLine has "cl") 
or (ProcessCommandLine has "wmic" and ProcessCommandLine has "shadowcopy delete")
or (ProcessCommandLine has "sc" and ProcessCommandLine has "config" and ProcessCommandLine has "disabled")
| extend Bcdedit = iff(ProcessCommandLine has "bcdedit" and ProcessCommandLine has_any("recoveryenabled no", "bootstatuspolicy ignoreallfailures"), 1, 0)
| extend ShadowCopyDelete = iff (ProcessCommandLine has "shadowcopy delete", 1, 0)
| extend VssAdminShadows = iff(ProcessCommandLine has "vssadmin" and ProcessCommandLine has_any("list shadows", "delete shadows"), 1, 0)
| extend Wbadmin = iff(ProcessCommandLine has "wbadmin" and ProcessCommandLine has "delete" and ProcessCommandLine has_any("backup", "catalog", "systemstatebackup"), 1,0)
| extend Fsutil = iff(ProcessCommandLine has "fsutil" and ProcessCommandLine has "usn" and ProcessCommandLine has "deletejournal", 1, 0)
| summarize FirstActivity = min(Timestamp), ReportId = any(ReportId), Commands = make_set(ProcessCommandLine) by DeviceId, Fsutil, Wbadmin, ShadowCopyDelete, Bcdedit, VssAdminShadows, bin(Timestamp, 6h)
// Joining extra evidence
| join kind=leftouter (wevtutilClear) on $left.DeviceId == $right.DeviceId
| join kind=leftouter (cipher) on $left.DeviceId == $right.DeviceId
| join kind=leftouter (netStop) on $left.DeviceId == $right.DeviceId
| join kind=leftouter (taskKill) on $left.DeviceId == $right.DeviceId
| join kind=leftouter (scDisable) on $left.DeviceId == $right.DeviceId
| extend WevtutilUse = iff(LogClearCount > 10, 1, 0)
| extend CipherUse = iff(CipherCount > 1, 1, 0)
| extend NetStopUse = iff(netStopCount > 10, 1, 0)
| extend TaskkillUse = iff(taskKillCount > 10, 1, 0)
| extend ScDisableUse = iff(ScDisableCount > 10, 1, 0)
// Adding up all evidence
| mv-expand CommandList = NetStopList, TaskKillList, ClearedLogList, CipherList, Commands, ScDisableList
// Format results
| summarize BcdEdit = iff(make_set(Bcdedit) contains "1" , 1, 0), NetStop10PlusCommands = iff(make_set(NetStopUse) contains "1", 1, 0), Wevtutil10PlusLogsCleared = iff(make_set(WevtutilUse) contains "1", 1, 0),
CipherMultipleDrives = iff(make_set(CipherUse) contains "1", 1, 0), Fsutil = iff(make_set(Fsutil) contains "1", 1, 0), ShadowCopyDelete = iff(make_set(ShadowCopyDelete) contains "1", 1, 0),
Wbadmin = iff(make_set(Wbadmin) contains "1", 1, 0), TaskKill10PlusCommand = iff(make_set(TaskkillUse) contains "1", 1, 0), VssAdminShadow = iff(make_set(VssAdminShadows) contains "1", 1, 0), 
ScDisable = iff(make_set(ScDisableUse) contains "1", 1, 0), TotalEvidenceCount = count(CommandList), EvidenceList = make_set(Commands), StartofBehavior = min(FirstActivity) by DeviceId, bin(Timestamp, 1d)
| extend UniqueEvidenceCount = BcdEdit + NetStop10PlusCommands + Wevtutil10PlusLogsCleared + CipherMultipleDrives + Wbadmin + Fsutil + TaskKill10PlusCommand + VssAdminShadow + ScDisable + ShadowCopyDelete
| where UniqueEvidenceCount > 2

쿼리 결과 이해 및 조정

통합 쿼리는 다음 결과를 반환합니다.

  • DeviceId - 영향을 받는 디바이스를 식별합니다.
  • TimeStamp - 디바이스에서 랜섬웨어 활동의 징후가 처음으로 관찰된 경우
  • 활동의 특정 징후 - BcdEdit 또는 FsUtil과 같은 여러 열에 표시된 각 기호의 수입니다.
  • TotalEvidenceCount - 관찰된 징후 수
  • UniqueEvidenceCount - 관찰된 징후 유형 수

Microsoft Defender 포털에서 랜섬웨어 활동에 대한 통합 쿼리의 예

영향을 받는 디바이스 및 랜섬웨어 활동의 다양한 징후 수를 보여 주는 쿼리 결과

기본적으로 쿼리 결과에는 두 가지 이상의 랜섬웨어 활동이 있는 디바이스만 나열됩니다. 랜섬웨어 활동의 징후가 있는 모든 디바이스를 보려면 다음 where 연산자를 수정하고 숫자를 0으로 설정합니다. 디바이스 수를 줄이려면 더 높은 숫자를 설정합니다.

| where UniqueEvidenceCount > 2

더 많은 랜섬웨어 리소스

Microsoft의 주요 정보:

Microsoft 365:

Microsoft Azure:

Microsoft Defender for Cloud Apps:

Microsoft 보안 팀 블로그 게시물:

더 자세히 알아보고 싶으신가요? 기술 커뮤니티: Microsoft Defender XDR Tech Community의 Microsoft 보안 커뮤니티와 Engage.