Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Obfuscated payload extractor for malware samples
|build_status| |pypi_version|
malcarve
is a tool for detecting and extracting obfuscated, embedded content
from files. In particular it is targeted at extracting malicious payloads such
as those contained in malware attack documents and droppers.
A command-line utility is included alongside a simple Python API. Further, a web API is provided as an example scanning web service.
Install using pip
: ::
pip install malcarve
Command-line usage: ::
malcarve [--extract [--output-dir <output_dir>]] <file1> <file2> ...
Example Webservice: ::
malcarve-web [-H <interface_address>] [-p port_number]
Config can be updated by copying malcarve/conf/malcarve.conf to ~/.malcarve/malcarve.conf and changing settings as desired.
To run from source code, you will need to manually build the C components too. Here is an example (assuming virtualenv) with dependencies for Ubuntu 18.04: ::
sudo apt-get install build-essential gcc-multilib mingw-w64
git clone https://github.com/shendo/malcarve.git
cd malcarve/malcarve/ext
make
cd ../..
pip install -e .
Malcarve was originally written several years ago. It was predominantly targeted at extracting XOR'ed PE files from Flash, Word and PDF documents, which were commonly being exploited at the time.
After needing a similar capability again recently, I've started reviving the code (it's still a bit of a mess) along with migrating to python3. This also comes with a newer focus towards macro'ed documents and embedded urls/other file types and obfuscation techniques.
This is still a work in progress but has been released in the hope that others may find it useful (no warranty given or implied).
There are many great tools and published literature already in this space.
malcarve
borrows heavily, and is inspired from techniques
discussed or available in the following:
XORSearch
_Playing With Others Blog
_Deobfuscating Embedded Malware using Probable-Plaintext Attacks
_unXOR
_balbuzard
_The motivation in writing yet another deobfuscator was the need to not only detect obfuscated patterns and payloads but to also extract/carve that content automatically.
Some tools already handled this but would only perform a subset of the schemes or file types needed.
Future Work:
More than happy for feedback, discussion and pull requests...
Source code for malcarve
is hosted on GitHub
. Any bug reports or feature
requests can be made using GitHub's issues system
.
.. _GitHub: https://github.com/shendo/malcarve .. _issues system: https://github.com/shendo/malcarve/issues
.. |build_status| image:: https://secure.travis-ci.org/shendo/malcarve.png?branch=master :target: https://travis-ci.org/shendo/malcarve :alt: Current build status
.. |pypi_version| image:: https://img.shields.io/pypi/v/malcarve :target: https://pypi.python.org/pypi/malcarve :alt: Latest PyPI version
.. _Playing With Others Blog: https://playingwithothers.com/2012/12/20/decoding-xor-shellcode-without-a-key/ .. _XORSearch: https://blog.didierstevens.com/programs/xorsearch/ .. _Deobfuscating Embedded Malware using Probable-Plaintext Attacks: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.675.2542&rep=rep1&type=pdf .. _unXOR: https://github.com/tomchop/unxor .. _balbuzard: https://bitbucket.org/decalage/balbuzard
FAQs
Obfuscated payload extractor for malware samples
We found that malcarve demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.