Smudge (actually break) a file so that it is detected as another type of file.
examples
smudging a file
This example takes a Mach-O executable, and writes the 8 magic bytes to make it look like a png
. The 8 bytes that orinally were in the file is backed up to a test.bytes_backup
file.
restoring a file
It is possible to restore the file using filesmudge too (assuming the .bytes_backup
file is available)
install
pip install filesmudge
After installation, you should have the filesmudge
commandline tool available to use.
usage & help
filesmudge
accepts the --help
parameter to get help.
~ » filesmudge --help
Usage: filesmudge [OPTIONS] COMMAND [ARGS]...
Filesmudge. Smudge file magic bytes to look like other files.
Options:
--help Show this message and exit.
Commands:
available List available types for 'smudge'
restore Restore a smudged file from .bytes_backup
smudge Smudge magic bytes with a known type
smudgeraw Smudge magic bytes with raw bytes
typedetect Determine a file type based on magic bytes
All of the commands have their own help too and will explain the required parameters