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=noninteractiveapt updateapt autoremove --fix-missing -y -fapt upgrade -yapt install build-essential libssl-dev curl -yRHEL/Fedora:
yum update -yyum groupinstall "Development Tools" -yyum install openssl-devel zip curl -yThen download and extract obash source archive:
curl -skL "https://github.com/louigi600/obash/archive/8976fd2fa256c583769b979036f59a741730eb48.tar.gz" -o obash.tgztar xf obash.tgz && rm -f obash.tgzNow 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-8976fd2fa256c583769b979036f59a741730eb48make cleanmakemv -f obash /usr/local/sbin/obashcd .. && rm -rf obash-8976fd2fa256c583769b979036f59a741730eb48Now 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:
./MyEncryptedScriptGuides 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.shgreen and yellow text codes are just notice and warnings, while red is critical/fatal errors.




