Giter Club home page Giter Club logo

b1gr3db / panda Goto Github PK

View Code? Open in Web Editor NEW

This project forked from firmwire/panda

0.0 0.0 0.0 140.57 MB

Platform for Architecture-Neutral Dynamic Analysis

Home Page: https://panda.re

License: Other

Shell 1.15% C++ 4.59% Python 5.97% Perl 0.31% C 86.59% Emacs Lisp 0.01% Objective-C 0.11% Haxe 0.48% Assembly 0.47% Makefile 0.29% HTML 0.02% Smarty 0.01% NSIS 0.01% GLSL 0.01% Batchfile 0.01% GDB 0.01% Dockerfile 0.01% Vim Script 0.01% SmPL 0.01%

panda's Introduction

FirmWire PANDA

This repo holds the FirmWire distribution of the Platform for Architecture-Neutral Dynamic Analysis (PANDA). The upstream version of PANDA is developed by MIT Lincoln Laboratory, NYU, and Northeastern University under the GPLv2 license over at https://github.com/panda-re/panda.

FirmWire PANDA is based on the stable version of PANDA (git tag qemu2.9.1-panda3.0.0). Within FirmWire we use PANDA as base emulation platform by using its pypanda and configurable machine interfaces.

Why ship your own distribution?

For firmwire, we required a significant amount of changes to the framework. As some of them are modifications to the core emulation engine which break existing Panda functionality, we don't think we can upstream all of them.

For a summary of our changes, check further below in this README file.

Installation

The easiest way of building FirmWire PANDA is by using the Dockerfile shipped with FirmWire [link].

However, if you want to build it on your own, we won't stop you! The following instructions are tested under Ubuntu 20.04:

[email protected]:FirmWire/panda.git
cd panda/
mkdir build
CFLAGS=-Wno-error ../build.sh --python arm-softmmu,mipsel-softmmu

For a more minimalistic installation, please refer to the Dockerfile.

Summary of changes

Below we list a non-exhaustive list of changes to the PANDA framework for FirmWire. For a complete list of changes please check the git history; this summary is solely meant as convience to provide a high-level overview of our modifications.

Shannon-specific changes

To enable the emulation of Shannon firmware, we added a dedicated timer peripheral. Its implementation is solely based on our insights won during reverse engineering and you can find the implementation [here].

MTK-specific changes

In order to emulate MediaTek based firmware images, we needed to add support for the MIPS16e2 instruction set extension. The commits introducing this support are partially cherry-picked from upstream qemu, and partially developed on our own. You will find most of the changes under target/mips/translate.c.

Another small change regarding MIPS emulation is that we had to replace first_cpu with current_cpu at various places. PANDA uses by default first_cpu to get a global handle to the current emulation state. Unfortunately, especially during fuzzing, this broke some things and we ended up with this rather ad-hoc fix. While this allows for proper emulation and fuzzing for MediaTek-based firmware images, it also inherently breaks some of PANDA's features.

AFL++ Integration (TriForce AFL inspired)

One of our core-additions to PANDA is the integration with a fuzzer. Specifically, we use the same hypercall-based approach as presented by Triforce-AFL, but significantly extend upon it.

First of all, we integrated the improved coverage collection techniques provided by AFL++ and implemented persistent mode fuzzing, which both leads to a significantly improved fuzzing throughput. Then, for ARM-emulation (i.e., Shannon-based firmware), we also implemented compcov/laf-intel-style instrumentation for compare operations.

The major part of our additions can be found in the include/afl-directory.

panda's People

Contributors

pm215 avatar bonzini avatar aliguori avatar blueswirl avatar kraxel avatar rth7680 avatar aurel32 avatar kevmw avatar afaerber avatar jan-kiszka avatar mstsirkin avatar elmarco avatar agraf avatar ehabkost avatar stefanharh avatar stweil avatar xanclic avatar ebblake avatar andrewfasano avatar berrange avatar edgarigl avatar balrog-kun avatar dgibson avatar avikivity avatar pete128 avatar jnsnow avatar gongleiarei avatar aik avatar jwrdegoede avatar phulin avatar

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.