GithubHelp home page GithubHelp logo

n1neman / firmae Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pr0v3rbs/firmae

0.0 0.0 0.0 1.46 MB

Towards Large-Scale Emulation of IoT Firmware for Dynamic Analysis

License: MIT License

Shell 16.21% Python 70.76% C 12.22% Makefile 0.20% Dockerfile 0.62%

firmae's Introduction

FirmAE

FirmAE is a fully-automated framework that performs emulation and vulnerability analysis. FirmAE significantly increases the emulation success rate (From Firmadyne's 16.28% to 79.36%) with five arbitration techniques. We tested FirmAE on 1,124 wireless-router and IP-camera firmware images from top eight vendors.

We also developed a dynamic analysis tool for 0-day discovery, which infers web service information based on the filesystem and kernel logs of target firmware. By running our tool on the succesfully emulation firmware images, we discovered 12 new 0-days which affect 23 devices.

Installation

Note that we tested FirmAE on Ubuntu 18.04.

  1. Clone FirmAE
$ git clone --recursive https://github.com/pr0v3rbs/FirmAE
  1. Run download.sh script.
$ ./download.sh
  1. Run install.sh script.
$ ./install.sh

Usage

  1. Execute init.sh script.
$ ./init.sh
  1. Prepare a firmware.
$ wget https://github.com/pr0v3rbs/FirmAE/releases/download/v1.0/DIR-868L_fw_revB_2-05b02_eu_multi_20161117.zip
  1. Check emulation
$ sudo ./run.sh -c <brand> <firmware>
  1. Analyze the target firmware

    • Analysis mode uses the FirmAE analyzer
    $ sudo ./run.sh -a <brand> <firmware>
    • Run mode helps to test web service or execute custom analyzer
    $ sudo ./run.sh -r <brand> <firmware>

Debug

After run.sh -c finished.

  1. User-level basic debugging utility. (Useful when an emulated firmware is network reachable)
$ sudo ./run.sh -d <brand> <firmware>
  1. Kernel-level boot debugging.
$ sudo ./run.sh -b <brand> <firmware>

Turn on/off arbitration

Check the five arbitrations environment variable in the firmae.config

$ head firmae.config
#!/bin/sh

FIRMAE_BOOT=true
FIRMAE_NETWORK=true
FIRMAE_NVRAM=true
FIRMAE_KERNEL=true
FIRMAE_ETC=true

if (${FIRMAE_ETC}); then
  TIMEOUT=240

Docker

First, prepare a docker image.

$ ./docker-init.sh

Parallel mode

Then, run one of the below commands. -ec checks only the emulation, and -ea checks the emulation and analyzes vulnerabilities.

$ ./docker-helper.py -ec <brand> <firmware>
$ ./docker-helper.py -ea <brand> <firmware>

Debug mode

After a firmware image successfully emulated.

$ ./docker-helper.py -ed <firmware>

Evaluation

Emulation result

Google spreadsheet - view

Dataset

Google drive - download

CVEs

Authors

This research project has been conducted by SysSec Lab at KAIST.

Citation

We would appreciate if you consider citing our paper when using FirmAE.

@inproceedings{kim:2020:firmae,
  author = {Mingeun Kim and Dongkwan Kim and Eunsoo Kim and Suryeon Kim and Yeongjin Jang and Yongdae Kim},
  title = {{FirmAE}: Towards Large-Scale Emulation of IoT Firmware for Dynamic Analysis},
  booktitle = {Annual Computer Security Applications Conference (ACSAC)},
  year = 2020,
  month = dec,
  address = {Online}
}

firmae's People

Contributors

pr0v3rbs avatar chinanuke avatar kibouo avatar credmp avatar pagabuc avatar loverics avatar newthis 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.