Security & Forensic

Forensic/Live Forensic +1
반응형

Rekall을 이용한 Live Forensic

 

Rekall을 이용한 Live Forensic에는 아래와 같이 두 가지 모드가 있다.

 

API Access

장점  : OS별 프로파일이 필요없으며 실행 속도가 빠르다. 주로 프로세스, 파일시스템, WMI 분석

단점  : 지원 플러그인 부족.  멀웨어나 히든 프로세스 분석 등 심층 분석 불가. OS API가 제공되는 범위 내 분석

 

Memory Analysis

장점  : 지원 플러그인 충분.  멀웨어나 히든 프로세스 분석 등 심층 분석 가능

단점  : OS별 프로파일 필요 실행 속도가 느리다. 결정적으로 프로파일 문제가 다수 발생하여 거의 실행이 안됨

위의 경우 이미지 포렌식이 아닌 라이브 포렌식의 경우이다. 

API Access의 경우 Rekall Stand-Alone 버전을 가지고 몇 가지 유용한 분석 내용을 살펴보도록 한다.

 

F:\tool\forensic\Rekall-Standalone>rekal.exe --live API

플러그인 목록

[1] Live (API) 14:54:57> dir(plugins)    

아티팩트 리스트

[1] Live (API) 14:57:26> artifact_list

artifact_view

[1] Live (API) 14:58:42> artifact_view "WindowsAppInitDLLs"

artifact_collector 
[1] Live (API) 15:00:16> artifact_collector "WMILoggedOnUsers", output_path="f:\\temp"

f:\\temp 폴더에 artifacts%2fWMILoggedOnUsers.csv, artifacts%2fWMILoggedOnUsers.json 파일이 생김

 

프로세스 조회
[1] Live (API) 15:02:09> pslist?
file:            f:\tool\forensic\rekall-standalone\rekall\plugins\response\processes.py
Plugin:          APIPslist (pslist)
:                This is a Typed Plugin.
Positional Args:   pids: One or more pids of processes to select. (type: ArrayIntParser)
Keyword Args:
  proc_regex: A regex to select a process by name. (type: RegEx)
  verbosity:  An integer reflecting the amount of desired output: 0 = quiet, 10 = noisy. (type: IntParser)
Docstring:       A live pslist plugin using the APIs.
Link:            http://www.rekall-forensic.com/epydocs/rekall.plugins.response.processes.APIPslist-class.html

 

pslist 구조

[1] Live (API) 15:03:13> describe pslist, max_depth=2

실행 프로세스 목록

실행 명령줄 조회

파일 검색

파일 조회

시간은 TimeStamp 값으로 표시됨

 

특정 날짜 이후로 생성이나 변경된 파일

F:\>timestamptodate.exe 2 "2020-03-01 00:00:00"
1582988400.0

 

[1] Live (API) 12:30:27> select path.filename, path.st_mtime from glob(globs: "f:\\temp\\*") where path.st_mtime > 1582988400.0

File Mactime Timeline

select Path, Path.st_ino, Path.st_mode, Path.st_uid.uid, Path.st_gid.gid, Path.st_size, Path.st_atime as a, Path.st_mtime as m, Path.st_ctime as c from hash(paths: ( select path from glob(globs: "c:\\windows\\*.exe") ).path.filename, hash: "md5")

yara_scan

Search for all the binaries in Folders that contain the string "xxxxxx" in hex format

plugins.search('select * from file_yara(paths: (select path.filename from glob("F:\\Test\\MacroFiles\\*")).filename, 

binary_string: {str})', query_parameters=dict(str="http".encode("utf-16-le").encode("hex")))

일반 ASC가 아닌 문서 내부에서 특정 단어 검색, 내부 매크로 존재나 내용 확인 등에 유효

 

실행 파일에서 특정 문자열 검색
select * from file_yara( paths: (select path.filename from glob("c:\\windows\\*.exe")).filename, 

yara_expression: "rule r1 {strings: $a = \"CreateRemoteThread\" wide condition: any of them}")

악성코드들이 자주 호출하여 사용하는 API 등 검색에 유효

 

반응형