Skip to main content

Automatic and platform-independent unpacker for Windows binaries based on emulation

Project description


| | | |       / / (_) \ \                  | |
| | | |_ __  | |   _   | | _ __   __ _  ___| | _____ _ __
| | | | '_ \/ /   | |   \ \ '_ \ / _` |/ __| |/ / _ \ '__|
| |_| | | | \ \   | |   / / |_) | (_| | (__|   <  __/ |
 \___/|_| |_|| |  |_|  | || .__/ \__,_|\___|_|\_\___|_|
              \_\     /_/ | |
                          |_|

Un{i}packer

Master Build Status
Dev Build Status

Unpacking PE files using Unicorn Engine

The usage of runtime packers by malware authors is very common, as it is a technique that helps to hinder analysis. Furthermore, packers are a challenge for antivirus products, as they make it impossible to identify malware by signatures or hashes alone.

In order to be able to analyze a packed malware sample, it is often required to unpack the binary. Usually this means, that the analyst will have to manually unpack the binary by using dynamic analysis techniques (Tools: OllyDbg, x64Dbg). There are also some approaches for automatic unpacking, but they are all only available for Windows. Therefore when targeting a packed Windows malware the analyst will require a Windows machine. The goal of our project is to enable platform independent automatic unpacking by using emulation.

Fully supported packers

  • ASPack: Advanced commercial packer with a high compression ratio
  • FSG: Freeware, fast to unpack
  • MEW: Specifically designed for small binaries
  • MPRESS: Free, more complex packer
  • PEtite: Freeware packer, similar to ASPack
  • UPX: Cross-platform, open source packer
  • YZPack

Other packers

Any other packers should work as well, as long as the needed API functions are implemented in Un{i}packer. For packers that aren't specifically known you will be asked whether you would like to manually specify the start and end addresses for emulation. If you would like to start at the entry point declared in the PE header and just emulate until section hopping is detected, press Enter

Usage

Normal installation

Install the YARA package for your OS

pip3 install -r requirements.txt
python3 unipacker.py

Attention! It is strongly advised to use the requirements.txt, as we use a custom version of unicorn-engine that differs from the PyPi package version. Additionally, one might accidentally install the "yara" pip package instead of "yara-python", which will lead to errors.

For detailed instructions on how to use Un{i}packer please refer to the Wiki. Additionally, all of the shell commands are documented. To access this information, use the help command

Using Docker

You can also use the provided Dockerfile to run a containerized version of Un{i}packer:

docker build -t unipacker . && \
docker run \
-v ~/local_samples:/root/unipacker/local_samples \
--name unipacker \
--rm \
unipacker 

Assuming you have a folder called local_samples in your home directory, this will be mounted inside the container. Un{i}packer will thus be able to access those binaries via /root/unipacker/local_samples

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unipacker-0.0.1.tar.gz (40.7 kB view details)

Uploaded Source

File details

Details for the file unipacker-0.0.1.tar.gz.

File metadata

  • Download URL: unipacker-0.0.1.tar.gz
  • Upload date:
  • Size: 40.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3

File hashes

Hashes for unipacker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bf732f964b61e924155ca63f6c9ebd8b26fbb5b8be215d35ceb3bfda2fb9500d
MD5 a6623db9f121a8f4bd5f82ff85500721
BLAKE2b-256 1056348ba331b505200faf1d0b981c801d5dc3c0ce8106de444cc649a3b8db0c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page