1.Encryption Tools1.1 Gzexe1.1.1Description
Gzexe is the program used to compress execution files. When you go to execute a compressed execution file, the file is automatically decompressed and then continues to execute, using the same generic execution file.
1.1.2installation
Linux comes with no separate installation.
1.1.3usage
Gzexe filename.sh
It will back up the original unencrypted file as file.sh~, while file.sh is converted into an encrypted file.
1.1.4Parameters
-D Unpack the compressed file
1.2 shc1.2.1Description
SHC is a professional cryptographic Shell Script tool, its role is to convert shell script into an executable binary file, this method is a good solution to the script contains IP, password and so do not want to open the problem.
1.2.2installation
method One: Compile the installation
Tar zxvf shc-3.8.tgz
CD shc-3.8
Make Test
Make
Make Test
Make strings
Make install
Method Two :rpm Package installation
installation package Download:http://pkgs.repoforge.org/shc/
Yum Install shc-3.8.6-1.el6.rf.x86_64.rpm
1.2.3usage
Shc-r-F Script-name
after running, two files are generated,script-name.x and script-name.x.c. Where script-name.x is an executable binary that is encrypted , and can be runwith./script-name.x, Script-name.x.c is a generated Script-name.x 's original file (C language ).
1.2.4Parameters
-E Date
Expiration date in Dd/mm/yyyyformat [None](Specify expiration date)
-M message
Message to display uponexpiration ["Your provider"](specify information for expiration prompts)
-F Script_name
File name of the script tocompile (specifies the path and file name ofthe shell to be compiled )
-R Relax Security.
Make a redistributable Binarywhich executes on different systems running the same operat-ing system. (can be performed on different systems of the same operating system)
-V Verbose compilation(details of compilation)
Example:
[[email protected] tmp] #shc-e20/10/2010-m "Contact [email protected]"-v-r-F./ex.sh
-E: Specify an expiration time of ten months
-M: information printed out after expiration;
-v:verbose
-R: can be performed on different hosts on the same operating system
-F: Specify the source shell
2.issues encountered with installation2.1problems with compiling and installing
[[email protected] shc-3.8.7]# make test
Cc-wall-o6 Shc.c-o SHC
Compiling script "Match"
Cflags= "-wall-o6"./shc-v-F match
SHC Shll=sh
SHC [-i]=-c
SHC [-x]=exec '%s ' "[email protected]"
SHC [-l]=
SHC opts=
Shc:cc-wall-o6 Match.x.c-o match.x
Shc:strip match.x
Shc:chmod Go-r match.x
Running a compiled test script!
It must show files with substring "sh" in your PATH ...
./match.x SH
to ./match.x sh stuck, the problem is environmental problems, You can change a clean system test.
2.2 Yumafter installationShcIssues with Encryption
still the last environmental issue,Yum encryption after installation, encountered prompt:
[Email protected] wangpan]# Shc-r-F echo.sh
echo.sh.x.c:in function ' chkenv ':
Echo.sh.x.c:212:warning:castfrom pointer to integer of different size
If you run the./echo.sh.x directly, you will be prompted:
[Email protected] wangpan]#./echo.sh.x
[1]+ Stopped./echo.sh.x
The problem is still caused by environmental problems, or the need for a clean system.
2.3Indirect Solutions
find an environment with no problem the system is encrypted and then copied to the official system to run.
2.4 in the above questions if you have a better solution, please reply to me, learn together, thank you!
Shell Script Encryption Tool