shc可用来对shell脚本进行二进制加密,shcshell


shc可用来对shell脚本进行二进制加密

下面来说说如何安装和使用:

安装:

以shc-3.8.7.tgz为例

tar -vxf shc-3.8.7.tgz


cd shc-3.8.7


make test


make strings


make expiration


make install


make install -c -s shc /usr/local/bin/


make install -c -m 644 shc.1 /usr/local/man/man1/

使用:

shc -r -f script-name 注意:要有-r选项, -f 后跟要加密的脚本名.


运行后会生成两个文件,script-name.x 和 script-name.x.c


script-name.x是加密后的可执行的二进制文件.


./script-name 即可运行.


script-name.x.c是生成script-name.x的原文件(c语言)

但由于生成的文件需要动态谅解不能用作其他机器,需要下面的方法来生成静态的链接库文件。

生成静态链接的二进制可执行文件

可以通过下面的方法生成一个静态链接的二进制可执行文件:

CFLAGS=-static shc -r -f test.sh

file testup.sh.x

相关内容

    暂无相关文章