Encrypt and obfuscate your shell script
We need to ensure package manager is updated and free from errors, then install dependencies.
Debian/Ubuntu:
RHEL/Fedora:
Then download and extract obash source archive:
Now enter obash source directory, run
Now our obash is now ready to use, run
examples:
* Encrypt your myscript.sh with output filename MyEncryptedScript(executable only on local machine):
* Encrypt your myscript.sh with output filename MyEncryptedScript(executable on all machine/reusable):
## Test run:
Guides for script sharer:
If sharing script for Debian 9 (oldstable), Debian 10 (stable/kernel v4), Ubuntu 16, 18 and 19: Compile it using Debian 9 or Ubuntu 16.
If sharing script for Ubuntu 20, Debian 10 (stable/kernel v5), Fedora 30+, Compile it to their corresponsive distribution version.
Basta ang logic lang po sa pagcocompile, kung anong linux kernel version (v3, v4 or v5) yung pag eexecutan ng script, dapat doon din po kayo magcompile or magbuild ng script.
Tool for checking bash script errors: You do not have permission to view the full content of this post. Log in or register now.
or via their linux tool: (install)
green and yellow text codes are just notice and warnings, while red is critical/fatal errors.
We need to ensure package manager is updated and free from errors, then install dependencies.
Debian/Ubuntu:
export DEBIAN_FRONTEND=noninteractive
apt update
apt autoremove --fix-missing -y -f
apt upgrade -y
apt install build-essential libssl-dev curl -y
RHEL/Fedora:
yum update -y
yum groupinstall "Development Tools" -y
yum install openssl-devel zip curl -y
Then download and extract obash source archive:
curl -skL "https://github.com/louigi600/obash/archive/8976fd2fa256c583769b979036f59a741730eb48.tar.gz" -o obash.tgz
tar xf obash.tgz && rm -f obash.tgz
Now enter obash source directory, run
make clean
first and start compiling obash, then copy obash executable into bin/sbin path of your machine:cd obash-8976fd2fa256c583769b979036f59a741730eb48
make clean
make
mv -f obash /usr/local/sbin/obash
cd .. && rm -rf obash-8976fd2fa256c583769b979036f59a741730eb48
Now our obash is now ready to use, run
obash -h
for guide how to use.examples:
* Encrypt your myscript.sh with output filename MyEncryptedScript(executable only on local machine):
obash -o MyEncryptedScript myscript.sh
* Encrypt your myscript.sh with output filename MyEncryptedScript(executable on all machine/reusable):
obash -r -o MyEncryptedScript myscript.sh
## Test run:
./MyEncryptedScript
Guides for script sharer:
If sharing script for Debian 9 (oldstable), Debian 10 (stable/kernel v4), Ubuntu 16, 18 and 19: Compile it using Debian 9 or Ubuntu 16.
If sharing script for Ubuntu 20, Debian 10 (stable/kernel v5), Fedora 30+, Compile it to their corresponsive distribution version.
Basta ang logic lang po sa pagcocompile, kung anong linux kernel version (v3, v4 or v5) yung pag eexecutan ng script, dapat doon din po kayo magcompile or magbuild ng script.
Tool for checking bash script errors: You do not have permission to view the full content of this post. Log in or register now.
or via their linux tool: (install)
apt install shellcheck -y || yum install ShellCheck -y
; (use) shellcheck myscript.sh
green and yellow text codes are just notice and warnings, while red is critical/fatal errors.
Last edited: