SOC Prime Bias: 중간

05 Dec 2025 14:36 UTC

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

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

Detection stack

  • AIDR
  • Alert
  • ETL
  • Query

요약

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

조사

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

완화

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

대응

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

공격 흐름

시뮬레이션 실행

필수 준비: 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