RATDecoders
Malconf is a python3 library that can be used to staticly analyse specific malware families and extract the Configuration data that can be used by Incident Responders during an incident.
As a library it can also be installed in to automated malware analysis pipelines.
Installation
Requirements
There are some pre-reqs that are included in the pip setup and the requirements.txt
- pefile
- pbkdf2
- javaobj-py3
- pycrypto
- androguard
For all the decoders you will need yara and yara-python. For dealing with .NET malware you will need to install yara-python with dotnet support
yara-python with dotnet support
git clone --recursive https://github.com/VirusTotal/yara-python
python3 setup.py build --enable-magic --enable-dotnet
sudo python3 setup.py install
Install from pip
pip3 install --upgrade malwareconfig
Install from repo
git clone git@github.com:kevthehermit/RATDecoders.git
cd RATDecoders
pip3 install -r requirements.txt
python3 setup.py install
Current Rats
Here is a list of the currently supported RATS:
- LostDoor
- Xtreme
- AAR
- AdWind
- Adzok
- AlienSpy
- Alina
- Arcom
- BlackNix
- BlackShades
- BlueBanana
- Bozok
- ClientMesh
- CyberGate
- DarkComet
- DarkRAT
- HawkEye
- Hrat / hworm / WSH
- Jbifrost
- JRat
- LuminosityLink
- LuxNet
- NanoCore
- NetWire
- njRat
- Plasma
- Remcos
- Saefko
- Sakula
- SpyNote / Mobihook
Upcoming RATS
- Still migrating old ones!
Usage
Using the supplied command line tool malconf you can pass in a single file or a directory with the -r flag and it will attempt to automagically detect the family and extract any config.
You can also use the -o option to write results out to a file.
malconf
malconf -l This will list all the supported rats
malconf /path/to/sample This will automagically detect the family and run the decoder
⇒ malconf tests/samples/alienspy
__ __ _ ____ __
| \/ | __ _| |/ ___|___ _ __ / _|
| |\/| |/ _` | | | / _ \| '_ \| |_
| | | | (_| | | |__| (_) | | | | _|
|_| |_|\__,_|_|\____\___/|_| |_|_|
Malware Configuration Parser by @kevthehermit
[+] Loading File: tests/samples/alienspy
[-] Found: AlienSpy
[-] Running Decoder
[-] Config Output
{'ConfigKey': 'fzGUoTaQH3SUW7E82IKQK2J2J2IISIS',
'NAME': 'ok',
'Version': 'B',
'connetion_time': '0',
'desktop': 'true',
'dns': '213.208.129.211',
'extensionname': 'qQJ',
'folder': 'java',
'instalar': 'true',
Library
If you pip install you can also use it is a library.
from malwareconfig import fileparser
from malwareconfig.modules import __decoders__, __preprocessors__
# Open and parse the file
sample_path = '/path/to/sample.exe'
file_info = fileparser.FileParser(file_path=sample_path)
# Check for a valid decoder and then parse
if file_info.malware_name in __decoders__:
module = __decoders__[file_info.malware_name]['obj']()
module.set_file(file_info)
module.get_config()
conf = module.config
pprint(conf)
Thanks
Full credit where credit is due.
Malware.lu for the initial xtreme Rat Writeup - https://code.google.com/p/malware-lu/wiki/en_xtreme_RAT
Fireye for their Poison Ivy and Xtreme rat WriteUps (Even though they ignored my tweets :-) ) - http://www.fireeye.com/blog/technical/2014/02/xtremerat-nuisance-or-threat.html
Shawn Denbow and Jesse Herts for their paper here - http://www.matasano.com/research/PEST-CONTROL.pdf Saved me a lot of time
Metadata
Release files for malwareconfig 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| malwareconfig-1.0.4.tar.gz | 41.1 kB | Without provenance | Details |
Release files / malwareconfig-1.0.4.tar.gz
| Download URL | malwareconfig-1.0.4.tar.gz |
|---|---|
| Size | 41.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18bc09084a9033da46efd1dd4407d68253ed5aa1b63a8c1418c162c78a538993
|
|
BLAKE2b-256 checksum How to use checksums |
cc165f24ca81eeaa2a8b41e89e8164929a224275c8f19d75b92ee4a993f001ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.11rc1+
|
Security for malwareconfig 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.