SOC Prime Bias: 중간

05 12월 2025 17:36

USB 드라이브를 통해 계속 확산되는 CoinMiner 멀웨어

Author Photo
Ruslan Mikhalov Chief of Threat Research at SOC Prime linkedin icon Follow
USB 드라이브를 통해 계속 확산되는 CoinMiner 멀웨어
shield icon

Detection stack

  • AIDR
  • Alert
  • ETL
  • Query

요약

CoinMiner 악성코드는 숨겨진 바로가기를 이용하여 VBS 및 BAT 스크립트를 트리거하고, 이를 통해 여러 컴포넌트를 단계적으로 설치하여 암호화폐 채굴 페이로드를 전달하는 방식으로 한국의 USB 드라이브를 통해 계속 확산되고 있습니다.

조사

이 보고서는 감염된 USB의 디렉토리 구조, 바로가기를 통한 실행 체인, DcomLaunch 서비스 등록, PrintMiner 및 XMRig 암호화폐 채굴기의 배포를 설명합니다.

완화

사용자는 OS 및 소프트웨어를 최신 상태로 유지하고, 신뢰할 수 없는 바로가기의 실행을 차단하며, 최신 안티바이러스 도구를 사용하고, 알려진 악성 인프라에 대한 접근을 차단해야 합니다.

대응

악성 바로가기와 관련된 스크립트를 감지하고, 드로퍼 파일 생성 및 DCOM 등록을 모니터링하며, 식별된 채굴 명령 및 제어 도메인과 IP 주소로의 네트워크 트래픽을 차단합니다.

graph TB %% 클래스 정의 classDef action fill:#99ccff classDef tool fill:#66cc66 classDef file fill:#ffcc66 classDef process fill:#c266ff classDef malware fill:#ff6666 classDef network fill:#cccccc %% 노드 action_usb_insert[“<b>Action</b> – <b>T1204.002 사용자 실행: 악성 파일</b>: 사용자가 숨겨진 바로가기가 포함된 감염된 USB 드라이브를 삽입함”] class action_usb_insert action tool_shortcut[“<b>Tool</b> – <b>T1547.009 바로가기 수정</b>: 숨겨진 LNK 바로가기 \”USB Drive.lnk\”가 사용자에게 보임”] class tool_shortcut tool tool_vbscript[“<b>Tool</b> – <b>T1059.005 Visual Basic</b>: 바로가기가 Visual Basic 스크립트를 실행”] class tool_vbscript tool tool_batch[“<b>Tool</b> – <b>T1059.003 Windows 명령 셸</b>: VBScript가 배치 파일을 실행”] class tool_batch tool file_malicious_dll[“<b>File</b> – <b>T1036.005 사칭: 합법적 이름 일치</b> & <b>T1036.008 사칭: 이중 확장자</b>: 숨겨진 디렉터리를 사용하여 C:\\Windows\\System32에 \”printui.dll\” 악성 DLL(원래 .dat)을 배치”] class file_malicious_dll file process_printui[“<b>Process</b> – <b>T1055.001 프로세스 주입</b> & <b>T1574.001 DLL 하이재킹</b>: 합법적인 printui.exe가 악성 DLL을 로드”] class process_printui process tool_dcom[“<b>Tool</b> – <b>T1546.015 서버 소프트웨어 구성요소</b> & <b>T1021.003 DCOM</b>: DCOM 서비스에 DLL 등록하여 지속성 확보”] class tool_dcom tool file_svcinsty[“<b>File</b>: 드로퍼가 생성한 최종 페이로드 설치용 실행 파일 \”svcinsty64.exe\””] class file_svcinsty file file_svctrl[“<b>File</b>: 드로퍼가 생성한 보조 실행 파일 \”svctrl64.exe\””] class file_svctrl file malware_printminer[“<b>Malware</b> – PrintMiner: Windows Defender 제외 추가, 보안 경고 위장, 채굴기 다운로드 준비”] class malware_printminer malware tool_defender_exclusion[“<b>Tool</b> – <b>T1564.012 디스크 내용 위장</b> & <b>T1562.011 레지스트리 수정</b>: Defender 제외 목록 수정하여 활동 은폐”] class tool_defender_exclusion tool network_c2[“<b>Network</b> – <b>T1071.001 웹 프로토콜</b>, <b>T1102.002 웹 서비스</b>, <b>T1102.003 인그레스 도구 전송</b>: 명령 및 제어와 HTTPS 통신, 구성 수신 및 채굴기 다운로드”] class network_c2 network malware_xmrig[“<b>Malware</b> – XMRig: 오픈소스 모네로 채굴기 다운로드 및 실행”] class malware_xmrig malware action_compute_hijack[“<b>Action</b> – <b>T1496.001 자원 탈취</b>: 분석 도구를 회피하며 XMRig를 실행하여 암호화폐 채굴”] class action_compute_hijack action action_replication[“<b>Action</b> – <b>T1091 이동식 미디어를 통한 복제</b>: 다른 USB 드라이브에 바로가기 및 숨겨진 파일 복제”] class action_replication action %% 연결 action_usb_insert u002du002du003e|생성| tool_shortcut tool_shortcut u002du002du003e|실행| tool_vbscript tool_vbscript u002du002du003e|실행| tool_batch tool_batch u002du002du003e|배치| file_malicious_dll file_malicious_dll u002du002du003e|로딩됨| process_printui process_printui u002du002du003e|지속성 확보| tool_dcom tool_dcom u002du002du003e|생성| file_svcinsty tool_dcom u002du002du003e|생성| file_svctrl file_svcinsty u002du002du003e|설치| malware_printminer file_svctrl u002du002du003e|지원| malware_printminer malware_printminer u002du002du003e|제외 목록 추가| tool_defender_exclusion malware_printminer u002du002du003e|통신| network_c2 network_c2 u002du002du003e|전달| malware_xmrig malware_xmrig u002du002du003e|실행| action_compute_hijack action_compute_hijack u002du002du003e|트리거| action_replication action_replication u002du002du003e|배치| tool_shortcut

공격 흐름

시뮬레이션 실행

필수 준비: Telemetry & Baseline 사전 비행 검사가 통과해야 합니다.

이유: 이 섹션은 탐지 규칙을 트리거하도록 설계된 적대적 기법 (TTP)의 정확한 실행을 자세히 설명합니다. 명령어와 내러티브는 식별된 TTP를 직접 반영해야 하며, 탐지 로직에 의해 예상되는 정확한 텔레메트리를 생성하는 것이 목표입니다. 추상적이거나 관련이 없는 예는 오진을 초래할 수 있습니다.

  • 공격 내러티브 및 명령:

    1. 1단계 – 악성 DLL 드롭: 적은 제작된 printui.dllprintui.exe의 동일 디렉토리에 복사합니다 (USB 장치를 통해 배달된 드라이버 페이로드를 시뮬레이션).
    2. 2단계 – 실행 printui.exe: 을 호출하여 printui.exe 와 함께 (악성 로드), 악성 DLL이 로드되어 규칙의 /ml 선택 조건과 일치하는 프로세스 생성 이벤트를 생성합니다. 선택 (이미지 endswith printui.exe) 이며, 필터 조건 (이미지 contains printui.dll) 도 만족합니다. 규칙은 이 경우를 제외하므로 공격자는 이를 우회하기 위해 두 번째 단계를 추가합니다.
    3. 3단계 – 실행 svcinsty64.exe: 공격자는 USB 드라이브에 저장된 페이로드 바이너리( payload.exe)를 가리키는 새로운 서비스를 등록합니다. 이 작업은 규칙의 선택을 트리거하지 않고 요주의 이벤트를 생성하여 경고를 발생시킵니다.svcinsty64.exe, satisfying the rule’s selection without triggering the filter, thus generating an alert.
  • 회귀 테스트 스크립트: 이 아래 스크립트는 세 단계를 자동화하여 재현성을 보장합니다.

    # -------------------------------------------------
    # Regression Test – Trigger Sigma rule for printui.exe / svcinsty64.exe
    # -------------------------------------------------
    $dllPath = "$env:TEMPprintui.dll"
    $exePath = "$env:SystemRootSystem32printui.exe"
    $svcInstPath = "$env:SystemRootSystem32svcinsty64.exe"
    $payloadPath = "$env:TEMPpayload.exe"
    
    # 1️⃣ Drop a dummy malicious DLL (binary content not important for detection)
    Write-Host "[*] Creating dummy malicious DLL at $dllPath"
    Set-Content -Path $dllPath -Value ([byte[]](0..255)) -Encoding Byte
    
    # 2️⃣ Execute printui.exe (benign load) – should NOT fire due to filter
    Write-Host "[*] Running benign printui.exe (will be filtered out)"
    Start-Process -FilePath $exePath -ArgumentList "/p" -Wait
    
    # 3️⃣ Execute printui.exe with malicious DLL loading – filtered out (expected)
    Write-Host "[*] Running printui.exe with malicious DLL (filtered case)"
    Start-Process -FilePath $exePath -ArgumentList "/ml `$dllPath`" -Wait
    
    # 4️⃣ Prepare a dummy payload executable (simple CMD script compiled to exe)
    Write-Host "[*] Creating dummy payload executable"
    $payloadSource = @"
    @echo off
    echo Payload executed > $env:TEMPpayload_output.txt
    "@
    $payloadScript = "$env:TEMPpayload.bat"
    $payloadSource | Set-Content -Path $payloadScript -Encoding ASCII
    # Convert .bat to .exe using iexpress (built‑in)
    $iexpress = "$env:SystemRootSystem32iexpress.exe"
    $config = "$env:TEMPiexpress.sed"
    @"
    [Version]
    Version=3.0
    [Options]
    ExtractTitle=Payload
    ExtractLocation=%TEMP%
    ShowProgress=0
    HideExtractWindow=1
    [SourceFiles]
    SourceFiles=0
    %TEMP%payload.bat
    [Run]
    RunCommand="%TEMP%payload.bat"
    "@ | Set-Content -Path $config -Encoding ASCII
    & $iexpress /N /Q /M $config
    Move-Item -Path "$env:TEMPPayload.exe" -Destination $payloadPath -Force
    
    # 5️⃣ Register a malicious service using svcinsty64.exe – SHOULD FIRE
    Write-Host "[*] Registering malicious service via svcinsty64.exe"
    $svcName = "MaliciousSvc"
    $svcDisplay = "Malicious Service"
    $svcCmd = "`"$payloadPath`""
    $svcArgs = "/install `$svcName` `$svcDisplay` `$svcCmd`"
    Start-Process -FilePath $svcInstPath -ArgumentList $svcArgs -Wait
    
    # 6️⃣ Clean up service
    Write-Host "[*] Removing malicious service"
    $removeArgs = "/uninstall `$svcName`"
    Start-Process -FilePath $svcInstPath -ArgumentList $removeArgs -Wait
    
    # 7️⃣ Remove temporary artifacts
    Write-Host "[*] Cleaning temporary files"
    Remove-Item -Path $dllPath -Force -ErrorAction SilentlyContinue
    Remove-Item -Path $payloadPath -Force -ErrorAction SilentlyContinue
    Remove-Item -Path $payloadScript -Force -ErrorAction SilentlyContinue
    Write-Host "[+] Test completed"
  • 정리 명령: (위의 스크립트가 실패하거나 수동 정리를 선호하는 경우)

    # 악성 서비스가 여전히 존재하는 경우 제거
    $svcName = "MaliciousSvc"
    $svcInstPath = "$env:SystemRootSystem32svcinsty64.exe"
    & $svcInstPath /uninstall $svcName
    
    # 임시 DLL 및 페이로드 삭제
    Remove-Item -Path "$env:TEMPprintui.dll" -Force -ErrorAction SilentlyContinue
    Remove-Item -Path "$env:TEMPpayload.exe" -Force -ErrorAction SilentlyContinue
    Remove-Item -Path "$env:TEMPpayload.bat" -Force -ErrorAction SilentlyContinue
    
    # (선택 사항) 남은 서비스가 없는지 확인
    Get-Service -Name $svcName -ErrorAction SilentlyContinue