Home

Awesome

BareDroid

BareDroid allows for bare-metal analysis on Android devices. See the paper here

Folders

backup: used to create a backup of the device. It is a bash script which stores a copy of:

restore: used to restore a previous backup. It is a bash script which restore a) system, b) userdata and c) userdatanew partition.

backup_and_restore: used to create a backup and restore it. It is a merge of the previous scripts.

setup_device:


update: contains the python scripts used to manage the infrastructure.

update/config: contains cfg and info files used to setup the python scripts.

How to backup

  1. connect the device
  2. run the "./script" file (the script reboots the device in recovery mode and run the script)
  3. reboot the device

How to restore

  1. connect the device
  2. run the "./script" file (the script reboots the device in recovery mode and run the script)
  3. reboot the device

Analysis script

The goal of this script is to provide a wrapper between the experiment and the infrastructure, SetupAndStart is the main method and the only one called by the infrastructure (i.e., update_manager.py line 178). It setups the environment for the experiment (e.g., adb root) and run the experiment. If you want to use your code in an experiment you need to:

  1. modify the config.cfg file. In the stanza 'Project' put the absolute path to the code that you want to use;
  2. create an python script containing the class used in the stanza 'class' of the config.cfg file;
  3. define a 'run' method in the config.cfg file. This is the method used by the wrapper to start the experiment.

how to add a new device to the infrastructure

  1. see 'setup_device';
  2. run the backup and restore scripts;
  3. add info to the 'update/config/device.info' file (e.g., AndroidId); [mandatory]

general consideration:

  1. device -> Settings -> Storage -> USB computer connection -> disable MTP
  2. device -> Security -> Screen lock -> None
  3. be sure you can install untrusted app (i.e., from outside the market)

How to run an experiment

Architectural overview:

alt tag

  1. to run an experiment you need to include the absolute path of the folder containing the samples to analyze;
  2. run the manager start script against the folder containing the apps to analyze;

example

./start_baredroid path/to/folder/containing/samples
  1. the script will prompt a command line interface which allows the user to interact with the infrastructure (e.g., start experiment);
  2. select option '2' to run the experiment;
  3. when the experiment is finished click on 'q';
  4. the results are stored in the 'update/experiment' folder.

email: simone.mutti@unibg.it