SOC Prime Bias: 중간

18 May 2026 18:43 UTC

PureLogs, PawsRunner 스테가노그래피를 통해 전달

Author Photo
SOC Prime Team linkedin icon 팔로우
PureLogs, PawsRunner 스테가노그래피를 통해 전달
shield icon

Detection stack

  • AIDR
  • Alert
  • ETL
  • Query

요약

이 캠페인은 환경 변수를 설정하고 실행하는 JavaScript 로더를 전달하는 TXZ 아카이브를 포함한 피싱 이메일에 의존하며, conhost.exe 를 무인 모드로 실행합니다. 로더는 이후 PawsRunner로 알려진 .NET 어셈블리를 복호화하여 스테가노그래피 기법을 통해 숨겨진 암호화된 콘텐츠를 포함하는 PNG 이미지를 검색합니다. 그 이미지에서 악성코드는 최종 페이로드를 추출합니다: PureLogs .NET 정보탈취기. 활성화되면, PureLogs는 HTTPS를 통해 원격 명령 및 제어 서버에 연결하여 브라우저 자격 증명과 시스템 정보를 유출합니다.

조사

분석 결과 JavaScript 로더가 프로세스 환경 변수에서 명령을 불러오고, 윈도우 플래그가 숨겨진 상태로 파워셸을 실행하며, .NET 리플렉션을 통해 실행되는 AES 암호화 페이로드를 복호화한다는 것이 확인되었습니다. PawsRunner는 PNG 파일을 가져오면서 세 개의 네트워크 API와 세 가지 사용자 에이전트 문자열을 교대 사용한 뒤, iTXt and IEND 청크를 분석하여 은닉된 데이터를 찾아내고 다음 단계를 RC4로 복호화합니다. PureLogs는 또한 TripleDES와 Gzip을 사용해 다운로드 DLL을 로드하고, 특정 엔드포인트로 TLS 보호 HTTP 요청을 보내고, 피해 시스템에서 브라우저 관련 데이터를 넓게 수집합니다.

완화

조직은 이메일 게이트웨이에서 TXZ 첨부 파일을 차단하고, conhost.exe 가시 창 없이 실행 중인 인스턴스를 모니터링하며, -w hidden 플래그로 실행된 파워셸을 탐지해야 합니다. 보안 팀은 또한 PawsRunner와 PureLogs에 대한 신호를 배포하고, 식별된 명령 및 제어 도메인과 IP 주소로의 출력 트래픽을 제한하며, 서명되지 않은 .NET 어셈블리의 실행을 제한해야 합니다. 가능하다면 스테가노그래피 탐지를 의심스러운 수신 이미지 파일에 적용해야 합니다. flag. Security teams should also deploy signatures for both PawsRunner and PureLogs, restrict outbound traffic to the identified command-and-control domain and IP address, and limit execution of unsigned .NET assemblies. Where possible, steganography detection should be applied to suspicious inbound image files.

대응

이 활동이 감지되면, 감염된 엔드포인트를 격리하고, 의심스러운 conhost.exe 및 파워셸 프로세스를 종료하며, 시스템에서 드롭된 .NET 바이너리를 제거해야 합니다. 침해된 자격 증명은 폐기되고, 다단계 인증이 강제 적용되어야 하며, 저장된 브라우저 암호는 재설정되어야 합니다. 조사관은 또한 추가 명령 및 제어 통신이 발생하지 않았음을 확인하기 위해 네트워크 포렌식을 수행하고, 재감염을 방지하기 위한 완화 절차를 적용해야 합니다.

"graph TB %% Class Definitions classDef action fill:#99ccff classDef tool fill:#cccccc classDef process fill:#ffdd99 classDef malware fill:#ff9999 %% Nodes initial_phishing["<b>Action</b> – <b>T1566.001 Spearphishing Attachment</b><br/>Attacker sends a phishing email with a TXZ archive attachment that contains the malicious payload."] class initial_phishing action malicious_archive["<b>Malware</b> – <b>Name</b>: Malicious TXZ Archive<br/><b>Description</b>: Archive used to deliver the initial JavaScript payload."] class malicious_archive malware user_execution["<b>Action</b> – <b>T1204.004 User Execution</b><br/>Victim extracts the archive, the JavaScript runs PowerShell in hidden mode and reads commands from environment variables."] class user_execution action powershell_loader["<b>Process</b> – <b>Name</b>: PowerShell Loader<br/><b>Description</b>: Executes decrypted .NET assembly via reflection without writing to disk."] class powershell_loader process defense_compile["<b>Action</b> – <b>T1027.004 Compile After Delivery</b><br/>Decrypted .NET assembly is loaded in memory via reflection."] class defense_compile action defense_compress["<b>Action</b> – <b>T1027.015 Compression</b><br/>Payload is AESu2011decrypted then decompressed using Gzip."] class defense_compress action defense_stego["<b>Action</b> – <b>T1027.003 Steganography</b><br/>Loader downloads PNG images and extracts hidden encrypted data from iTXt/IEND chunks."] class defense_stego action masquerade_icon["<b>Action</b> – <b>T1036.008 Masquerading</b><br/>Binary uses cat pictures as its application icon to appear benign."] class masquerade_icon action c2_encrypted["<b>Action</b> – <b>T1573 Encrypted Channel</b><br/>Further C2 communication occurs over HTTPS with AESu2011256 encrypted payloads."] class c2_encrypted action credential_access["<b>Action</b> – <b>T1555.003 Credentials from Web Browsers</b><br/>PureLogs enumerates browsers and extracts saved passwords, cookies, and cryptou2011wallet files."] class credential_access action purelogs_tool["<b>Tool</b> – <b>Name</b>: PureLogs<br/><b>Description</b>: Credentialu2011dumping utility that harvests browser data."] class purelogs_tool tool collection_archive["<b>Action</b> – <b>T1560.003 Archive Collected Data</b><br/>Harvested data is compressed with Gzip and encrypted with AES before exfiltration."] class collection_archive action exfiltration_http["<b>Action</b> – <b>T1048.003 Exfiltration Over Unencrypted Nonu2011C2 Protocol</b><br/>Data is sent via HTTP POST requests to multiple external endpoints."] class exfiltration_http action %% Connections initial_phishing –>|delivers| malicious_archive malicious_archive –>|triggers| user_execution user_execution –>|executes| powershell_loader powershell_loader –>|performs| defense_compile defense_compile –>|uses| defense_compress defense_compress –>|uses| defense_stego defense_stego –>|enables| masquerade_icon masquerade_icon –>|establishes| c2_encrypted c2_encrypted –>|enables| credential_access credential_access –>|uses| purelogs_tool credential_access –>|collects| collection_archive collection_archive –>|exfiltrates via| exfiltration_http %% Class Assignments class initial_phishing action class malicious_archive malware class user_execution action class powershell_loader process class defense_compile action class defense_compress action class defense_stego action class masquerade_icon action class c2_encrypted action class credential_access action class purelogs_tool tool class collection_archive action class exfiltration_http action "

공격 흐름

시뮬레이션 실행

전제 조건: Telemetry & Baseline 사전 비행 검사가 통과되어야 합니다.

  • 공격 서술 및 명령

    1. 1단계 – 암호화된 페이로드 준비
      • 공격자는 작은 더미 페이로드 ("secret"), AES-256을 사용하여 알려진 키로 암호화하고 Base64로 인코딩하여 환경 변수에 저장합니다 ENC_PAYLOAD.
    2. 2단계 – PowerShell 복호화 로더 실행
      • 단일 행으로 읽어들인 ENC_PAYLOAD, Base64 문자열을 디코드하고, .NET AesCryptoServiceProvider을 구성하고, 키/IV를 유도하며 데이터를 복호화하고, 선택적으로 평문을 실행합니다.
    3. 3단계 – 탐지 테레메트리 생성
      • PowerShell 명령에는 “AES”라는 단어가 포함되며(e.g., New-Object System.Security.Cryptography.AesCryptoServiceProvider) EventID 4104로 기록되며, 탐지 규칙을 만족시킵니다.
  • 회귀 테스트 스크립트

    # -------------------------------------------------
    # PowerShell AES 복호화 시뮬레이션 (탐지를 트리거함)
    # -------------------------------------------------
    # 1. 데모 목적을 위한 정적 256‑비트 키와 IV 정의
    $key = [byte[]](0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,
                       0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20)
    $iv  = [byte[]](0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0)
    
    # 2. 평문 페이로드 (예)
    $plain = [System.Text.Encoding]::UTF8.GetBytes("secret data")
    
    # 3. AES를 사용하여 페이로드 암호화 (CBC, PKCS7)
    $aes = [System.Security.Cryptography.AesCryptoServiceProvider]::new()
    $aes.Key = $key
    $aes.IV  = $iv
    $aes.Mode = [System.Security.Cryptography.CipherMode]::CBC
    $aes.Padding = [System.Security.Cryptography.PaddingMode]::PKCS7
    $encryptor = $aes.CreateEncryptor()
    $cipherBytes = $encryptor.TransformFinalBlock($plain,0,$plain.Length)
    $cipherB64 = [Convert]::ToBase64String($cipherBytes)
    
    # 4. 암호문을 환경 변수에 저장
    
    # 5. 복호화 로더 – 정확히 기록될 줄 ("AES" 포함)
    $loader = @"
    `$enc = [System.Environment]::GetEnvironmentVariable('ENC_PAYLOAD')
    `$bytes = [Convert]::FromBase64String(`$enc)
    `$aes = New-Object System.Security.Cryptography.AesCryptoServiceProvider
    `$aes.Key = $($key -join ',')
    `$aes.IV  = $($iv -join ',')
    `$decryptor = `$aes.CreateDecryptor()
    `$plain = `$decryptor.TransformFinalBlock(`$bytes,0,`$bytes.Length)
    `$result = [System.Text.Encoding]::UTF8.GetString(`$plain)
    Write-Output `"Decrypted: `$result`"
    "@
    
    # 로더를 실행 (EventID 4104로 캡처됨)
    Invoke-Expression $loader
  • 정리 명령

    # 환경 변수를 제거합니다.
    
    # 세션에서 모든 임시 변수를 제거
    Remove-Variable -Name key,iv,plain,cipherBytes,cipherB64,loader -ErrorAction SilentlyContinue

시뮬레이션 후 검증

  1. 를 실행 검증 쿼리 (위 KQL 예제) 그러나 필터를 사용하여 ScriptBlockText는 "AES" 포함 탐지가 발생했음을 확인.
  2. SIEM에서 경고 세부 정보를 검토; 경고 이름이 규칙과 일치하고 (정의된 경우) 심각도가 높음.

폐쇄 발언

  • 이 규칙은 스트레이트포워드한 “AES” 사용 시나리오를 성공적으로 탐지합니다.
  • 적들은 단어를 분할하여 회피 가능 (예: "AE"+"S"), 리플렉션을 통해 .NET 클래스를 로드하거나, 컴파일된 바이너리 내에서 복호화를 수행.
  • 을 사용해 규칙을 강화 행동적 지표 (암호문을 위한 환경 변수 사용, 고엔트로피 문자열, AesCryptoServiceProvider objects 생성, 및 이후 TransformFinalBlock 호출)은 간단한 난독화에 대한 저항성을 향상시킵니다.