Skip to content

archcloudlabs/safetyheader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation


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