Volatility - CheatSheet
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
โ
๋ฉ๋ชจ๋ฆฌ ๋ถ์์ ์๋ํํ๊ณ ๋ค์ํ ์ค์บ ๋ ๋ฒจ๋ก ์ฌ๋ฌ Volatility3 ํ๋ฌ๊ทธ์ธ์ ๋ณ๋ ฌ๋ก ์คํํ๋ ๋๊ตฌ๊ฐ ํ์ํ๋ค๋ฉด, autoVolatility3๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค: https://github.com/H3xKatana/autoVolatility3/
# Full scan (runs all plugins)
python3 autovol3.py -f MEMFILE -o OUT_DIR -s full
# Minimal scan (runs a limited set of plugins)
python3 autovol3.py -f MEMFILE -o OUT_DIR -s minimal
# Normal scan (runs a balanced set of plugins)
python3 autovol3.py -f MEMFILE -o OUT_DIR -s normal
๋น ๋ฅด๊ณ ๋ฏธ์น ๋ฏํ ๊ฒ์ ์ํ๋ค๋ฉด ์ฌ๋ฌ Volatility ํ๋ฌ๊ทธ์ธ์ ๋ณ๋ ฌ๋ก ์คํํ ์ ์๋ ๋ค์์ ์ฌ์ฉํ ์ ์์ต๋๋ค: https://github.com/carlospolop/autoVolatility
python autoVolatility.py -f MEMFILE -d OUT_DIRECTORY -e /home/user/tools/volatility/vol.py # It will use the most important plugins (could use a lot of space depending on the size of the memory)
์ค์น
volatility3
git clone https://github.com/volatilityfoundation/volatility3.git
cd volatility3
python3 setup.py install
python3 vol.py โh
volatility2
Download the executable from https://www.volatilityfoundation.org/26
Volatility ๋ช ๋ น์ด
๊ณต์ ๋ฌธ์๋ Volatility ๋ช ๋ น์ด ์ฐธ์กฐ์์ ํ์ธํ ์ ์์ต๋๋ค.
โlistโ์ โscanโ ํ๋ฌ๊ทธ์ธ์ ๋ํ ์ฃผ์์ฌํญ
Volatility๋ ํ๋ฌ๊ทธ์ธ์ ๋ํด ๋ ๊ฐ์ง ์ฃผ์ ์ ๊ทผ ๋ฐฉ์์ ๊ฐ์ง๊ณ ์์ผ๋ฉฐ, ์ด๋ ๋๋๋ก ์ด๋ฆ์ ๋ฐ์๋ฉ๋๋ค. โlistโ ํ๋ฌ๊ทธ์ธ์ Windows ์ปค๋ ๊ตฌ์กฐ๋ฅผ ํ์ํ์ฌ ํ๋ก์ธ์ค(๋ฉ๋ชจ๋ฆฌ์์ _EPROCESS ๊ตฌ์กฐ์ ์ฐ๊ฒฐ ๋ฆฌ์คํธ๋ฅผ ์ฐพ๊ณ ํ์)์ OS ํธ๋ค(ํธ๋ค ํ
์ด๋ธ์ ์ฐพ๊ณ ๋์ดํ๋ฉฐ, ๋ฐ๊ฒฌ๋ ํฌ์ธํฐ๋ฅผ ์ญ์ฐธ์กฐ ๋ฑ)๊ณผ ๊ฐ์ ์ ๋ณด๋ฅผ ๊ฒ์ํ๋ ค๊ณ ํฉ๋๋ค. ์ด๋ค์ ์์ฒญ ์ Windows API์ฒ๋ผ ๋์ํฉ๋๋ค. ์๋ฅผ ๋ค์ด, ํ๋ก์ธ์ค๋ฅผ ๋์ดํ๋ ๊ฒฝ์ฐ์
๋๋ค.
์ด๋ก ์ธํด โlistโ ํ๋ฌ๊ทธ์ธ์ ๊ฝค ๋น ๋ฅด์ง๋ง, ์
์ฑ ์ํํธ์จ์ด์ ์ํด ์กฐ์๋ ์ ์๋ Windows API์ ๋ง์ฐฌ๊ฐ์ง๋ก ์ทจ์ฝํฉ๋๋ค. ์๋ฅผ ๋ค์ด, ์
์ฑ ์ํํธ์จ์ด๊ฐ DKOM์ ์ฌ์ฉํ์ฌ ํ๋ก์ธ์ค๋ฅผ _EPROCESS ์ฐ๊ฒฐ ๋ฆฌ์คํธ์์ ๋ถ๋ฆฌํ๋ฉด, ์์
๊ด๋ฆฌ์์ ๋ํ๋์ง ์์ผ๋ฉฐ pslist์์๋ ๋ํ๋์ง ์์ต๋๋ค.
๋ฐ๋ฉด โscanโ ํ๋ฌ๊ทธ์ธ์ ํน์ ๊ตฌ์กฐ๋ก ์ญ์ฐธ์กฐ๋ ๋ ์๋ฏธ๊ฐ ์์ ์ ์๋ ๊ฒ๋ค์ ๋ฉ๋ชจ๋ฆฌ์์ ์กฐ๊ฐ๋ด๋ ์ ๊ทผ ๋ฐฉ์์ ์ทจํฉ๋๋ค. ์๋ฅผ ๋ค์ด, psscan์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์ฝ๊ณ _EPROCESS ๊ฐ์ฒด๋ฅผ ๋ง๋ค๋ ค๊ณ ์๋ํฉ๋๋ค(๊ตฌ์กฐ์ ์กด์ฌ๋ฅผ ๋ํ๋ด๋ 4๋ฐ์ดํธ ๋ฌธ์์ด์ ๊ฒ์ํ๋ ํ ํ๊ทธ ์ค์บ๋์ ์ฌ์ฉํฉ๋๋ค). ์ฅ์ ์ ์ข
๋ฃ๋ ํ๋ก์ธ์ค๋ฅผ ์ฐพ์๋ผ ์ ์์ผ๋ฉฐ, ์
์ฑ ์ํํธ์จ์ด๊ฐ _EPROCESS ์ฐ๊ฒฐ ๋ฆฌ์คํธ๋ฅผ ์กฐ์ํ๋๋ผ๋ ํ๋ฌ๊ทธ์ธ์ ์ฌ์ ํ ๋ฉ๋ชจ๋ฆฌ์์ ๊ตฌ์กฐ๋ฅผ ์ฐพ์๋ผ ์ ์์ต๋๋ค(ํ๋ก์ธ์ค๊ฐ ์คํ๋๊ธฐ ์ํด์๋ ์ฌ์ ํ ์กด์ฌํด์ผ ํ๋ฏ๋ก). ๋จ์ ์ โscanโ ํ๋ฌ๊ทธ์ธ์ด โlistโ ํ๋ฌ๊ทธ์ธ๋ณด๋ค ์ฝ๊ฐ ๋๋ฆฌ๋ฉฐ, ๋๋๋ก ์๋ชป๋ ๊ธ์ ๊ฒฐ๊ณผ๋ฅผ ์ด๋ํ ์ ์์ต๋๋ค(๋๋ฌด ์ค๋ ์ ์ ์ข
๋ฃ๋ ํ๋ก์ธ์ค์ ๊ทธ ๊ตฌ์กฐ์ ์ผ๋ถ๊ฐ ๋ค๋ฅธ ์์
์ ์ํด ๋ฎ์ด์์์ง ๊ฒฝ์ฐ).
์ถ์ฒ: http://tomchop.me/2016/11/21/tutorial-volatility-plugins-malware-analysis/
OS ํ๋กํ์ผ
Volatility3
readme์ ์ค๋ช
๋ ๋ฐ์ ๊ฐ์ด ์ง์ํ๋ ค๋ OS์ ์ฌ๋ณผ ํ
์ด๋ธ์ _volatility3/volatility/symbols_์ ๋ฃ์ด์ผ ํฉ๋๋ค.
๋ค์ํ ์ด์ ์ฒด์ ์ ๋ํ ์ฌ๋ณผ ํ
์ด๋ธ ํฉ์ ๋ค์ด๋ก๋ํ ์ ์์ต๋๋ค:
- https://downloads.volatilityfoundation.org/volatility3/symbols/windows.zip
- https://downloads.volatilityfoundation.org/volatility3/symbols/mac.zip
- https://downloads.volatilityfoundation.org/volatility3/symbols/linux.zip
Volatility2
์ธ๋ถ ํ๋กํ์ผ
์ง์๋๋ ํ๋กํ์ผ ๋ชฉ๋ก์ ์ป์ผ๋ ค๋ฉด ๋ค์์ ์ํํ ์ ์์ต๋๋ค:
./volatility_2.6_lin64_standalone --info | grep "Profile"
์๋ก ๋ค์ด๋ก๋ํ ํ๋กํ์ ์ฌ์ฉํ๋ ค๋ฉด (์: ๋ฆฌ๋ ์ค ํ๋กํ) ๋ค์ ํด๋ ๊ตฌ์กฐ๋ฅผ ์์ฑํด์ผ ํฉ๋๋ค: plugins/overlays/linux ์ด ํด๋ ์์ ํ๋กํ์ด ํฌํจ๋ zip ํ์ผ์ ๋ฃ์ต๋๋ค. ๊ทธ๋ฐ ๋ค์, ํ๋กํ์ ๋ฒํธ๋ฅผ ์ป์ผ๋ ค๋ฉด ๋ค์์ ์ฌ์ฉํ์ธ์:
./vol --plugins=/home/kali/Desktop/ctfs/final/plugins --info
Volatility Foundation Volatility Framework 2.6
Profiles
--------
LinuxCentOS7_3_10_0-123_el7_x86_64_profilex64 - A Profile for Linux CentOS7_3.10.0-123.el7.x86_64_profile x64
VistaSP0x64 - A Profile for Windows Vista SP0 x64
VistaSP0x86 - A Profile for Windows Vista SP0 x86
Linux ๋ฐ Mac ํ๋กํ์ ๋ค์ด๋ก๋ํ ์ ์์ต๋๋ค https://github.com/volatilityfoundation/profiles
์ด์ ๋ถ๋ถ์์ ํ๋กํ ์ด๋ฆ์ด LinuxCentOS7_3_10_0-123_el7_x86_64_profilex64์ธ ๊ฒ์ ๋ณผ ์ ์์ผ๋ฉฐ, ์ด๋ฅผ ์ฌ์ฉํ์ฌ ๋ค์๊ณผ ๊ฐ์ ์์
์ ์คํํ ์ ์์ต๋๋ค:
./vol -f file.dmp --plugins=. --profile=LinuxCentOS7_3_10_0-123_el7_x86_64_profilex64 linux_netscan
ํ๋กํ ๋ฐ๊ฒฌ
volatility imageinfo -f file.dmp
volatility kdbgscan -f file.dmp
imageinfo์ kdbgscan์ ์ฐจ์ด์
์ฌ๊ธฐ์์: profile ์ ์์ ๋จ์ํ ์ ๊ณตํ๋ imageinfo์ ๋ฌ๋ฆฌ, kdbgscan์ ์ฌ๋ฐ๋ฅธ ํ๋กํ๊ณผ ์ฌ๋ฐ๋ฅธ KDBG ์ฃผ์(์ฌ๋ฌ ๊ฐ๊ฐ ์์ ๊ฒฝ์ฐ)๋ฅผ ๊ธ์ ์ ์ผ๋ก ์๋ณํ๋๋ก ์ค๊ณ๋์์ต๋๋ค. ์ด ํ๋ฌ๊ทธ์ธ์ Volatility ํ๋กํ๊ณผ ์ฐ๊ฒฐ๋ KDBGHeader ์๋ช ์ ์ค์บํ๊ณ ์๋ชป๋ ๊ธ์ ๊ฒฐ๊ณผ๋ฅผ ์ค์ด๊ธฐ ์ํด ์ ์์ฑ ๊ฒ์ฌ๋ฅผ ์ ์ฉํฉ๋๋ค. ์ถ๋ ฅ์ ์์ธ๋์ ์ํํ ์ ์๋ ์ ์์ฑ ๊ฒ์ฌ ์๋ Volatility๊ฐ DTB๋ฅผ ์ฐพ์ ์ ์๋์ง์ ๋ฐ๋ผ ๋ฌ๋ผ์ง๋ฏ๋ก, ์ด๋ฏธ ์ฌ๋ฐ๋ฅธ ํ๋กํ์ ์๊ณ ์๊ฑฐ๋ imageinfo์์ ํ๋กํ ์ ์์ ๋ฐ์ ๊ฒฝ์ฐ, ๋ฐ๋์ ๊ทธ๊ฒ์ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
ํญ์ kdbgscan์ด ์ฐพ์ ํ๋ก์ธ์ค ์๋ฅผ ํ์ธํ์ธ์. ๋๋๋ก imageinfo์ kdbgscan์ ํ๋ ์ด์์ ์ ํฉํ ํ๋กํ์ ์ฐพ์ ์ ์์ง๋ง, ์ ํจํ ํ๋กํ๋ง ํ๋ก์ธ์ค์ ๊ด๋ จ๋ ์ ๋ณด๋ฅผ ๊ฐ์ง๋๋ค(์ด๋ ํ๋ก์ธ์ค๋ฅผ ์ถ์ถํ๊ธฐ ์ํด ์ฌ๋ฐ๋ฅธ KDBG ์ฃผ์๊ฐ ํ์ํ๊ธฐ ๋๋ฌธ์ ๋๋ค).
# GOOD
PsActiveProcessHead : 0xfffff800011977f0 (37 processes)
PsLoadedModuleList : 0xfffff8000119aae0 (116 modules)
# BAD
PsActiveProcessHead : 0xfffff800011947f0 (0 processes)
PsLoadedModuleList : 0xfffff80001197ac0 (0 modules)
KDBG
์ปค๋ ๋๋ฒ๊ฑฐ ๋ธ๋ก์ Volatility์์ KDBG๋ก ์ธ๊ธ๋๋ฉฐ, Volatility์ ๋ค์ํ ๋๋ฒ๊ฑฐ๊ฐ ์ํํ๋ ํฌ๋ ์ ์์
์ ํ์์ ์
๋๋ค. KdDebuggerDataBlock์ผ๋ก ์๋ณ๋๋ฉฐ _KDDEBUGGER_DATA64 ์ ํ์ ๊ฐ์ง๋ฉฐ, PsActiveProcessHead์ ๊ฐ์ ํ์ ์ฐธ์กฐ๋ฅผ ํฌํจํฉ๋๋ค. ์ด ํน์ ์ฐธ์กฐ๋ ํ๋ก์ธ์ค ๋ชฉ๋ก์ ํค๋๋ฅผ ๊ฐ๋ฆฌํค๋ฉฐ, ๋ชจ๋ ํ๋ก์ธ์ค๋ฅผ ๋์ดํ ์ ์๊ฒ ํ์ฌ ์ฒ ์ ํ ๋ฉ๋ชจ๋ฆฌ ๋ถ์์ ๊ธฐ๋ณธ์ ์
๋๋ค.
OS ์ ๋ณด
#vol3 has a plugin to give OS information (note that imageinfo from vol2 will give you OS info)
./vol.py -f file.dmp windows.info.Info
ํ๋ฌ๊ทธ์ธ banners.Banners๋ vol3์์ ๋คํ์์ ๋ฆฌ๋
์ค ๋ฐฐ๋๋ฅผ ์ฐพ๊ธฐ ์ํด ์ฌ์ฉํ ์ ์์ต๋๋ค.
ํด์/๋น๋ฐ๋ฒํธ
SAM ํด์, ๋๋ฉ์ธ ์บ์ ์๊ฒฉ ์ฆ๋ช ๋ฐ lsa ๋น๋ฐ์ ์ถ์ถํฉ๋๋ค.
./vol.py -f file.dmp windows.hashdump.Hashdump #Grab common windows hashes (SAM+SYSTEM)
./vol.py -f file.dmp windows.cachedump.Cachedump #Grab domain cache hashes inside the registry
./vol.py -f file.dmp windows.lsadump.Lsadump #Grab lsa secrets
๋ฉ๋ชจ๋ฆฌ ๋คํ
ํ๋ก์ธ์ค์ ๋ฉ๋ชจ๋ฆฌ ๋คํ๋ ํ๋ก์ธ์ค์ ํ์ฌ ์ํ๋ฅผ ๋ชจ๋ ์ถ์ถํฉ๋๋ค. procdump ๋ชจ๋์ ์ฝ๋๋ง ์ถ์ถํฉ๋๋ค.
volatility -f file.dmp --profile=Win7SP1x86 memdump -p 2168 -D conhost/
ํ๋ก์ธ์ค
ํ๋ก์ธ์ค ๋ชฉ๋ก
์์ฌ์ค๋ฌ์ด ํ๋ก์ธ์ค(์ด๋ฆ์ผ๋ก) ๋๋ ์์์น ๋ชปํ ์์ ํ๋ก์ธ์ค(์: iexplorer.exe์ ์์์ผ๋ก cmd.exe)๋ฅผ ์ฐพ์ผ๋ ค๊ณ ์๋ํ์ญ์์ค.
pslist์ ๊ฒฐ๊ณผ๋ฅผ psscan์ ๊ฒฐ๊ณผ์ ๋น๊ตํ์ฌ ์จ๊ฒจ์ง ํ๋ก์ธ์ค๋ฅผ ์๋ณํ๋ ๊ฒ์ด ํฅ๋ฏธ๋ก์ธ ์ ์์ต๋๋ค.
python3 vol.py -f file.dmp windows.pstree.PsTree # Get processes tree (not hidden)
python3 vol.py -f file.dmp windows.pslist.PsList # Get process list (EPROCESS)
python3 vol.py -f file.dmp windows.psscan.PsScan # Get hidden process list(malware)
๋คํ ํ๋ก์ธ์ค
./vol.py -f file.dmp windows.dumpfiles.DumpFiles --pid <pid> #Dump the .exe and dlls of the process in the current directory
๋ช ๋ น์ค
์์ฌ์ค๋ฌ์ด ๊ฒ์ด ์คํ๋์๋์?
python3 vol.py -f file.dmp windows.cmdline.CmdLine #Display process command-line arguments
cmd.exe์์ ์คํ๋ ๋ช
๋ น์ conhost.exe (๋๋ Windows 7 ์ด์ ์์คํ
์ ๊ฒฝ์ฐ csrss.exe)์ ์ํด ๊ด๋ฆฌ๋ฉ๋๋ค. ์ด๋ ๊ณต๊ฒฉ์๊ฐ ๋ฉ๋ชจ๋ฆฌ ๋คํ๊ฐ ์ป์ด์ง๊ธฐ ์ ์ **cmd.exe**๋ฅผ ์ข
๋ฃํ๋๋ผ๋ **conhost.exe**์ ๋ฉ๋ชจ๋ฆฌ์์ ์ธ์
์ ๋ช
๋ น ๊ธฐ๋ก์ ๋ณต๊ตฌํ ์ ์์์ ์๋ฏธํฉ๋๋ค. ์ด๋ฅผ ์ํด ์ฝ์์ ๋ชจ๋ ๋ด์์ ๋น์ ์์ ์ธ ํ๋์ด ๊ฐ์ง๋๋ฉด ๊ด๋ จ๋ conhost.exe ํ๋ก์ธ์ค์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋คํํด์ผ ํฉ๋๋ค. ๊ทธ๋ฐ ๋ค์ ์ด ๋คํ ๋ด์์ strings๋ฅผ ๊ฒ์ํ์ฌ ์ธ์
์์ ์ฌ์ฉ๋ ๋ช
๋ น์ค์ ์ถ์ถํ ์ ์์ต๋๋ค.
ํ๊ฒฝ
๊ฐ ์คํ ์ค์ธ ํ๋ก์ธ์ค์ ํ๊ฒฝ ๋ณ์๋ฅผ ๊ฐ์ ธ์ต๋๋ค. ํฅ๋ฏธ๋ก์ด ๊ฐ์ด ์์ ์ ์์ต๋๋ค.
python3 vol.py -f file.dmp windows.envars.Envars [--pid <pid>] #Display process environment variables
ํ ํฐ ๊ถํ
์์์น ๋ชปํ ์๋น์ค์์ ๊ถํ ํ ํฐ์ ํ์ธํ์ญ์์ค.
ํน๊ถ ํ ํฐ์ ์ฌ์ฉํ๋ ํ๋ก์ธ์ค๋ฅผ ๋์ดํ๋ ๊ฒ์ด ํฅ๋ฏธ๋ก์ธ ์ ์์ต๋๋ค.
#Get enabled privileges of some processes
python3 vol.py -f file.dmp windows.privileges.Privs [--pid <pid>]
#Get all processes with interesting privileges
python3 vol.py -f file.dmp windows.privileges.Privs | grep "SeImpersonatePrivilege\|SeAssignPrimaryPrivilege\|SeTcbPrivilege\|SeBackupPrivilege\|SeRestorePrivilege\|SeCreateTokenPrivilege\|SeLoadDriverPrivilege\|SeTakeOwnershipPrivilege\|SeDebugPrivilege"
SIDs
ํ๋ก์ธ์ค๊ฐ ์์ ํ ๊ฐ SSID๋ฅผ ํ์ธํ์ญ์์ค.
ํน๊ถ SID๋ฅผ ์ฌ์ฉํ๋ ํ๋ก์ธ์ค(๋ฐ ์ผ๋ถ ์๋น์ค SID๋ฅผ ์ฌ์ฉํ๋ ํ๋ก์ธ์ค)๋ฅผ ๋์ดํ๋ ๊ฒ์ด ํฅ๋ฏธ๋ก์ธ ์ ์์ต๋๋ค.
./vol.py -f file.dmp windows.getsids.GetSIDs [--pid <pid>] #Get SIDs of processes
./vol.py -f file.dmp windows.getservicesids.GetServiceSIDs #Get the SID of services
ํธ๋ค
ํ๋ก์ธ์ค๊ฐ ํธ๋ค์ ๊ฐ์ง๊ณ ์๋ ๋ค๋ฅธ ํ์ผ, ํค, ์ค๋ ๋, ํ๋ก์ธ์ค ๋ฑ์ ๋ํ ์ ๋ณด๋ฅผ ์๋ ๊ฒ์ด ์ ์ฉํฉ๋๋ค.
vol.py -f file.dmp windows.handles.Handles [--pid <pid>]
DLLs
./vol.py -f file.dmp windows.dlllist.DllList [--pid <pid>] #List dlls used by each
./vol.py -f file.dmp windows.dumpfiles.DumpFiles --pid <pid> #Dump the .exe and dlls of the process in the current directory process
ํ๋ก์ธ์ค๋ณ ๋ฌธ์์ด
Volatility๋ ๋ฌธ์์ด์ด ์ด๋ค ํ๋ก์ธ์ค์ ์ํ๋์ง ํ์ธํ ์ ์๊ฒ ํด์ค๋๋ค.
strings file.dmp > /tmp/strings.txt
./vol.py -f /tmp/file.dmp windows.strings.Strings --strings-file /tmp/strings.txt
์ด๊ฒ์ ๋ํ yarascan ๋ชจ๋์ ์ฌ์ฉํ์ฌ ํ๋ก์ธ์ค ๋ด์์ ๋ฌธ์์ด์ ๊ฒ์ํ ์ ์๊ฒ ํด์ค๋๋ค:
./vol.py -f file.dmp windows.vadyarascan.VadYaraScan --yara-rules "https://" --pid 3692 3840 3976 3312 3084 2784
./vol.py -f file.dmp yarascan.YaraScan --yara-rules "https://"
UserAssist
Windows๋ UserAssist keys๋ผ๋ ๋ ์ง์คํธ๋ฆฌ ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ฌ ์คํํ ํ๋ก๊ทธ๋จ์ ์ถ์ ํฉ๋๋ค. ์ด ํค๋ ๊ฐ ํ๋ก๊ทธ๋จ์ด ์คํ๋ ํ์์ ๋ง์ง๋ง ์คํ ์๊ฐ์ ๊ธฐ๋กํฉ๋๋ค.
./vol.py -f file.dmp windows.registry.userassist.UserAssist
โ
์๋น์ค
./vol.py -f file.dmp windows.svcscan.SvcScan #List services
./vol.py -f file.dmp windows.getservicesids.GetServiceSIDs #Get the SID of services
๋คํธ์ํฌ
./vol.py -f file.dmp windows.netscan.NetScan
#For network info of linux use volatility2
๋ ์ง์คํธ๋ฆฌ ํ์ด๋ธ
์ฌ์ฉ ๊ฐ๋ฅํ ํ์ด๋ธ ์ธ์
./vol.py -f file.dmp windows.registry.hivelist.HiveList #List roots
./vol.py -f file.dmp windows.registry.printkey.PrintKey #List roots and get initial subkeys
๊ฐ์ ๊ฐ์ ธ์ค๊ธฐ
./vol.py -f file.dmp windows.registry.printkey.PrintKey --key "Software\Microsoft\Windows NT\CurrentVersion"
๋คํ
#Dump a hive
volatility --profile=Win7SP1x86_23418 hivedump -o 0x9aad6148 -f file.dmp #Offset extracted by hivelist
#Dump all hives
volatility --profile=Win7SP1x86_23418 hivedump -f file.dmp
ํ์ผ ์์คํ
๋ง์ดํธ
#See vol2
์ค์บ/๋คํ
./vol.py -f file.dmp windows.filescan.FileScan #Scan for files inside the dump
./vol.py -f file.dmp windows.dumpfiles.DumpFiles --physaddr <0xAAAAA> #Offset from previous command
๋ง์คํฐ ํ์ผ ํ ์ด๋ธ
# I couldn't find any plugin to extract this information in volatility3
NTFS ํ์ผ ์์คํ ์ ๋ง์คํฐ ํ์ผ ํ ์ด๋ธ (MFT)๋ก ์๋ ค์ง ์ค์ํ ๊ตฌ์ฑ ์์๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ด ํ ์ด๋ธ์ ๋ณผ๋ฅจ์ ๋ชจ๋ ํ์ผ์ ๋ํด ์ต์ํ ํ๋์ ํญ๋ชฉ์ ํฌํจํ๋ฉฐ, MFT ์์ฒด๋ ํฌํจ๋ฉ๋๋ค. ๊ฐ ํ์ผ์ ๋ํ ์ค์ํ ์ธ๋ถ์ ๋ณด, ์๋ฅผ ๋ค์ด ํฌ๊ธฐ, ํ์์คํฌํ, ๊ถํ ๋ฐ ์ค์ ๋ฐ์ดํฐ๋ MFT ํญ๋ชฉ ๋ด ๋๋ MFT ์ธ๋ถ์ ์์ญ์ ์บก์ํ๋์ด ์์ผ๋ฉฐ, ์ด๋ฌํ ํญ๋ชฉ์ ์ํด ์ฐธ์กฐ๋ฉ๋๋ค. ๋ ๋ง์ ์ธ๋ถ์ ๋ณด๋ ๊ณต์ ๋ฌธ์์์ ํ์ธํ ์ ์์ต๋๋ค.
SSL ํค/์ธ์ฆ์
#vol3 allows to search for certificates inside the registry
./vol.py -f file.dmp windows.registry.certificates.Certificates
์ ์ฑ์ฝ๋
./vol.py -f file.dmp windows.malfind.Malfind [--dump] #Find hidden and injected code, [dump each suspicious section]
#Malfind will search for suspicious structures related to malware
./vol.py -f file.dmp windows.driverirp.DriverIrp #Driver IRP hook detection
./vol.py -f file.dmp windows.ssdt.SSDT #Check system call address from unexpected addresses
./vol.py -f file.dmp linux.check_afinfo.Check_afinfo #Verifies the operation function pointers of network protocols
./vol.py -f file.dmp linux.check_creds.Check_creds #Checks if any processes are sharing credential structures
./vol.py -f file.dmp linux.check_idt.Check_idt #Checks if the IDT has been altered
./vol.py -f file.dmp linux.check_syscall.Check_syscall #Check system call table for hooks
./vol.py -f file.dmp linux.check_modules.Check_modules #Compares module list to sysfs info, if available
./vol.py -f file.dmp linux.tty_check.tty_check #Checks tty devices for hooks
Yara๋ก ์ค์บํ๊ธฐ
์ด ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ์ฌ github์์ ๋ชจ๋ yara ์
์ฑ์ฝ๋ ๊ท์น์ ๋ค์ด๋ก๋ํ๊ณ ๋ณํฉํ์ธ์: https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9
rules ๋๋ ํ ๋ฆฌ๋ฅผ ๋ง๋ค๊ณ ์คํํ์ธ์. ์ด๋ ๊ฒ ํ๋ฉด ๋ชจ๋ ์
์ฑ์ฝ๋์ ๋ํ yara ๊ท์น์ด ํฌํจ๋ _malware_rules.yar_๋ผ๋ ํ์ผ์ด ์์ฑ๋ฉ๋๋ค.
wget https://gist.githubusercontent.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9/raw/4ec711d37f1b428b63bed1f786b26a0654aa2f31/malware_yara_rules.py
mkdir rules
python malware_yara_rules.py
#Only Windows
./vol.py -f file.dmp windows.vadyarascan.VadYaraScan --yara-file /tmp/malware_rules.yar
#All
./vol.py -f file.dmp yarascan.YaraScan --yara-file /tmp/malware_rules.yar
MISC
์ธ๋ถ ํ๋ฌ๊ทธ์ธ
์ธ๋ถ ํ๋ฌ๊ทธ์ธ์ ์ฌ์ฉํ๋ ค๋ฉด ํ๋ฌ๊ทธ์ธ๊ณผ ๊ด๋ จ๋ ํด๋๊ฐ ์ฌ์ฉ๋๋ ์ฒซ ๋ฒ์งธ ๋งค๊ฐ๋ณ์์ธ์ง ํ์ธํ์ธ์.
./vol.py --plugin-dirs "/tmp/plugins/" [...]
Autoruns
https://github.com/tomchop/volatility-autoruns์์ ๋ค์ด๋ก๋ํ์ธ์.
volatility --plugins=volatility-autoruns/ --profile=WinXPSP2x86 -f file.dmp autoruns
๋ฎคํ ์ค
./vol.py -f file.dmp windows.mutantscan.MutantScan
์ฌ๋ณผ๋ฆญ ๋งํฌ
./vol.py -f file.dmp windows.symlinkscan.SymlinkScan
Bash
๋ฉ๋ชจ๋ฆฌ์์ bash ํ์คํ ๋ฆฌ๋ฅผ ์ฝ๋ ๊ฒ์ด ๊ฐ๋ฅํฉ๋๋ค. .bash_history ํ์ผ์ ๋คํํ ์๋ ์์ง๋ง, ๋นํ์ฑํ๋์ด ์์ผ๋ฏ๋ก ์ด volatility ๋ชจ๋์ ์ฌ์ฉํ ์ ์์ด ๊ธฐ์ ๊ฒ์ ๋๋ค.
./vol.py -f file.dmp linux.bash.Bash
ํ์๋ผ์ธ
./vol.py -f file.dmp timeLiner.TimeLiner
๋๋ผ์ด๋ฒ
./vol.py -f file.dmp windows.driverscan.DriverScan
ํด๋ฆฝ๋ณด๋ ๊ฐ์ ธ์ค๊ธฐ
#Just vol2
volatility --profile=Win7SP1x86_23418 clipboard -f file.dmp
IE ๊ธฐ๋ก ๊ฐ์ ธ์ค๊ธฐ
#Just vol2
volatility --profile=Win7SP1x86_23418 iehistory -f file.dmp
๋ฉ๋ชจ์ฅ ํ ์คํธ ๊ฐ์ ธ์ค๊ธฐ
#Just vol2
volatility --profile=Win7SP1x86_23418 notepad -f file.dmp
์คํฌ๋ฆฐ์ท
#Just vol2
volatility --profile=Win7SP1x86_23418 screenshot -f file.dmp
๋ง์คํฐ ๋ถํธ ๋ ์ฝ๋ (MBR)
volatility --profile=Win7SP1x86_23418 mbrparser -f file.dmp
**๋ง์คํฐ ๋ถํธ ๋ ์ฝ๋ (MBR)**๋ ์ ์ฅ ๋งค์ฒด์ ๋ ผ๋ฆฌ์ ํํฐ์ ์ ๊ด๋ฆฌํ๋ ๋ฐ ์ค์ํ ์ญํ ์ ํ๋ฉฐ, ์ด๋ ๋ค์ํ ํ์ผ ์์คํ ์ผ๋ก ๊ตฌ์กฐํ๋์ด ์์ต๋๋ค. MBR์ ํํฐ์ ๋ ์ด์์ ์ ๋ณด๋ฅผ ๋ณด์ ํ ๋ฟ๋ง ์๋๋ผ ๋ถํธ ๋ก๋๋ก ์๋ํ๋ ์คํ ๊ฐ๋ฅํ ์ฝ๋๋ ํฌํจํ๊ณ ์์ต๋๋ค. ์ด ๋ถํธ ๋ก๋๋ OS์ 2๋จ๊ณ ๋ก๋ฉ ํ๋ก์ธ์ค๋ฅผ ์ง์ ์์ํ๊ฑฐ๋ (์์ธํ ๋ด์ฉ์ 2๋จ๊ณ ๋ถํธ ๋ก๋ ์ฐธ์กฐ) ๊ฐ ํํฐ์ ์ ๋ณผ๋ฅจ ๋ถํธ ๋ ์ฝ๋ (VBR)์ ์กฐํ๋ฅผ ์ด๋ฃจ์ด ์๋ํฉ๋๋ค. ์ฌ์ธต์ ์ธ ์ง์์ MBR ์ํค ํ์ด์ง๋ฅผ ์ฐธ์กฐํ์ญ์์ค.
References
- https://andreafortuna.org/2017/06/25/volatility-my-own-cheatsheet-part-1-image-identification/
- https://scudette.blogspot.com/2012/11/finding-kernel-debugger-block.html
- https://or10nlabs.tech/cgi-sys/suspendedpage.cgi
- https://www.aldeid.com/wiki/Windows-userassist-keys โ* https://learn.microsoft.com/en-us/windows/win32/fileio/master-file-table
- https://answers.microsoft.com/en-us/windows/forum/all/uefi-based-pc-protective-mbr-what-is-it/0fc7b558-d8d4-4a7d-bae2-395455bb19aa
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


