Giter Site home page Giter Site logo

matthias-deu / ubift Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 161 KB

The UBI Forensic Toolkit (UBIFT) is a Python command-line interface tool that aims to provide various functionalities to assist an IT forensic evaluation of the UBIFS file system.

License: MIT License

Python 100.00%
forensics ubi ubifs

ubift's Introduction

UBI Forensic Toolkit

The UBI Forensic Toolkit (UBIFT) is a Python command-line interface tool that aims to provide various functionalities to assist an IT-forensic evaluation of the UBIFS file system. It is based on the concepts of The Sleuth Kit by Brian Carrier. As such, UBIFT aims to fulfil the requirements for forensic tools set by Brian Carrier in his paper Defining Digital Forensic Examination and Analysis Tools Using Abstraction Layers. Furthermore, UBIFT makes use of Carrier's idea of a layered approach for forensics tools that is also described in his paper.

A notable feature of UBIFT is the ability to recover deleted data. Most commands can be used in conjunction with a --deleted parameter, causing UBIFT to look for deleted content. For instance, all deleted directory entries may be retrieved with the following command:

python ./ubift.py fls /path/to/your_flash_dump.bin -o 0 -n data --deleted
Type    Inode   Parent  Name
file    0       105     secret.txt
dir     0       104     secret_folder
file    0       107     secret_image1.jpg
file    0       107     secret_image4.jpg

In order to recover all files (including deleted files), use the following command:

python ./ubift.py ubift_recover /path/to/your_flash_dump.bin --output /path/to/output --deleted

Usage

UBIFT uses a similar syntax as The Sleuth Kit. Every command has a prefix and a suffix. The prefix, such as mtd refers to the layer it is operating on. The suffix, such as ls depicts the desired operation to be performed.

UBIFT supports the following commands:

Command Description
mtdls Lists information about all available Partitions, including UBI instances. UBI instances have the description 'UBI'.
mtdcat Outputs the binary data of an MTD partition, given by its index. Use 'mtdls' to see all indeces.
pebcat Outputs a specific phyiscal erase block.
ubils Lists all instances of UBI and their volumes.
ubicat Outputs contents of a specific UBI volume to stdout.
lebls Lists all mapped LEBs of a specific UBI volume.
lebcat Outputs a specific mapped logical erase block of a specified UBI volume.
fsstat Outputs information regarding the UBIFS file-system within a specific UBI volume.
fls Outputs information regarding file names in an UBIFS instance within a specific UBI volume.
istat Displays information about a specific inode in an UBIFS instance.
icat Outputs the data of an inode.
ils Lists all inodes of a given UBIFS instance.
ffind Outputs directory entries associated with a given inode number.
ubift_recover Extracts all files found in UBIFS instances. Creates one directory for each UBI volume with UBIFS.
ubift_info Outputs information regarding recoverability of deleted inodes. This parameter takes priority over all other parameters.
jls Lists all nodes within the journal.

For a detailed description of every command, refer to the --help of the tool.

Autopsy Integration

UBIFT can be integrated with Autopsy by using the Python ingest module found at /ubift/autopsy/ubift_autopsy.py

An installation guide about the installation of Python modules can be found here

IMPORTANT: The module requires UBIFT to be available in the same directory as the Python ingest module. Therefore UBIFT has to be packed and provided via pyInstaller to the same directory as the module

Branch original

Contains the original version described in the master's thesis. The original version contains some differences that were changed in later versions. For instance, instead of specifying offsets and ubi volumes as follows:

python .\ubift.py fls 'D:\flash_dump.bin' -o 123 -n data

The parameters were positional arguments, resulting in a loss of flexibility.

python .\ubift.py fls 'D:\flash_dump.bin' 123 data

Dependencies

cstruct~=5.2

setuptools~=60.2.0

crcmod~=1.7

zstandard~=0.21.0

python-lzo>=1.11

pathvalidate

Similar Tools

UBIFS Dumper

UBI Reader

References

The Sleuth Kit

Autopsy

Author

Matthias Deutschmann ([email protected])

ubift's People

Contributors

matthias-deu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

ubift's Issues

UBIFTException: Cannot find specified UBI Volume

  1. Download ubi image
    http://chip.jfpossibilities.com/chip/images/stable/pocketchip/126/chip-400000-4000-500.ubi.sparse

  2. Use simg2img to convert sparse image to raw image.

  3. Check (page size: 0x4000, ubifs at 0x8000)
    00000000: 5542 4923 0100 0000 0000 0000 0000 0000 UBI#............
    00004000: 5542 4921 0101 0005 7fff efff 0000 0000 UBI!............
    00008000: 0000 071d 0000 0001 0000 0000 0100 0006 ................
    00008010: 726f 6f74 6673 0000 0000 0000 0000 0000 rootfs..........

  4. List files
    $ python3 ./ubift.py fls ../chip-400000-4000-500.ubi -o 0 -n data
    Traceback (most recent call last):
    File "/mnt/ubift-master/./ubift.py", line 7, in
    b.run()
    File "/mnt/ubift-master/ubift/cli/init.py", line 190, in run
    args.func(args)
    File "/mnt/ubift-master/ubift/cli/init.py", line 750, in fls
    ubi_vol = self._initialize_ubi_volume(ubi, args)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/mnt/ubift-master/ubift/cli/init.py", line 306, in _initialize_ubi_volume
    raise exception.UBIFTException(
    ubift.exception.UBIFTException: [-] Cannot find specified UBI Volume. Either the volname or volindex is invalid.

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.