[hyss 2016] 쉽고 빠르게 시작하는 volatility plugin 개발
TRANSCRIPT
저작물 인용저작권법 제 35조의 3 ‘공정이용’ 조항에 따라 교육과 연구 목적으로 이용하고 있습니다.혹시 문제가 있을 경우, [email protected] 로 연락 주시면 적절한 조치를취하겠습니다.
발표 자료 배포미숙한 부분이 존재하는 자료로써 수정 및 검토를 거친 뒤 추후 배포될 예정입니다.자료와 관련한 문의는 페이스북을 이용해주시기 바랍니다.
김동현Kim Dong Hyun / Digitalis
영남권 정보보호영재교육원 장학생
Volatility Plugin - “Malcom” 개발
“Windows MBR 분석” 문서 작성
소속 없는 잉여 포렌서 / 고3
#찬양하라!
필요성
• 특별한 악성코드 – 바로 메모리에 로드
• 사용자 프라이버시 – 웹 브라우저 프라이버시 모드
장점
• Window API에 의존하지 않음
• 반복적인 조사 가능
• 다양한 방식의 조사 가능
#전체적인 기획 과정
1. 타 프로그램의 유용한 기능 선정• 프로세스 관련 도구 - Process Explorer
• Check Virustotal 기능
2. 유사 플러그인 탐색• Sebastien Bourdon-Richard Virustotal Plugin
• Maj3sty (이준형) Malscan Plugin
#전체적인 기획 과정
3. 해당 플러그인의 개선점 파악• Volatility 최신 버전에서 플러그인이 구동이 되지 않음
• 불필요한 정보 출력, 복잡한 코드
4. 해결방안 탐색 & 개발 착수• 최신 버전에 맞게 코드의 구조 및 사용 함수 검토
• 일반 사용자에게 필요한 데이터만 파싱 (Parsing)
__init__
calculate
render_text
import
그럼 살펴봅시다.
• Import – 필요 모듈
• __init__ - 옵션 지정
• calculate – 실제 연산
• render_text – 텍스트 처리
import osimport sysimport shutilimport requestsimport jsonimport volatility.plugins.procdump as procdump
malcom_key = “----API-KEY------”
class malcom(procdump.ProcDump):"""Process Dump & Malwares.com Scan Plugin."""
def __init__(self, config, *args, **kwargs):
procdump.ProcDump.__init__(self, config, *args, **kwargs)
config.add_option('OFFSET', short_option = 'o',default = None, help = 'EPROCESS offset (in hex)in the physical address space', action = 'store',type = 'str')
config.add_option('PID', short_option = 'p',default = None, help = 'Operate on these ProcessIDs (comma-separated)', action = 'store',type = 'str')
def calculate(self):
if self._config.DUMP_DIR == None:print "\n[!] Process to dump in the current directory."self._config.DUMP_DIR = os.getcwd()
if self._config.PID != None:print "\n[+] To start a process dump.\n"result = procdump.ProcDump(self._config).execute()result2 = procdump.ProcDump.calculate(self)filepath = self._config.DUMP_DIR +"\executable.{0}.exe".format(self._config.PID)filename = "executable.{0}.exe".format(self._config.PID)copypath = self._config.DUMP_DIR + "\Volatility\plugins“+ "\executable.{0}.exe".format(self._config.PID)
shutil.copy(filepath, copypath)
print "\n[+] Copying Dump File ..."print "[-] Copy Dump File Path : " + copypath
return filename
def render_text(self, outfd, data):
print "\n[+] Upload File & File Analysis ..."
params = {'api_key':malcom_key,'filename': data}files = {'file':(data,open(data,'rb'), 'application/octet-stream')}response = requests.post('https://www.malwares.com/api/v2/file/upload', files=files, data=params)json_response = response.json()
md5 = json_response["md5"]
params = {'api_key':malcom_key, 'hash':md5}response = requests.get('https://www.malwares.com/api/v2/file/mwsinfo', params=params)json_response = response.json()
result_msg = json_response["result_msg"]date = json_response["date"]md5 = json_response["md5"]sha1 = json_response["sha1"]sha256 = json_response["sha256"]
…
if(black_white == 1):print "[-] Black & White List : Black List"
else:print "[-] Black & White List : White List"
print "[-] File Type : " + filetypeprint "[-] File Size : " + str(filesize) + " Byte"print "\n[!] AV Scan Result : " + str(positives) + " / " + str(total)
포기하지말자.
분명 처음이라 한번에 성공 할 수 없다.
이러한 시련 속에도 잘 참고 오류를 해결
해나가고 기능을 구현한다면
상당한 기쁨 그 이상을 보상받을 지도..
Malcom Plugin실행 횟수
53번
#최근 진행중인 프로젝트
Volakao Plugin• 메모리 상에 존재하는 Kakao ID 및 정보 추출
• 카카오톡 PC 버전에 대한 분석 필요
HanScan Plugin• 열어둔 한글 파일에 대한 취약점 여부 스캔
• Nurilab의 HwpScan2를 참조할 예정
#최근 진행중인 프로젝트
• Volatility Cookbook
부제 : 파이썬으로시작하는달콤한메모리포렌식
라이브 포렌식
윈도우 메모리 구조
Volatility 설치 및 기본 사용법
외부 플러그인 활용법
Volatility 플러그인 제작
해킹 방어 대회 - 메모리 포렌식 문제 풀이
ReferenceForensic Proof (김진국) – 메모리 분석 방안
AhnLab 보안 이슈 – ASEC 장영준 선임 연구원
윈도우 포렌식 실전 가이드 – 고원봉
Windows 구조와 원리 – 정덕영
The Art of Memory Forensic – Michael Hale Ligh
DailySecu 칼럼 – Plainbit 이준형 연구원