1. 악성코드 진단 기법 개론
DESCRIPTION
2009년 5월 해군 CERT 대상 교육 자료TRANSCRIPT
2009.05.20
㈜ 안철수연구소
ASEC (AhnLab Security Emergency response Center)
Anti-Virus Researcher, CISSP
장 영 준 주임 연구원
악성코드 진단 기법 개론
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.2
1. PE (Portable Executable) Format
Win32 기반의 윈도우 운영체제에서 실행 가능한 파일 형식
PE 형식은 유닉스의 COFF(Common Object File Format)에서 유래
MZ 는 PE를 만든 Mark Zbilowski의 이니셜
1. PE Format 개론
[PE 파일]
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
2. PE (Portable Executable) Format 파일 생성 순서
컴파일 링크
가독성이 있는 소스코드
심볼과 바이너리 코드
바이너리 코드
1. PE Format 개론
3
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
3. PE (Portable Executable) Format 구조
PE와 관련된 구조체
PE Header 뒤에 오는 구조체의 배열
.text – 실행 가능한 코드 영역
.data – 초기화된 전역 변수 영역
.rdata – 읽기 전용 데이터 섹션
.idata – Import 함수 정보 영역
.edata – Export 함수 정보 영역
.rsrc – 리소스 데이터 영역
1. PE Format 개론
4
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
4. PE (Portable Executable) Header시작점
로드주소
1. PE Format 개론
5
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
5. Win32/Dellboy.AH에 의한 EP 변경
[정상 파일]
[감염 파일]
1. PE Format 개론
6
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
5. Win32/Dellboy.AH에 의한 Section 변경
[정상 파일][감염 파일]
1. PE Format 개론
7
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
5. Win32/Dellboy.AH에 의한 전체 구조 변경
Dos Header
Section 1 Header
Section 2 Header
.aaa1
.aaa2
PE Header
.aaa0
0h
400h
27800h
3566Ch
Dos Header
Section 1 Header
Section 2 Header
.text
.rdata
PE Header
NULL
NULL
.data ~ .rsrc
0h
1000h
8000h
D000h
[정상 파일]
(53,248 바이트)
[감염 파일]
(218,732 바이트)
Entry Point
55,8B,EC,6A
[165,484 바이트 증가]
400h
정상 파일
2864Eh
Entry Point
9C,60,E8,00
1. PE Format 개론
8
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
2. 악성코드 진단 기법
1. String 기반 진단
악성코드 내부 특정 코드 영역을 진단의 위치로 선정
가장 간단하고 빠르게 진단할 수 있는 기법
[Win-Trojan/OnlineGameHack.86016.CC 의 String 일부]
9
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
2. Generic 진단
특정 악성코드의 집합의 공통된 OPcode(Operation Code) 영역을
진단 위치로 선정
알려지지 않은 변형들에 대해 유연하게 대응 가능
[Win-Trojan/OnlineGameHack.86016.CC의 I.E 인젝션 코드 일부]
2. 악성코드 진단 기법
10
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
3. Heuristic진단
2. 악성코드 진단 기법
기존에 알려진 악성코드의 일반적인 특성을 바탕으로 그와 얼마나
유사한 코드를 가지고 있는가를 비교
* Static Heuristic Detection
악성코드의 실행 없이 기존 악성코드와 얼마나 많은 유사한 코드를
가지고 있는가를 비교 판단
* Dynamic Heuristic Detection
SandBox 또는 Emulator Buffer 를 이용하여 악성코드 실행시 나타나는 증상
을 바탕으로 기존에 알려진 악성코드와 얼마나 유사한가를 판단
11
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.12
Copyright (C) AhnLab, Inc. 1988-2009. All rights reserved.
AhnLab, the AhnLab logo, and V3 are trademarks or registered trademarks of AhnLab, Inc.,in Korea and certain other countries. All other trademarks mentioned in this document are the property of their respective owners.
AhnLabThe Joy of Care-Free Your Internet World