[volatility 3] 설치 및 리눅스(ubuntu) 메모리 분석
Volatility 는 메모리 포렌식 도구이다.
윈도우는 그냥 뚝딱 뚝딱 만들면 되는데 리눅스는 분석하는 방법이 적어서 직접 올린다.
https://github.com/volatilityfoundation/volatility3
GitHub - volatilityfoundation/volatility3: Volatility 3.0 development
Volatility 3.0 development. Contribute to volatilityfoundation/volatility3 development by creating an account on GitHub.
github.com
여기서 설치 할 수 있다.
git clone https://github.com/volatilityfoundation/volatility3.git
깃 클론 떠주고
pip3 install -r requirement.txt
필수 패키지 설치해준다.
python3 setup.py build
python3 setup.py install
시키는 대로 깔아준다.
python3 vol.py -h
실행 되는지 확인한다.
메모리 분석을 할 때는 크게 2가지가 중요한데, 첫 번째는 메모리를 덤프한 운영 체제에 맞는 symbol이 필요하다. 그리고 두 번째는 당연히 제대로 뜬 메모리 덤프 파일이 필요하다. 여기선 LiME을 써서 떴다.
이 심볼은 윈도우 같은 경우 어차피 커널 버전이 몇 개 없기 때문에 기본적으로 제공하지만 리눅스의 경우 커널 빌드 버전에 따라 심볼을 따로 준비해 줘야 한다. 그런데 vol3에서 기본으로 제공하는 리눅스 심볼은 전부 구버전이라.. 직접 찾아서 넣어야 한다.
일단 메모리 덤프 뜨는 방법 부터
https://github.com/504ensicsLabs/LiME
GitHub - 504ensicsLabs/LiME: LiME (formerly DMD) is a Loadable Kernel Module (LKM), which allows the acquisition of volatile mem
LiME (formerly DMD) is a Loadable Kernel Module (LKM), which allows the acquisition of volatile memory from Linux and Linux-based devices, such as those powered by Android. The tool supports acquir...
github.com
이걸 리눅스에서 깔아서 뜨면 된다.
gcc도 설치되어 있어야 한다.
없으면 apt install로 깔아주면 된다.
git clone https://github.com/504ensicsLabs/LiME.git
cd LiME
cd src
make
sudo insmod lime-5.4.0-150-generic.ko "path=memdump.lime format=lime"
막줄에 sudo insmod lime-5.4.0-150-generic.ko "path=memdump.lime format=lime" 부분에서
lime-5.4.0-150-generic.ko 같은 경우에는 src/ 밑에 ls 쳐보면 자신의 커널 버전에 맞게 생성되어 있는 걸 볼 수 있고, 그 뒤에 memdump.lime은 생성할 메모리 덤프 파일이다. readme 보면 저걸 nc 써서 원격으로 뺄 수도 있다는데 귀찮으니 그냥 vmware에서 드래그앤드롭으로 옮기거나 scp로 옮겨주자.
+) 혹시 메모리 덤프를 다시 뜰려고 할 때 insmod: ERROR: could not insert module lime-5.4.0-150-generic.ko: File exists 이런 에러가 뜨면 sudo rmmod lime 를 쳐주면 된다.
4기가 짜리 (메모리가 4기가라서) 메모리 덤프가 완성되었다.
이제 저 버전에 맞는 심볼을 넣어주면 된다.
https://github.com/Abyss-W4tcher/volatility3-symbols
GitHub - Abyss-W4tcher/volatility3-symbols: Collection of Volatility3 symbols, generated against Linux and macOS kernels.
Collection of Volatility3 symbols, generated against Linux and macOS kernels. - Abyss-W4tcher/volatility3-symbols
github.com
직접 만들어도 되긴하는데, 귀찮으니 누가 만들어서 올려놓은 심볼을 찾아보자.
아까 보니까 5.4.0-150 이라고 되어 있었으니 그대로 찾아가면 된다.
저 2개의 파일을 다운받아서 volatility3/symbols/linux 폴더 밑에 넣어주면 된다.
기본적인 linux.bash 플러그인을 통해 저 당시 어떤 명령어를 쳤는지 확인 할 수 있다.