2 Memory Analysis
2 Memory Analysis
Session 1.2
Install volatility from sources
Install volatility from sources
First install git
https://github.com/git-for-windows/git/releases/download/v2.34.0.windows.1/Git-2.34.0-64-bit.exe
Go to D: or E: or another drive
Update project
https://www.python.org/ftp/python/2.7.17/python-2.7.17.amd64.msi
http://www.microsoft.com/en-
us/download/details.aspx?id=44266
Install dependencies
Update pip if necessary
https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-
releases/2.49.3/stable_windows_10_cmake_Release_x64_graphviz-
install-2.49.3-win64.exe
Install Volatility 3
Python 3.6 or later
python3 vol.py -h
VOLATILITY
ON
LINUX
INSTALLED BY
DEFAULT
KALI LINUX
The easiest
OR
SIFT
what is present on the hard
disk and which is a ram dump?
Hiberfil.sys
HIBERFIL.SYS
Because hiberfil is compressed
we need to convert him
Hiberfil
Transform hiberfil to RAM dump
https://arsenalrecon.com/weapons/hibernation-recon/
Or with GUI
Hiberfil
Transform hiberfil to RAM dump :
Volatility (Windows 8) :
Vol.py –f hiberfil.sys imagecopy –O ./hiberfilTAW.raw
hibr2bin :
Hibr2Bin /PLATFORM X64 /MAJOR 6 /MINOR 1 /INPUT hiberfil.sys
/OUTPUT uncompressed.bin
Pagefile.sys
Use foremost tool on a linux distribution
https://github.com/korczis/foremost
page_brute-BETA.py -f F:\CloudStation\Formation-RAM\pagefile.sys -o
OUTPUT-DIR-NAME
$ strings * | less
Foremost (linux)
Memory.dmp
Extraction de chaines de caractères
Memory.dmp
Extraction de chaines de caractères
Memory.dmp
To dump a process by the hand
Procesxp64
NotMyFault
Crashinfo
Find infos on complete crashdump
https://github.com/aim4r/VolDiff/wiki
VolDiff – https://github.com/aim4r/VolDiff/wiki
How to find the windows Profile ?
Volatility 3 = windows.info
List of recent profile
No parent processes
Base Priority of 11
Username: NT AUTHORITY\SYSTEM
Username: NT AUTHORITY\SYSTEM
%SystemRoot%\system32\wininit.exe
Wininit.exe – Windows Initialization Process
Base Priority of 13
Creates %windir%\temp
Child to WININIT.EXE
%SystemRoot%\System32\wininit.exe
Username: NT AUTHORITY\SYSTEM
Services.exe – Service Control Manager
Base Priority of 9
Child to WININIT.EXE
%SystemRoot%\System32\lsass.exe
Base Priority of 9
LSASS.exe – Local Security Authority
Username: NT AUTHORITY\SYSTEM
%SystemRoot%\System32\svchost.exe
Parent of services.exe
Svchost.exe – Service Hosting Process
Base Priority of 8
Child to wininit.exe
%systemroot%\System32\lsm.exe
Lsm.exe – Load Session Manager Service
Base Priority of 8
Username: NT AUTHORITY\SYSTEM
No parent process
Base Priority of 8
%Systemroot%\Explorer.exe
Explorer.exe – Windows Explorer
Base Priority of 8
Path : %SystemRoot%\System32\taskhost.exe
Taskhostw.exe – Task manager
Base Priority of 8
Path : %SystemRoot%\System32\taskhostw.exe
https://www.youtube.com/watch?v=vpSIw-zGhhE
Display priority of processes
Windows
Linux
- Diff
- colordiff
Pslist – Display list chained processes
Thread scanning : A process manipulate at least one thread. Scan ETHREAD objects and map
their owning processes.
PspCid table : Every process' PID corresponds to its location in the PspCidTable.
CSRSS handle table : Each time we create a process the eprocess address is stored
within csrss.exe. With the exception of itself and the processes that started before it.
Session processes : member of _EPROCESS associates all processes that belong to a particular
user’s logon session.
Processes that start before smss.exe (including System and smss.exe) are not in
the session process or desktop thread lists.
Processes that have terminated will not be found. Except with process scanning and
thrdproc scanning.
Hollowprocess - Detects different types of Process Hollowing
https://raw.githubusercontent.com/monnappa22/HollowFind/master/hollowfind.py
VERINFO
Prints out the version information from PE images
Syntaxe : vol.py -f ./dumps\memory.dmp --profile=Win2012R2x64_18340
verinfo
Options : --regex
vol.py -f F:\memory.dmp --profile=Win2012R2x64_18340 verinfo --regex=StickyNot.exe
Psinfo - Displays process related information
Extra plugin :
https://raw.githubusercontent.com/monnappa22/Psinfo/master/psinfo.py
https://cysinfo.com/detecting-malicious-processes-psinfo-volatility-plugin/
Procdump -
Memdump
Memdump – Procdump - Dlldump
Volshell
SIDS -
Privileges
SIDS - Privileges
Getsids – Display Sids associated to processes
Options :
Important privileges
Options :
- File
- Mutex
- Registry key
- Token, etc…
Handles - Print list of open handles for each process
https://github.com/Yara-Rules/rules
https://github.com/godaddy/yara-rules
https://github.com/Neo23x0/signature-base/tree/master/yara
https://malwareconfig.com/yara/
symlinkscan - Pool scanner for symlink objects
Run only on RAW image not a crashdump – Use imagecopy plugin before
Find emails :
"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"
Strings -
Bitcoins : ^[13][a-km-zA-HJ-NP-Z0-9]{26,33}$
Cartes de crédit :
Visa: ^4[0-9]{12}(?:[0-9]{3})?$
MasterCard: ^5[1-5][0-9]{14}$
American Express: ^3[47][0-9]{13}$
Diners club : ^3(?:0[0-5]|[68][0-9])[0-9]{11}$
Discover: ^6(?:011|5[0-9]{2})[0-9]{12}$
JCB: ^(?:2131|1800|35\d{3})\d{11}$
IP address :
\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-
9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
Extract $USN
https://github.com/tomspencer/volatility/raw/master/usnparser/usnparser.py
The NTFS change journal ($UsnJrnl) is an operating system file that
records changes made to files and directories.
Docs-USN
Maintain the size, view, icon, and position of a folder when using Explorer
They can be used to enumerate past mounted volumes, deleted files, and user
actions
- Mftparser
- Shellbags
Basic syntax :
- Are mentioned here the documents that the system has recognized
unreliable, but that the human has trusted
hashdump – Dumps passwords hashes (LM/NTLM)
from memory
vol.py -f F:\dump.dmp --profile=Win7SP1x86 hashdump
https://crackstation.net/
http://finder.insidepro.com/
Téléchargement :
https://raw.githubusercontent.com/dfirfpi/hotoloti/master/volatility/mimik
atz.py
Téléchargement : https://github.com/gentilkiwi/mimikatz/releases/latest
Usbstor –
Shows all network connections, including the process name, source and
destination IP addresses – including ports.
Protocol
Communication state
Process name
PID of process
Extra plugin :
https://raw.githubusercontent.com/K2/Scripting/master/inVteroJitHash.py
Dependences :
https://github.com/4144414D/pytruecrypt
Bitlocker
https://github.com/tribalchicken/volatility-bitlocker
Updated
https://raw.githubusercontent.com/elceef/bitlocker/master/bitlocker
.py
Bitlocker
Address : 0xfa80018be720
Cipher : AES-128
FVEK : eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
TWEAK : bbbbbbbbbbbbbbbbbbbbbbbbbbbb
Bitlocker
# bdemount -k
eeeeeeeeeeeeeeeeeeeeeeeee:bbbbbbbbbbbbbbbbbbbbbb -o
$((128*512)) image.dd /mnt/bde/
https://raw.githubusercontent.com/binglot/misc/master/schtasks.py
WEB HISTORY
iehistory – Reconstruct Internet Explorer cache / history
python vol.py -f win7_x64.dmp --profile=Win7SP0x64 iehistory
Chrome
Firefox
Prefetch
IdxParser
Trustrecords
chromehistory – Scans for and parses potential Chrome
url history
python vol.py -f win7_x64.dmp --profile=Win7SP0x64 chromehistory
chromedownloads - Scans for and parses potential
Chrome download records
python vol.py -f win7_x64.dmp --profile=Win7SP0x64 chromedownloads
Chromedownloadchains - Scans for and parses potential
Chrome download chain records
https://github.com/cube0x8/chrome_ragamuffin
firefoxhistory - Scans for and parses potential Firefox url
history (places.sqlite moz_places table)
Extra plugin :
https://raw.githubusercontent.com/kevthehermit/volatility_plugins/master
/lastpass/lastpass.py
Téléchargement :
https://github.com/tomchop/volatility-autoruns
Download :
https://raw.githubusercontent.com/volatilityfoundation/community/master
/JamaalSpeights/msdecompress.py
http://downloads.volatilityfoundation.org/contest/2014/JamaalSpeights_MsDeco
mpress.zip
Used to find compressed data with lznt1 algorithm. Show the process who
use this algorithm.
EXTRA PLUGIN :
https://raw.githubusercontent.com/Phaeilo/vol-openvpn/master/openvpn.py
https://github.com/volatilityfoundation/community
Volutility
Install MONGODB
sudo apt-key adv --keyserver
hkp://keyserver.ubuntu.com:80 --recv EA312927
Ubuntu 16.04
Volutility
memcompress
https://github.com/fireeye/win10_volatility
Récupérer les 4 fichiers ci-dessous dans le projet fireeye et collez les dans volatility
• volatility/plugins/addrspaces/win10_memcompression.py
• volatility/plugins/overlays/windows/win10_memcompression.py
• volatility/plugins/win10deflate.py
• volatility/plugins/win10smglobals.py
Questions?
Please ask!