Skip to content

archcloudlabs/safetyheader

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 


About The Project

Prevent accidental execution of binaries by prepending a "unique header" to the binary.

Requirements

  • Python3

Example CLI Usage

  • Prepend "deadcafe" to binaries in a specific directory.
./safeheader.py --patch --dir ./test_bins/\*
./safeheader.py -p -d ./test_bins/\*

Note, you must specify an extension or add '' to prepend a header to all files.*

  • Remove "deadcafe" from binaries in a specific directory.
./safeheader.py --rm --dir test_bins/\*

Unit Tests

Executing python -m unittest should result in

.[+] Successfully patched ./test_bins/test.bin with header b'\xde\xad\xca\xfe'
.[!] Error, you cannot remove and patch the magicheader!
.[!] Error, you cannot remove and patch the magicheader!
.[!] Magic header has already been removed
.
----------------------------------------------------------------------
Ran 4 tests in 0.004s

OK

If anything else is produced, please create an issue.

About

Add a bogus header to a directory of binaries to avoid accidental execution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages