Skip to main content

Slack_handler Build & Test

Slack_handler is a python tool for extracting File slacks in raw format and writing their details to a CSV file.

The File slacks considered are both RAM and DISK file slacks which represent the data between the none multiple size of the file and the allocated size in clusters. No volume slack is considered.

  • A presentation is available on Youtube (~17min).
  • A description article is available on IEEE Xplore.

Features

Implemented so far:

  • extract all file slacks from raw or ewf disk image to a directory.
  • display file slacks in LATIN-1 or Hex encoding to the console/terminal.
  • pretty print all found file slack data in the provided disk image.
  • Write-out File slacks details to a CSV file including: the original file, the file slack size, the parent directories, MD5 and SHA1 hashes, etc.
  • Support for 'RAW' disk images.
  • Support for 'EWF' disk images.
  • Add CI using Github action.
  • Add a helper function for MD5_calc and SHA1_calc in 'utils' module for factoring the code.
  • Add EWF disk image to test_data.
  • add more tests 'test__file_slack_nbr' and computed MD5 hashs.
  • fix shenanigans of compressed files.
  • add more tests 'test__file_slack_content' (inspection at binary level).
  • add a test case for no_file_slack file.
  • Add relative/absolute location details to CSV report file.
  • cache and optimize Github actions.
  • Add support for disk images in AFF formats.
  • Optimize the way it locates the File slack space.
  • Simulate user behaviors in test disk images using a Bash script.
  • Generate more disk images for validation.
  • add XML description file of each disk image using fiwalk or fls.
  • package everything.

Installation on a Debian/GNU Linux for developers

  • Create a Virtual environment
  • Download the latest release
  • Clone pytsk repository
  • update the repo (get libtsk) python setup.py update
  • build (libtsk) python setup.py build
  • install (which will install pytsk bindings) python setup.py ìnstall
  • pip list now you should see pytsk installed if everything is ok!
  • clone pyewf repository
  • ./synclibs.sh : Script that synchronizes the local library dependencies
  • ./autogen.sh
  • ./configure --enable-python
  • python setup.py build
  • python setup.py install

For further details, please check the steps of the job Build used in Github actions process.

Installation from Pypi (In progress ... )

The tool is hosted on Pypi

  • pip3 install slack-handler
  • slack_handler --version

Usage

To dump all File slacks to 'slacks/' folder and extract all the information to CSV format file named 'report.csv' from a raw image 'USB-NTFS.dd' :

slack_handler --type raw --dump slacks/ --csv report.csv images/USB-NTFS.dd

Help:

usage: slack_handler [-h] [-e ENCODING] -t TYPE [-p] [-d DUMP] [-c CSV] [-v] [--version] disk image

Extract the file slack spaces.

positional arguments:
  disk image

optional arguments:
  -h, --help            show this help message and exit
  -e ENCODING, --encoding ENCODING
                        Display slack space in LATIN-1 or Hex. Supported options 'latin-1', 'hex'.
  -t TYPE, --type TYPE  Type of the disk image. Currently supported options 'raw' and 'ewf'.
  -p, --pprint          Pretty print all found file slack spaces.
  -d DUMP, --dump DUMP  Dump file slack spaces of each file in raw format to a directory if specified, by default temporary dir.
  -c CSV, --csv CSV     Write file slacks information to a CSV file.
  -v, --verbose         Control the verbosity of the output.
  --version             show program's version number and exit

LICENSE

Feel free to read the file LICENSE.

History

Special Thanks fly to

  • Joachim Metz for providing an initial feedback on the little tool related to the different types of disk slack space and the licensing.
  • David Cowen for the awesome serie of "How-to on programming using libtsk and python".
  • Any feedback is a welcome via Github issues or reach out via The Open Source DFIR Slack community using the registration link.

Metadata

Release files for slack-handler 0.2.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slack-handler 0.2.11
File Size Uploaded Provenance
slack_handler-0.2.11.tar.gz 15.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for slack-handler 0.2.11
File Interpreter ABI Platform
slack_handler-0.2.11-py3-none-any.whl Python 3 none any Details

Total release size: 31.8 kB

Release files / slack_handler-0.2.11.tar.gz

Download URL slack_handler-0.2.11.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2c7a9a41e8618e7cf7e533afdf223b269a6f8c5b5ac9b4f80bd6a6c0eb3b2520
BLAKE2b-256 checksum
How to use checksums
99efc2788c09384fedbf97bfbac6f9a02615f7eb5ff445ab2237e3b2236936e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

Release files / slack_handler-0.2.11-py3-none-any.whl

Download URL slack_handler-0.2.11-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8dfcd18e9ea83593edf8d07151700115712953ba0889c7cba2560ccbfb9a5bc5
BLAKE2b-256 checksum
How to use checksums
6f8f140dc6820301976883ca7dcfd33131259de3c0bf4cccb084d65ddbac0109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

Security for slack-handler 0.2.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page