Posts

Showing posts from 2021

Convert a shell script into a binary executable file

Sometimes script includes the password in plain text which is Security issue, to avoid easy expose of password package the edited shell script into a binary executable, so that no one can read password by just opening the script in editor. Method 1 Important Note: The tool mentioned here does not support the generated binaries for use on other hosts. Tool to convert script to binary is shc.  shc creates a stripped binary executable version of the script Official download site: http://www.datsi.fi.upm.es/~frosal/ Installation Download the latest version: shc-3.8.9b.tgz tar -zxvf shc -3.8 .9 b.tgz cd shc -3.8 .9 b/ make Compile package, after successful compilation Add an executable file shc to the current directory cp shc /usr/ local /bin/ Usage: Use command shc -r -f abc.sh After executing, two files will be generated, abc.sh.x and abc.sh.xc  where abc.sh.x is the encrypted executable binary file; run with ./abc.sh.x,  abc.sh .xc is the original file (c language) that generates abc.sh.