Skip to main content

A comprehensive binary emulation platform.

Project description

PyPI Build Status codecov Documentation Status PyPI - Python Version License: AGPL v3 Code style: black

Zelos

Zelos (Zeropoint Emulated Lightweight Operating System) is a python-based binary emulation platform. One use of zelos is to quickly assess the dynamic behavior of binaries via command-line or python scripts. All syscalls are emulated to isolate the target binary. Linux x86_64 (32- and 64-bit), ARM and MIPS binaries are supported. Unicorn provides CPU emulation.

Image

Full documentation is available here.

Installation

Use the package manager pip to install zelos.

pip install zelos

Basic Usage

Command-line

To emulate a binary with default options:

$ zelos my_binary

To view the instructions that are being executed, add the --inst flag:

$ zelos --inst my_binary

You can print only the first time each instruction is executed, rather than every execution, using --fasttrace:

$ zelos --inst --fasttrace my_binary

By default, syscalls are emitted on stdout. To write syscalls to a file instead, use the --trace_file flag:

$ zelos --trace_file path/to/file my_binary

Specify any command line arguments after the binary name:

$ zelos my_binary arg1 arg2

Programmatic

import zelos

z = zelos.Zelos("my_binary")
z.start(timeout=3)

Plugins

Zelos supports first- and third-party plugins. Some notable plugins thus far:

  • crashd crash analyzer combining execution trace, dataflow and memory sanitization.
  • overlay (ida plugin): highlights zelos execution trace in IDA with instruction-level comments added.
  • angr integration: enables symbolic execution in zelos.
  • zdbserver: remote control and debugging of emulated binaries.
  • syscall limiter: demonstrates event hooking and provides syscall-based execution and termination options.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Local Development Environment

First, create a new python virtual environment. This will ensure no package version conflicts arise:

$ python3 -m venv ~/.venv/zelos
$ source ~/.venv/zelos/bin/activate

Now clone the repository and change into the zelos directory:

(zelos) $ git clone git@github.com:zeropointdynamics/zelos.git
(zelos) $ cd zelos

Install an editable version of zelos into the virtual environment. This makes import zelos available, and any local changes to zelos will be effective immediately:

(zelos) $ pip install -e '.[dev]'

At this point, tests should pass and documentation should build:

(zelos) $ pytest
(zelos) $ cd docs
(zelos) $ make html

Built documentation is found in docs/_build/html/.

Install zelos pre-commit hooks to ensure code style compliance:

(zelos) $ pre-commit install

In addition to automatically running every commit, you can run them anytime with:

(zelos) $ pre-commit run --all-files

Windows Development:

Commands vary slightly on Windows:

C:\> python3 -m venv zelos_venv
C:\> zelos_venv\Scripts\activate.bat
(zelos) C:\> pip install -e .[dev]

License

AGPL v3

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Version 0.2.0] - 2020-08-04

Added

  • Plugins: Yarascan
  • Introduction of Zelos Manipulation Language (ZML), used for specifying events on the command line and in scripts. New zml_hook function in api
  • Ability to redirect input to stdin
  • Hooks for internal memory reads, writes, and maps
  • Linked to crashd plugin, containing separate plugins for heap memory guards, static analysis via IDA Pro, and dataflow using QEMU TCG

Changed

  • Moved to different command line flags for specifying what degree of information (instructions or syscalls) is printed while running
  • Better support for lists in command line arguments
  • Flags can be passed to the emulated program via the command line
  • Misc. bug fixes (thanks to seth1002)
  • General improvements to syscalls

Removed

  • Verbosity command line flag (now handled via other flags)

[Version 0.1.0] - 2020-05-29

Added

  • Plugins: IDA overlays, remote debug server
  • Additional plugin APIs

Changed

  • Minor syscall emulation improvements
  • Memory management overhaul

Removed

  • N/A

[Version 0.0.1] - 2020-03-03

Added

  • N/A

Changed

  • Updated documentation

Removed

  • N/A

[Version 0.0.0] - 2020-03-02

Initial public release.

Added

  • Initial open source commit.

Changed

  • N/A

Removed

  • N/A

The Core Zelos Team

Special Thanks To

  • Fabian Monrose - Co-Founder
  • Ann Cox - DHS Program Manager
  • Angelos Keromytis - DARPA Program Manager (Former)
  • Dustin Fraze - DARPA Program Manager
  • Suyup Kim - Intern

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

zelos-0.2.0.tar.gz (12.9 MB view details)

Uploaded Source

Built Distribution

zelos-0.2.0-py2.py3-none-any.whl (12.1 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file zelos-0.2.0.tar.gz.

File metadata

  • Download URL: zelos-0.2.0.tar.gz
  • Upload date:
  • Size: 12.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9

File hashes

Hashes for zelos-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c5b2eb40b403e92ea96cb5897139f35d37743e7af64508d2429a211d4800c968
MD5 a3d092c0f87787f0cc0fdb095a5cd651
BLAKE2b-256 f03382f7b7c3b4a3ba07388238b9d54ddc21457adef343035ac671f16d8bdf41

See more details on using hashes here.

File details

Details for the file zelos-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: zelos-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.1 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9

File hashes

Hashes for zelos-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6a5756791d30131e85af816bd42a941f35722893cd77a5982dc1eb7ba47a176d
MD5 330f8cdbbdfc68c38707cfadb62f0455
BLAKE2b-256 8da2ca57c7944ed15283441457a33a746e27adeaf7a1145dda9bd9a0fd2b9d8f

See more details on using hashes here.

Supported by

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