※ 취약점 공격 Exploit Code에 대해 정리합니다.

[ Exploit File ]


[ 관련 정보 ]
Exploit-DB : Win7 Keylauout BlueScreen Vulnerability

Posted by GhostKei
,
※ CVE-2011-0611 Adobe Flash Player Zero-Day 취약점에 대한 정보를 등록합니다.
   본 취약점은 MS Office MSWord와는 무관한 Adobe Flash Player내의 취약점입니다. 



[ 파일 정보 ]
파일명 :: Disentangling Industrial Policy and Competition Policy.doc
            ( 내부 파일명 :: [Malware] 
Disentangling Industrial Policy and Competition Policy.doc )
파일 크기 :: 176,144 ( Bytes )
MD5 :: 96cf54e6d7e228a2c6418aba93d6bd49

파일명 :: Japan Nuclear Weapons Program.doc
            ( 내부 파일명 :: [Malware] 2011.doc )
파일 크기 :: 167,440 ( Bytes )
MD5 :: df45a5bc07153b20af1e375626b5addc
 

< 샘플 파일 >

Exploit DB :: http://www.exploit-db.com/exploits/17175/


 [ 동적 분석 ]

0. 동작 시나리오

< Figure. 동작 시나리오 >

1. 최초 유입

< Figure. Mail을 통한 Malicious DOC 파일 전파 >

2. Malicious DOC 파일 실행 

< Figure. Malicious DOC 파일 실행 화면 >
   :: Malicious DOC 파일을 실행하면 악성 동작을 완료한 후 사용자가 악성 동작 의심을 갖지 않도록 정상DOC 파일
      을 보여준다. 

3. Binary 확인
1) SWF 파일 확인

< Figure. DOC 파일내의 SWF 파일 >
   :: SWF File Format 에 따라 DOC내에 확인된 SWF 파일은 Signature + Version까지 모두 포함한 파일 크기가
     <Figure. DOC 파일내의 SWF 파일> 에서 언급한 파일 크기 0x2775 이다. 따라서 위의 SWF 파일 크기는
     10,101 Bytes가 된다.
     ( 실제 다른 분석 정보를 참고하면 파일의 크기가 10,421 Bytes로 되어 있으나 아직 그 이유는 모르겠다. )

2) SWF DeCompile

파일명 :: 513.swf ( 추정 )
파일 크기 :: 10,101 Bytes
MD5 :: 79b1c0ed2df4977d70c7d21817213fa6

< Figure. SWF 파일 생성 >
   :: SWF를 DeCompile 할 수 있는 Tool은 여러가지가 있겠지만 우선 내가 알고 있는 swfdump.exe를 이용할 것
      이다. 우선 DOC에서 확인한 SWF 파일을 확인한 크기 ( 10,101 Bytes )를 HxD 등의 Hex Editor 툴을 이용해
      별도의 파일로 저장한다. ( Offset 0x2E08 ~ 0x557D ) 이때 1)에서 언급한 파일 크기 10,421 Bytes로도 파일
      을 생성해 보겠다. ( Offset 0x2E08 ~ 0x56BD )
     - Dump_10101.swf ( Size :: 10,101 Bytes )
     - Dump_10421.swf ( Size :: 10,421 Bytes )
   :: 내부 문자열을 통해 추정해 보면 내장된 SWF 파일명은 "d:\513.swf" 이다. 

< Figure. swfdump.exe를 이용한 DeCompile 시도 >

< Figure. 생성된 DeCompile 파일 >
   :: swfdump 를 사용해 DeCompile을 수행한다. 이때 두 파일의 DeCompile 내용을 비교해 차이가 무엇인지 확인
      해 보겠다. 실제 두 파일을 DeCompile 하면 다음과 같이 10,421 Bytes를 갖는 파일의 경우 Error가 발생하며
      DeCompile 파일을 생성하지 못하지만 10,101 Bytes 파일의 경우 정상적으로 DeCompile이 되는 것을 확인할 수
      있다. 따라서 다른 분석 정보에서 10,421 Bytes로 입력한 이유는 아마 샘플의 차이가 아닐까 생각한다.
   :: 이제 생성된 DeCompile 파일을 분석해 보겠다.
< DeCompile 파일 >


3-1) DeCompile 파일 분석 ( swfdump.exe 이용 )
< Figure. Assembly 파일내의 ShellCode >
    :: DeCompile이라고 표현했으나 실제는 SWF 파일형식에 맞춰 Assembly를 했다고 보는게 맞다. 
    :: 10101 Bytes 파일이 우리가 원하는 악성 SWF 로 추정되므로 이를 Action Script DeCompiler를 통해 소스
       레벨의 내용을 확인할 수도 있다. ( Decoded Action Script Code )
    :: Assembly 된 파일에서 ShellCode를 확인할 수 있고 해당 ShellCode는 push를 통해 Stack/Heap에 저장되는
       것을 알 수 있다. x86 Assembly에서 PUSH 명령어는 Stack에 저장하는 명령어이므로 Stack에 저장하는 것으로
       추정할 수 있다. 그럼 위의 ShellCode를 확인해 보자.

3-2) DeCompile 파일 분석 ( Action Script Decompiler 이용 )

< Figure. Action Script Decompiler 를 이용해 확인한 Code >
   :: Assembly 형태로 표현된 것과 크게 차이가 나지 않음을 알 수 있다. 
< DeCompile 파일 >


4) ShellCode 분석

파일명 :: Unknown
파일 크기 :: 1,484 Bytes
MD5 :: a7435d599a0b7e9ffd5f94338412a93d

< Figure. ShellCode Binary 확인 >
   :: ShellCode로 추정했던 부분이 SWF 파일이었다. 즉, SWF 파일내에 실제 Crash를 발생시키는 SWF 파일이
     내장되어 있다는 것이다. 이 파일을 Assembly 로 확인해 보자.

<Figure. swfdump.exe  Error 발생 >




[ 정밀 분석 ]










* 참고 사이트
  - MS Technet :: http://blogs.technet.com/b/mmpc/archive/2011/04/12/analysis-of-the-cve-2011-0611-adobe-flash-player-vulnerability-exploitation.aspx
  - BugiX :: http://bugix-security.blogspot.com/2011/04/cve-2011-0611-adobe-flash-zero-day.html
  - AhnLab :: http://blog.ahnlab.com/asec/518
  - Sempersecurus :: http://sempersecurus.blogspot.com/2011/04/using-volatility-to-study-cve-2011-6011.html

[ 참고 사이트 ]
CVE :: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-0611
National Vulnerability :: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-0611
Security Focus ::  
http://www.securityfocus.com/bid/47314
Secunia :: 
http://secunia.com/advisories/cve_reference/CVE-2011-0611/ 
Adobe Security Bulletin :: http://www.adobe.com/support/security/advisories/apsa11-02.html 

Update 2011.04.15

Adobe의 Zero-Day가 Patch 되었다. 
* 관련 기사 
  - Threatpost :: http://threatpost.com/en_us/blogs/adobe-patch-flash-zero-day-windows-mac-friday-041411
  - Virus Bulletin :: http://www.virusbtn.com/news/2011/04_14.xml?rss
 
Posted by GhostKei
,