Code Monkey home page Code Monkey logo

volatility-plugins's Introduction

Volatility-Plugins - Learning area

I am in the process of learning how to create volatility plugins. This repo will be used as a storage platform for them.

The majority of ideas will come from The Art of Memory Forensics, which is possibly the best single source of knowledge on this topic.

RAMSCAN

The first volatility plugin is ramscan.py. This plugin lists running processes with PID and Parent PID, Command Line used to invoke the process and a check to see what the VAD settings are. If the VAD is set to Read, Write, Execute it is marked as suspicious.

How to use ramscan.py

  1. Download the plugin to a folder on your local machine.
  2. Invoke volatility calling the plugins folder before anything else. eg: python vol.py --plugins={path/to/plugins} --profile={profile for memory image} -f {path to image} ramscan
  3. A more useable method is to set an output format and output file as the data presented by this plugin can quickly fill a console window.

recommended use

python vol.py --plugins={path/to/plugins} --profile={profile for memory image} -f {path to image} ramscan --output=html --output-file=ramscan.html

Example output

Name           PID  Parent Command Line   VAD               
conhost.exe    6248    748 \??\C:\WINDOWS\system32\conhost.exe "9131723291973856416-156581232056986786412445124951738786652-244451647283318875 Suspicious RWX VAD
scPopup.exe    6284   4616 "C:\Program Files\Xerox\scPopup.exe" /s /k /t /g Suspicious RWX VAD
GROOVE.EXE     6384   4616 "C:\Program Files\Microsoft Office 15\root\office15\GROOVE.EXE" /RunFolderSync /TrayOnly  Suspicious RWX VAD
mobsync.exe    6672    936 C:\WINDOWS\System32\mobsync.exe -Embedding Suspicious RWX VAD
ucmapi.exe     5748    936 "C:\Program Files\Microsoft Office 15\Root\Office15\UcMapi.exe" -Embedding Suspicious RWX VAD
powershell.exe 5772   6188 powershell -nop -exec bypass -EncodedCommand SQBFAFgAIAAoACgAbgBlAHcALQBvAGIA...ACcAaAB0AHQAcAA6AC8ALwAxADIANwAuADAALgAwAC4AMQA6ADUAMgA4ADAAOAAvACcAKQApAA== Suspicious RWX VAD

IR Notes

  • Look for command execution from unusual locations
  • Look for suspicious command execution: Eg encoded Powershell
  • Look for memory sections which allow read-write-execute

CMDCHECK

This volatility plugin scans memory for cmd.exe execution and checks the standard handles.

If cmd.exe is being used for data exfiltration (or other unwanted activity) it is likely that the handles will change. This is a good way to check for backdoors / modification (Pages 230 - 232 of The Art of Memory Forensics).

Use

  1. Download the plugin to a local filesystem
  2. Run the plugin against a memory image: python vol.py --plugins={path/to/plugin} --profile={image profile} -f {memory.img} cmdcheck
  3. Any deviation from the norm will be annotated with !*!
  4. Note: This does not work if the process has exited memory

IR Notes

  • Modified handles in cmd.exe is an indicator of malice.

Fast VAD Scan

This is a volatility plugin, similar to malfind, which looks at the number of pages committed and the VAD settings. It does not extract files so may run faster.

When executed this plugin will return the process name and PID for any process which has more than 30 pages committed and RWX set.

How to use Fast VAD Scan

  1. Download the plugin to a local filesystem location
  2. Run volatility calling the plugin: python vol.py --plugins={path/to/plugins} --profile={image profile} -f {filename} fastvadscan
  3. Review output and determine if any files warrant further investigation

IR Notes

  • This is a triage tool and works best if you have suspicious files
  • It can narrow down files for further analysis
  • If file extraction is required, run malfind

Path Check

This plugin scans the capture and identifies an executables which appear to have been loaded from a temp, download or user location. The choice of locations is arbritrary and can be adjusted to suit the investigation. The location matching is case insensitive so will match temp, Temp and TEMP in a path.

How to use Path Check

  1. Download the plugin to a local files store
  2. Invoke volatility (with the plugins folder before anything else) calling pathcheck. For example: python vol.py --plugins={path/to/plugins} --profile={profile for memory image} -f {path to image} pathcheck
  3. Review the output - processes executed from temp / download or user locations are more likely to be malware and should be subject to further investigation.

IR Use

This tool is best used as part of the triage process to get a quick feel for what suspicious activity is on the system.

Alternatively, it can be used as part of a threat hunting review via a remote access agent (such as F-Response)

Triagecheck

This volatility plugin is designed to quickly parse the process list and identify some obvious signs of malicious activity. It is not designed to act as an indepth assessment tool and works best for investigators looking to triage multiple platforms quickly.

The plugin highlights the following events:

  • SMSS - there should only be one instance and it runs from system 32
  • CSRSS - should be running from system32
  • SERVICES - this should be running from system32
  • SVCHOST - check for impersonation (e.g. scvhost / svch0st etc)
  • LSASS - there should only be one instance and it should be running from system32
  • DLLHOST - check for impersonataion (e.g. dl1host.exe)
  • SHORT FILE NAMES - look for 1 or 2 character file names (e.g. a.exe)
  • UNUSUAL EXTENSIONS - look for non exe files running in memory (e.g. c99shell.php)

How to use triagecheck

  1. Download the file to a local plugin store.
  2. Invoke volatility calling the plugin. Eg python vol.py --plugins={path/to/plugins} --profile={profile for memory image} -f {path to image} triagecheck
  3. Where the plugin generates a warning message, prioritise this for further investigation

IR Notes

This tool is a high level triage for some obvious attacks. It is ideally used if you are trying to triage multiple systems or believe there is a risk that malware may be impersonating legitimate critical processes.

volatility-plugins's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

volatility-plugins's Issues

Struct _MMVAD has no member u

Hi,
trying to execute ramscan.py plugin with volatility 2.6.1 i receive this error

Traceback (most recent call last):
File "D:\Volatility\v2\vol.py", line 192, in
main()
File "D:\Volatility\v2\vol.py", line 183, in main
command.execute()
File "D:\Volatility\v2\volatility\commands.py", line 147, in execute
func(outfd, data)
File "D:\Volatility\v2\volatility\commands.py", line 282, in render_text
config = self.config), data)
File "D:\Volatility\v2\volatility\commands.py", line 276, in render
renderer.render(outfd, output)
File "D:\Volatility\v2\volatility\renderers\text.py", line 115, in render
grid_depth = grid.visit(None, lambda x, y: max(y, grid.path_depth(x)), 0)
File "D:\Volatility\v2\volatility\renderers_init
.py", line 248, in visit
self.populate()
File "D:\Volatility\v2\volatility\renderers_init
.py", line 149, in populate
for (level, item) in self._generator:
File "D:\Volatility\v2\volatility\plugins\ramscan.py", line 28, in generator
if vad.u.VadFlags.CommitCharge.v() > 30:
File "D:\Volatility\v2\volatility\obj.py", line 751, in getattr
return self.m(attr)
File "D:\Volatility\v2\volatility\obj.py", line 733, in m
raise AttributeError("Struct {0} has no member {1}".format(self.obj_name, attr))
AttributeError: Struct _MMVAD has no member u

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.