If you want something as fast as possible: https://github.com/carlospolop/autoVolatility
python autoVolatility.py -f MEMFILE -d OUT_DIRECTORY -e /home/user/tools/volatility/vol.py # Will use most important plugins (could use a lot of space depending on the size of the memory)
Volatility has two main approaches to plugins, which are sometimes reflected in their names. “list” plugins will try to navigate through Windows Kernel structures to retrieve information like processes (locate and walk the linked list of
_EPROCESS structures in memory), OS handles (locating and listing the handle table, dereferencing any pointers found, etc). They more or less behave like the Windows API would if requested to, for example, list processes.
That makes “list” plugins pretty fast, but just as vulnerable as the Windows API to manipulation by malware. For instance, if malware uses DKOM to unlink a process from the
_EPROCESS linked list, it won’t show up in the Task Manager and neither will it in the pslist.
“scan” plugins, on the other hand, will take an approach similar to carving the memory for things that might make sense when dereferenced as specific structures.
psscan for instance will read the memory and try to make out
_EPROCESS objects out of it (it uses pool-tag scanning, which is basically searching for 4-byte strings that indicate the presence of a structure of interest). The advantage is that it can dig up processes that have exited, and even if malware tampers with the
_EPROCESS linked list, the plugin will still find the structure lying around in memory (since it still needs to exist for the process to run). The downfall is that “scan” plugins are a bit slower than “list” plugins, and can sometimes yield false-positives (a process that exited too long ago and had parts of its structure overwritten by other operations).
volatility imageinfo -f file.dmpvolatility kdbgscan -f file.dmp
As opposed to imageinfo which simply provides profile suggestions, kdbgscan is designed to positively identify the correct profile and the correct KDBG address (if there happen to be multiple). This plugin scans for the KDBGHeader signatures linked to Volatility profiles and applies sanity checks to reduce false positives. The verbosity of the output and number of sanity checks that can be performed depends on whether Volatility can find a DTB, so if you already know the correct profile (or if you have a profile suggestion from imageinfo), then make sure you use it (from here).
Always take a look in the number of procceses that kdbgscan has found. Sometimes imageinfo and kdbgscan can find more than one suitable profile but only the valid one will have some process related (This is because in order to extract processes the correct KDBG address is needed)
# GOODPsActiveProcessHead : 0xfffff800011977f0 (37 processes)PsLoadedModuleList : 0xfffff8000119aae0 (116 modules)
# BADPsActiveProcessHead : 0xfffff800011947f0 (0 processes)PsLoadedModuleList : 0xfffff80001197ac0 (0 modules)
The kernel debugger block (named KdDebuggerDataBlock of the type _KDDEBUGGER_DATA64, or KDBG by volatility) is important for many things that Volatility and debuggers do. For example, it has a reference to the PsActiveProcessHead which is the list head of all processes required for process listing.
Extract password hashes from memory
volatility --profile=Win7SP1x86_23418 hashdump -f ch2.dmp #Local hashesvolatility --profile=Win7SP1x86_23418 cachedump -f ch2.dmpvolatility --profile=Win7SP1x86_23418 lsadump -f ch2.dmp # LSA secrets
The memory dump of a process will extract everything of the current status of the process. The procdump module will only extract the code.
volatility -f ch2.dmp --profile=Win7SP1x86 memdump -p 2168 -D conhost/
Try to find suspicious processes (by name) or unexpected child processes (for example a cmd.exe as a child of iexplorer.exe).
volatility --profile=PROFILE pstree -f DUMP # Get process tree (not hidden)volatility --profile=PROFILE pslist -f DUMP # Get process list (EPROCESS)volatility --profile=PROFILE psscan -f DUMP # Get hidden process list(malware)volatility --profile=PROFILE psxview -f DUMP # Get hidden process list
volatility --profile=Win7SP1x86_23418 procdump --pid=3152 -n --dump-dir=. -f ch2.dmp
Something suspicious was executed?
volatility --profile=PROFILE cmdline -f DUMP #Display process command-line argumentsvolatility --profile=PROFILE consoles -f DUMP #command history by scanning for _CONSOLE_INFORMATION
Commands entered into cmd.exe are processed by conhost.exe (csrss.exe prior to Windows 7). So even if an attacker managed to kill the cmd.exe prior to us obtaining a memory dump, there is still a good chance of recovering history of the command line session from conhost.exe’s memory. If you find something weird(using the consoles modules), try to dump the memory of the conhost.exe associated process and search for strings inside it to extract the command lines.
volatility --profile=PROFILE envars -f DUMP #Display process environment variables
Unexpected and exploitable privileges in a process?
#Get enabled privileges of some processesvolatility --profile=Win7SP1x86_23418 privs --pid=3152 -f file.dmp | grep Enabled#Get all processes with interesting privilegesvolatility --profile=Win7SP1x86_23418 privs -f file.dmp | grep Enabled | grep "SeImpersonatePrivilege\|SeAssignPrimaryPrivilege\|SeTcbPrivilege\|SeBackupPrivilege\|SeRestorePrivilege\|SeCreateTokenPrivilege\|SeLoadDriverPrivilege\|SeTakeOwnershipPrivilege\|SeDebugPrivilege"
Processes running with admin privileges?
#Get the SID of a processvolatility --profile=Win7SP1x86_23418 privs --pid=3152 -f file.dmp | grep Enabled#Get processes with admin privilegesvolatility --profile=Win7SP1x86_23418 getsids -f ch2.dmp | grep -i admin
Useful to know to which other files, keys, threads, processes... a process has a handle for (has opened)
volatility --profile=Win7SP1x86_23418 handles --pid=3152 -f ch2.dmp
volatility --profile=Win7SP1x86_23418 dlllist --pid=3152 -f ch2.dmp #Get dlls of a procvolatility --profile=Win7SP1x86_23418 dlldump --pid=3152 --dump-dir=. -f ch2.dmp #Dump dlls of a proc
#Get services and binary pathvolatility --profile=Win7SP1x86_23418 svcscan-f ch2.dmp#Get name of the services and SID (slow)volatility --profile=Win7SP1x86_23418 getservicesids -f ch2.dmp
volatility --profile=Win7SP1x86_23418 netscan -f ch2.dmpvolatility --profile=Win7SP1x86_23418 connections -f ch2.dmp #XP and 2003 onlyvolatility --profile=Win7SP1x86_23418 connscan -f ch2.dmp #TCP connectionsvolatility --profile=Win7SP1x86_23418 sockscan -f ch2.dmp #Open socketsvolatility --profile=Win7SP1x86_23418 sockets -f ch2.dmp #Scanner for tcp socket objects
volatility --profile=Win7SP1x86_23418 hivelist -f ch2.dmp
volatility --profile=Win7SP1x86_23418 printkey -K "Software\Microsoft\Windows NT\CurrentVersion" -f ch2.dmp# Get Run binaries registry valuevolatility -f ch2.dmp --profile=Win7SP1x86 printkey -o 0x9670e9d0 -K 'Software\Microsoft\Windows\CurrentVersion\Run'
#Dump a hivevolatility --profile=Win7SP1x86_23418 hivedump -o 0x9aad6148 -f ch2.dmp #Offset extracted by hivelist#Dump all hivesvolatility --profile=Win7SP1x86_23418 hivedump -f ch2.dmp
volatility --profile=Win7SP1x86_23418 filescan -f ch2.dmp #Scan for files inside the dumpvolatility --profile=Win7SP1x86_23418 dumpfiles -n --dump-files=. -f ch2.dmp #Dump the files
Interesting options for this modules are: --pid, --name, --ssl
volatility --profile=Win7SP1x86_23418 dumpcerts --dump-dir=. -f ch2.dmp
volatility --profile=Win7SP1x86_23418 malfind -f ch2.dmpvolatility --profile=Win7SP1x86_23418 apihooks -f ch2.dmpvolatility --profile=Win7SP1x86_23418 driverirp -f ch2.dmp
Use this script to download and merge all the yara malware rules from github: https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9 Create the rules directory and execute it. This will create a file called malware_rules.yar which contains all the yara rules for malware.
wget https://gist.githubusercontent.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9/raw/4ec711d37f1b428b63bed1f786b26a0654aa2f31/malware_yara_rules.pymkdir rulespython malware_yara_rules.pyvolatility --profile=Win7SP1x86_23418 yarascan -y malware_rules.yar -f ch2.dmp | grep "Rule:" | grep -v "Str_Win32" | sort | uniq
When you use an external plugin the first parameter that you have to set is
Download it from https://github.com/tomchop/volatility-autoruns
volatility --plugins=volatility-autoruns/ --profile=WinXPSP2x86 -f dump.img autoruns
volatility --profile=Win7SP1x86_23418 clipboard -f ch2.dmp
volatility --profile=Win7SP1x86_23418 iehistory -f ch2.dmp
volatility --profile=Win7SP1x86_23418 notepad -f ch2.dmp
volatility --profile=Win7SP1x86_23418 screenshot -f ch2.dmp
volatility --profile=Win7SP1x86_23418 mutantscan -f ch2.dmp
volatility --profile=Win7SP1x86_23418 mbrparser -f ch2.dmp
The MBR holds the information on how the logical partitions, containing file systems, are organized on that medium. The MBR also contains executable code to function as a loader for the installed operating system—usually by passing control over to the loader's second stage, or in conjunction with each partition's volume boot record (VBR). This MBR code is usually referred to as a boot loader. From here.
volatility --profile=Win7SP1x86_23418 mftparser -f ch2.dmp
The NTFS file system contains a file called the master file table, or MFT. There is at least one entry in the MFT for every file on an NTFS file system volume, including the MFT itself. All information about a file, including its size, time and date stamps, permissions, and data content, is stored either in MFT entries, or in space outside the MFT that is described by MFT entries. From here.