

#Geek tools shell script examples code
This C source code is compiled to create the above encrypted welcome.sh.x file. welcome.sh.x.c is the C source code of the welcome.sh file.welcome.sh.x is the encrypted shell script in binary format.welcome.sh is the original unencrypted shell script.This will create two extra files, as shown below: src]# ll welcome.sh* Lets create a script for testing purposes, which will display a simple Welcome to the Linux world message, as follows: $vi welcome.shĮncrypt the welcome.sh shell scripting using SHC, as shown below: src]# shc -v -f welcome.sh Table 1: SHC options and variablesįirst, create the test shell script that you are going to use to encrypt. It will display the path of the SHC binary. *** ❽o you want to continue? y <<-Press YĬross check that shc is installed properly shc-3.8.9b]# which shc
#Geek tools shell script examples install
You can ignore it, install the man package or create the /usr/local/man/man1/ directory, and again execute the make install command. It will show an error message, as the minimal installation default man package is not installed. Install: target `/usr/local/man/man1/ is not a directory: No such file or directory Install -c -m 644 shc.1 /usr/local/man/man1/ <<-–Press Y install -c -s shc /usr/local/bin/ *** Installing shc and shc.1 on /usr/local

To install the SHC binary, execute the commands below: shc-3.8.9b]# make install *** ❽o you want to probe shc with a test script? To compile SHC, execute the make command, as follows: shc-3.8.9b]# make Or, give the following command: #yum install make gcc gcc-c++ kernel-devel Figure 1: How shc worksĭownload the latest source code tar package for shc, for that first install wget package: #yum install wgetĮxtract the tar package: #tar -zvxf shc-3.8.9b.tgz To install the required packages for compiling SHC from the source code, execute the command below on a terminal with root privileges: #yum groupinstall ∽evelopment Tools Here, I have chosen the Centos 6.7 version (equivalent: RHEL 6.7) with minimal installation in the virtual box. Generated C source code is saved in a file with the extension. x extension appended, and will usually be a bit larger in size than the original ASCII code. SHC creates a stripped binary executable version of the script specified with -f on the command line. Created by Francisco Javier Rosales García, it converts shell scripts directly into binaries, compiles scripts, hides source code, protects against accidental changes and hides sensitive data in script. SHC stands for the generic shell script compiler. There are tools such as obfsh and shellcrypt available to hide source code. Often, we need to hide shell script code to prevent unintentional modification and hide sensitive information in scripts like passwords. It also converts shell scripts directly into binaries. The generic shell script compiler (SHC) can hide source code, which is useful in preventing accidental erasures, alterations and deliberate, mischievous and malicious tampering.
