一、介绍
shc是一个专业的加密shell脚本的工具.它的作用是把shell脚本转换为一个可执行的二进制文件,这个办法很好的解决了脚本中含有IP、密码等不希望公开的问题.
二、下载
三、安装
将下载的包上传到liunx或者直接下载
- wget http://www.datsi.fi.upm.es/~frosal/sources/shc-38.9b.tgz
tar -zvxf shc-3.8.9b.tgz
cd shc-3.8.9
mkdir -p /usr/local/man/man1
make install --这里按y
四、加密
使用方法: shc -rf test.sh
使用后会生成test.sh.x,和test.sh.c文件
.x是加密后的可执行的二进制文件
.c是.x的原文件(c语言)
保留.x文件即可
设置过期:
- shc -e 31/12/2099 -m "失效了" -v -r -f test.sh
-e:指定过期时间为2021年12月31日
-m:过期后打印出的信息;
-
v
: verbose
-r: 可在相同操作系统的不同主机上执行
-f: 指定源shell
五、其他
-e %s Expiration date in dd/mm/yyyy format [none] (指定过期日期)
-m %s Message to display upon expiration ["Please contact your provider"] (指定过期提示的信息)
-f %s File name of the script to compile (指定要编译的shell的路径及文件名)
-i %s Inline option for the shell interpreter i.e: -e
-x %s eXec command, as a printf format i.e: exec('%s',@ARGV);
-l %s Last shell option i.e: --
-r Relax security. Make a redistributable binary (可以相同操作系统的不同系统中执行)
-v Verbose compilation (编译的详细情况)