Giter VIP home page Giter VIP logo

malconfscan's Introduction

Arsenal

Concept

MalConfScan is a Volatility plugin extracts configuration data of known malware. Volatility is an open-source memory forensics framework for incident response and malware analysis. This tool searches for malware in memory images and dumps configuration data. In addition, this tool has a function to list strings to which malicious code refers.

MalConfScan sample

Supported Malware Families

MalConfScan can dump the following malware configuration data, decoded strings or DGA domains:

  • Ursnif
  • Emotet
  • Smoke Loader
  • PoisonIvy
  • CobaltStrike
  • NetWire
  • PlugX
  • RedLeaves / Himawari / Lavender / Armadill / zark20rk
  • TSCookie
  • TSC_Loader
  • xxmm
  • Datper
  • Ramnit
  • HawkEye
  • Lokibot
  • Bebloh (Shiotob/URLZone)
  • AZORult
  • NanoCore RAT
  • AgentTesla
  • FormBook
  • NodeRAT (https://blogs.jpcert.or.jp/ja/2019/02/tick-activity.html)
  • njRAT
  • TrickBot
  • Remcos
  • QuasarRAT
  • AsyncRAT
  • WellMess (Windows/Linux)
  • ELF_PLEAD
  • Pony

Additional Analysis

MalConfScan has a function to list strings to which malicious code refers. Configuration data is usually encoded by malware. Malware writes decoded configuration data to memory, it may be in memory. This feature may list decoded configuration data.

How to Install

If you want to know more details, please check the MalConfScan wiki.

How to Use

MalConfScan has two functions malconfscan, linux_malconfscan and malstrscan.

Export known malware configuration

$ python vol.py malconfscan -f images.mem --profile=Win7SP1x64

Export known malware configuration for Linux

$ python vol.py linux_malconfscan -f images.mem --profile=LinuxDebianx64

List the referenced strings

$ python vol.py malstrscan -f images.mem --profile=Win7SP1x64

Overview & Demonstration

Following YouTube video shows the overview of MalConfScan.

MalConfScan_Overview

And, following YouTube video is the demonstration of MalConfScan.

MalConfScan_Demonstration

MalConfScan with Cuckoo

Malware configuration data can be dumped automatically by adding MalConfScan to Cuckoo Sandbox. If you need more details on Cuckoo and MalConfScan integration, please check MalConfScan with Cuckoo.

malconfscan's People

Contributors

k0t4-k avatar shu-tom avatar t-tani avatar

Stargazers

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

Watchers

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

malconfscan's Issues

malconfscan & malstrscan runtime errors

both plugins resulted an error when running.
I am using an ubuntu 16.04 virtual machine, 4 gb RAM, 1 cpu.

malconfscan:

omri@ubuntu:/opt/calamity/MalConfScan$ vol.py -f ~/Desktop/otterctf.vmem --profile=Win7SP1x64 malconfscan
Volatility Foundation Volatility Framework 2.6.1
[+] Searching memory by Yara rules.
Traceback (most recent call last):
File "/usr/local/bin/vol.py", line 4, in
import('pkg_resources').run_script('volatility==2.6.1', 'vol.py')
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 719, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1504, in run_script
exec(code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/EGG-INFO/scripts/vol.py", line 192, in
main()
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/EGG-INFO/scripts/vol.py", line 183, in main
command.execute()
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/commands.py", line 147, in execute
func(outfd, data)
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/plugins/malware/malconfscan.py", line 94, in render_text
for task, start, end, malname, memory_model, config_data in data:
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/plugins/malware/malconfscan.py", line 84, in calculate
for task, vad_base_addr, end, hit, memory_model, config_data in instance.calculate():
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/plugins/malware/utils/datperscan.py", line 236, in calculate
dec = self.custom_rc4(enc, key, rc4key_seed)
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/plugins/malware/utils/datperscan.py", line 97, in custom_rc4
for char in data:
TypeError: 'NoneType' object is not iterable


malstrscan:

omri@ubuntu:/opt/calamity/MalConfScan$ vol.py -f ~/Desktop/otterctf.vmem --profile=Win7SP1x64 malstrscan
Volatility Foundation Volatility Framework 2.6.1
[+] Searching for malicious memory space.
Traceback (most recent call last):
File "/usr/local/bin/vol.py", line 4, in
import('pkg_resources').run_script('volatility==2.6.1', 'vol.py')
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 719, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1504, in run_script
exec(code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/EGG-INFO/scripts/vol.py", line 192, in
main()
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/EGG-INFO/scripts/vol.py", line 183, in main
command.execute()
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/commands.py", line 147, in execute
func(outfd, data)
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/plugins/malware/malconfscan.py", line 271, in render_text
for task, start, end, data, protection, strings in data:
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/plugins/malware/malconfscan.py", line 206, in calculate
for start, end, memdata, protection in self.detect_injection_proc(proc, space):
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/plugins/malware/malconfscan.py", line 140, in detect_injection_proc
data = address_space.zread(vad.Start, vad.End + 1)
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/addrspace.py", line 283, in zread
return self._read(addr, length, True)
File "/usr/local/lib/python2.7/dist-packages/volatility-2.6.1-py2.7.egg/volatility/addrspace.py", line 269, in _read
return "".join(buff)
MemoryError

any solutions come in mind? thanks !

Ubuntu 20.04 LTS compatibility w/ malconfscan

I'm unable to get malconfscan to work with Ubuntu 20.04. Ubuntu 20.04 seems to require a different package for volatility (volatility-phocean) and install command (sudo snap install volatility-phocean). Has anyone else encountered this issue?

volatility getting killed when running malconfscan

installed and used exactly as shown.
vol.py -f <path>.vmem --profile=Win7SP1x64 malconfscan
5 seconds later getting the output:

[+] Searching memory by Yara rules.
Killed

and then it stops. same with malstrscan.
any solutions?

Syntax Error

Dear all,

I am currently using Volatility 2.6.1 on Window10x64 and I am having an issues regarding to syntax error as shown below when I am doing malware analysis on a particular memory image:
Capture

I tried to go to see the yara rules file syntax 227 and this is what it shown:
image

and I delete the whole plugX coding and re-run command and this is what i get:
image

this is my python version:
image

Thank you if anyone is willing to give me some ideas :) appreciate it! have a nice day!

Hanging on "Searching memory by Yara rules."

Hi authors,
From what I can see, this is extremely useful plugin.

Unfortunately, I cannot get the plugin working.
Similar issue was already reported: #10

The process is showing "Searching memory by Yara rules.". It takes one cpu with no read or write activity.

I did try to use git versions of the volatility and the MalConfScan plugin.
The -p option did not help.
Just to make sure, I also tried a docker version of the volatility and it stuck.

The plugin was running for several days without result.

I see few findings from your yara rules.

MemoryError on windows10 with Win10x64_18362 profile

I'm getting memory error during Windows 10 x64 2GB memory dumped from Esxi 6.7 using Win10x64_18362 profile:

Volatility Foundation Volatility Framework 2.6.1
Traceback (most recent call last):
  File "/opt/calamity/volatility/vol.py", line 192, in <module>
    main()
  File "/opt/calamity/volatility/vol.py", line 183, in main
    command.execute()
  File "/opt/calamity/volatility/volatility/commands.py", line 147, in execute
    func(outfd, data)
  File "/opt/calamity/volatility/volatility/plugins/malware/malconfscan.py", line 94, in render_text
    for task, start, end, malname, memory_model, config_data in data:
  File "/opt/calamity/volatility/volatility/plugins/malware/malconfscan.py", line 84, in calculate
    for task, vad_base_addr, end, hit, memory_model, config_data in instance.calculate():
  File "/opt/calamity/volatility/volatility/plugins/malware/utils/datperscan.py", line 216, in calculate
    [+] Searching memory by Yara rules.
data = proc_addr_space.zread(vad_base_addr, end - vad_base_addr)
  File "/opt/calamity/volatility/volatility/addrspace.py", line 283, in zread
    return self._read(addr, length, True)
  File "/opt/calamity/volatility/volatility/addrspace.py", line 269, in _read
    return "".join(buff)
MemoryError

Problem with ursnifscan

I tried MalConfScan-with-Cuckoo with the sample page ursnif.
SHA256: 0207c06879fb4a2ddaffecc3a6713f2605cbdd90fc238da9845e88ff6aef3f85
But, I am troubled with an error.

File "/home/name/venv/local/lib/python2.7/site-packages/volatility-2.6.1-py2.7.egg/volatility/plugins/malware/utils/ursnifscan.py", line 245, in calculate
parse_joinned_data(fname, magic)
NameError: global name 'parse_joinned_data' is not defined

Wrong path for plugins folder in latest release of Volatility (v2.6)

Where to Fix

Following parts in wiki of this repository is wrong.

image

image

How to Fix

Before: $ cp -R malconfscan.py utils yara [Extract Volatility Folder]/volatility/plugin/malware
After: $ cp -R malconfscan.py utils yara [Extract Volatility Folder]/volatility/plugins/malware

Evidence

image

malconfscan blocked during scan

Hi,

I'm trying to analize a memory dump from vmware Windows 10 paused machine infected with some malwares.
Currently I've got vmem file and vmsn file.
Vmem file is large 4GB.
Running following command the debug messages stops and there is no progress after 2 hours of time:
python vol.py -f Win10Untrusted-Snapshot5.vmem --profile=Win10x64 malconfscan -d -v

Last debug messages are following:

DEBUG   : volatility.debug    : Applying modification from ShellBagsTypesWin7
DEBUG   : volatility.debug    : Applying modification from UserAssistWin7VTypes
DEBUG   : volatility.debug    : Applying modification from VistaObjectClasses
DEBUG   : volatility.debug    : Applying modification from Win32KCoreClasses
DEBUG   : volatility.debug    : Applying modification from Win7ObjectClasses
DEBUG   : volatility.debug    : Applying modification from Win8x64VolatilityKDBG
DEBUG   : volatility.debug    : Applying modification from WinPEx64VTypes
DEBUG   : volatility.debug    : Applying modification from Windows64Overlay
DEBUG   : volatility.debug    : Applying modification from ServiceBasex64
DEBUG   : volatility.debug    : Applying modification from ServiceVista
DEBUG   : volatility.debug    : Applying modification from Win8ObjectClasses
DEBUG   : volatility.debug    : Applying modification from Win8x64DTB
DEBUG   : volatility.debug    : Applying modification from Win8x64Gui
DEBUG   : volatility.debug    : Applying modification from Win8x64MaxCommit
DEBUG   : volatility.debug    : Applying modification from Service8x64

event attaching to a single PID I got same behaviour.

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.