Script plus a zipped datum

I was inspired by some vendor script that started off with a shell script and had a bunch of binary content at the end. I was looking for binary files on a filesystem and was investigating. At the top of the script was the message, “You are probably here because of the scary-looking binary contents at the bottom. It is the zipped contents of the program [whatever it was].”

That script inspired me to write my own script for storing and using data on demand that is slightly obscured from casual users. In this case, the script merely prints out a message. It has very limited use cases, but it was amusing to research and use for the one instance so far.

See the source at my gitlab.

#!/usr/bin/env sh
# Filename: store-crypted.sh.in
# License: CC-BY-SA 4.0
# Author: bgstack15
# Startdate: 2019-08-28 08:00
# Title: Script Plus A Zipped Datum (spazd)
# Purpose: Script that stores a zip file at the end of this file, to obscurely and insecurely store a simple value
# History:
# Usage:
#    create crypted object:
#       printf '%s' "CUSTOMVALUE" | bzip2 > ~/foo3
#    learn value for "mysize" and update script
#       wc -c ~/foo3
#    remove comments from this input file and build final script
#       cat store-crypted.sh.in ~/foo3 > final.sh ; rm ~/foo3
# Reference:
#    various installer tarball/script combos from different vendors
#    original research
# Improve:
# Documentation:

mysize=62
cat="$( printf '\x62\x75\x6e\x7a\x69\x70\x32' )"
tail -c${mysize} "${0}" | $cat | cat
printf '\r\n'
exit

stub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.