qnxmount


Nameqnxmount JSON
Version 0.1.7 PyPI version JSON
download
home_pagehttps://github.com/NetherlandsForensicInstitute/qnxmount
Summaryread only mounters for qnx filesystems
upload_time2024-02-28 16:30:51
maintainer
docs_urlNone
authorFrancis Hoogendijk
requires_python>=3.7,<4.0
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # QNX Filesystems Mounter

## Project Discription

This project contains code to parse and mount (read only) QNX filesystems in non-standard images (HDD / SSD / eMMC).

Existing tools were not able to handle the exotic configurations of some of the filesystems that we encountered in vehicle forensics, for instance on blocksizes greater than 4K on qnx6 filesystems, or non-standard allignment on qnx efs filesystems.

The description of the binary data structure of these filesystems is done with [kaitai](https://kaitai.io/) and this description can be found in the `.ksy` files in the folders for each respective qnx filesystem ([qnx6](qnxmount/qnx6/parser.ksy), [etfs](qnxmount/etfs/parser.ksy), and [efs](qnxmount/efs/parser.ksy)). With Kaitai, a Python based parser was generated. Mounting with these parsers is based on fuse.

This project is only tested on Linux machines. 


## Getting started

Set up your Python virtual environment and activate the environment:
```commandline
python3 -m venv venv
source ./venv/bin/activate
```
Install qnxmount and fuse in the virtual environment:
```commandline
pip install qnxmount
sudo apt install fuse
```

<!-- Or clone this repo and install.
```commandline
pip install .
``` -->


## Usage

General use of the module is as follows:
```shell
python3 -m qnxmount {fs_type} [options] /image /mountpoint
```
where `fs_type` is the filesystem type (qnx6, etfs, or efs) and options are the options for that filesystem type.

The options are different for each filesystem type. An overview is given below. For more information use the help option. 
```shell
python3 -m qnxmount qnx6 [-o OFFSET] /image /mountpoint
python3 -m qnxmount etfs [-o OFFSET] [-s PAGE_SIZE] /image /mountpoint
python3 -m qnxmount efs /image /mountpoint
```

Note that the offset and page size can be entered in decimal, octal, binary, or hexadecimal format. For example, we can mount an image with a qnx6 filesystem at offset 0x1000 with:
```shell
python3 -m qnxmount qnx6 -o 0x1000 /image /mountpoint 
```
Using the option `-o 4096` would give the same result.

If mounting succeeds you will see the log message `"Mounting image /image on mount point /mountpoint"` appear and the process will hang. Navigate to the given mount point with another terminal session or a file browser to access the file system.

Unmounting can be done from the terminal with:
```shell
sudo umount /mountpoint
```
The logs will show show that the image was successfully unmounted and qnxmount will exit.

## Contributing and Testing

If you want develop the tool and run tests, first fork the repository. Contributions can be submitted as a merge request. 

To get started clone the forked repository and create a virtual environment. Install the test dependencies and fuse into the environment.
```commandline
pip install .[test]
sudo apt install fuse
```

The folder **tests** contains functional tests to test the different parsers.
To run these tests you need a file system image and an accompanying tar archive.
The tests run are functional tests that check whether the parsed data from the test image is equal to the data stored in the archive.
Default test_images are located in the folders **test_data**.
If you want to test your own image replace the files **test_image.bin** and **test_image.tar.gz** with your own.

A test image can be created by running the script `make_test_fs.sh` inside a QNX Virtual Machine.
Update the script with the (edge) cases you want to check and run the command below.
This should create an _image.bin_ and _image.tar.gz_ into the specified directory.
These can be used as test files.
```shell
make_test_fs.sh /path/to/output/directory
```

To run the tests in this repo navigate to the main directory of the repo and run:
```shell
pytest
```

[//]: # (Usually, tests can be run by directly calling `pytest tests --image ... --tar ...`, however this method fails here.)
[//]: # (The reason is that the tests are located in a separate subfolder from the **qnx6_file_system.py**. )
[//]: # (The qnx6_file_system module cannot be imported because it is not located in the tests directory.)
[//]: # (When python3 is called it adds '.' to the PATH and since the qnx6_file_system module is located in the working directory they can be found.)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NetherlandsForensicInstitute/qnxmount",
    "name": "qnxmount",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Francis Hoogendijk",
    "author_email": "f.hoogendijk@nfi.nl",
    "download_url": "https://files.pythonhosted.org/packages/bf/8d/b7d10f6e06738448acaf056cf20503e672148b1f10fc55738321e64b351c/qnxmount-0.1.7.tar.gz",
    "platform": null,
    "description": "# QNX Filesystems Mounter\n\n## Project Discription\n\nThis project contains code to parse and mount (read only) QNX filesystems in non-standard images (HDD / SSD / eMMC).\n\nExisting tools were not able to handle the exotic configurations of some of the filesystems that we encountered in vehicle forensics, for instance on blocksizes greater than 4K on qnx6 filesystems, or non-standard allignment on qnx efs filesystems.\n\nThe description of the binary data structure of these filesystems is done with [kaitai](https://kaitai.io/) and this description can be found in the `.ksy` files in the folders for each respective qnx filesystem ([qnx6](qnxmount/qnx6/parser.ksy), [etfs](qnxmount/etfs/parser.ksy), and [efs](qnxmount/efs/parser.ksy)). With Kaitai, a Python based parser was generated. Mounting with these parsers is based on fuse.\n\nThis project is only tested on Linux machines. \n\n\n## Getting started\n\nSet up your Python virtual environment and activate the environment:\n```commandline\npython3 -m venv venv\nsource ./venv/bin/activate\n```\nInstall qnxmount and fuse in the virtual environment:\n```commandline\npip install qnxmount\nsudo apt install fuse\n```\n\n<!-- Or clone this repo and install.\n```commandline\npip install .\n``` -->\n\n\n## Usage\n\nGeneral use of the module is as follows:\n```shell\npython3 -m qnxmount {fs_type} [options] /image /mountpoint\n```\nwhere `fs_type` is the filesystem type (qnx6, etfs, or efs) and options are the options for that filesystem type.\n\nThe options are different for each filesystem type. An overview is given below. For more information use the help option. \n```shell\npython3 -m qnxmount qnx6 [-o OFFSET] /image /mountpoint\npython3 -m qnxmount etfs [-o OFFSET] [-s PAGE_SIZE] /image /mountpoint\npython3 -m qnxmount efs /image /mountpoint\n```\n\nNote that the offset and page size can be entered in decimal, octal, binary, or hexadecimal format. For example, we can mount an image with a qnx6 filesystem at offset 0x1000 with:\n```shell\npython3 -m qnxmount qnx6 -o 0x1000 /image /mountpoint \n```\nUsing the option `-o 4096` would give the same result.\n\nIf mounting succeeds you will see the log message `\"Mounting image /image on mount point /mountpoint\"` appear and the process will hang. Navigate to the given mount point with another terminal session or a file browser to access the file system.\n\nUnmounting can be done from the terminal with:\n```shell\nsudo umount /mountpoint\n```\nThe logs will show show that the image was successfully unmounted and qnxmount will exit.\n\n## Contributing and Testing\n\nIf you want develop the tool and run tests, first fork the repository. Contributions can be submitted as a merge request. \n\nTo get started clone the forked repository and create a virtual environment. Install the test dependencies and fuse into the environment.\n```commandline\npip install .[test]\nsudo apt install fuse\n```\n\nThe folder **tests** contains functional tests to test the different parsers.\nTo run these tests you need a file system image and an accompanying tar archive.\nThe tests run are functional tests that check whether the parsed data from the test image is equal to the data stored in the archive.\nDefault test_images are located in the folders **test_data**.\nIf you want to test your own image replace the files **test_image.bin** and **test_image.tar.gz** with your own.\n\nA test image can be created by running the script `make_test_fs.sh` inside a QNX Virtual Machine.\nUpdate the script with the (edge) cases you want to check and run the command below.\nThis should create an _image.bin_ and _image.tar.gz_ into the specified directory.\nThese can be used as test files.\n```shell\nmake_test_fs.sh /path/to/output/directory\n```\n\nTo run the tests in this repo navigate to the main directory of the repo and run:\n```shell\npytest\n```\n\n[//]: # (Usually, tests can be run by directly calling `pytest tests --image ... --tar ...`, however this method fails here.)\n[//]: # (The reason is that the tests are located in a separate subfolder from the **qnx6_file_system.py**. )\n[//]: # (The qnx6_file_system module cannot be imported because it is not located in the tests directory.)\n[//]: # (When python3 is called it adds '.' to the PATH and since the qnx6_file_system module is located in the working directory they can be found.)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "read only mounters for qnx filesystems",
    "version": "0.1.7",
    "project_urls": {
        "Homepage": "https://github.com/NetherlandsForensicInstitute/qnxmount",
        "Repository": "https://github.com/NetherlandsForensicInstitute/qnxmount"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ff8eb3a34f0a294a159494f11bde9c63df3f15cc3ccb882303faf6ac28d2d5f",
                "md5": "602ca2325649ce579591767f4869c0d7",
                "sha256": "07e92f07c61fb373e324b87981314f90f7eeb213fc991e229dc5ec4d0a8a1c0c"
            },
            "downloads": -1,
            "filename": "qnxmount-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "602ca2325649ce579591767f4869c0d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 29993,
            "upload_time": "2024-02-28T16:30:49",
            "upload_time_iso_8601": "2024-02-28T16:30:49.713653Z",
            "url": "https://files.pythonhosted.org/packages/5f/f8/eb3a34f0a294a159494f11bde9c63df3f15cc3ccb882303faf6ac28d2d5f/qnxmount-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bf8db7d10f6e06738448acaf056cf20503e672148b1f10fc55738321e64b351c",
                "md5": "702afa1f2e57ed7bddc7a79f683c697b",
                "sha256": "1d16524720254d894527449728171e9ce18475fa6dafb2906e1eb11db9a2cc28"
            },
            "downloads": -1,
            "filename": "qnxmount-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "702afa1f2e57ed7bddc7a79f683c697b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 26149,
            "upload_time": "2024-02-28T16:30:51",
            "upload_time_iso_8601": "2024-02-28T16:30:51.684600Z",
            "url": "https://files.pythonhosted.org/packages/bf/8d/b7d10f6e06738448acaf056cf20503e672148b1f10fc55738321e64b351c/qnxmount-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-28 16:30:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NetherlandsForensicInstitute",
    "github_project": "qnxmount",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "qnxmount"
}
        
Elapsed time: 0.23541s