mac % gzexe hello.sh gzexe: cannot compress hello.sh, it is not executable # hello.sh 必须是一个可执行文件
# 修改hello.sh 为可执行文件 mac % chmod 744 hello.sh
mac % gzexe hello.sh hello.sh: -4.3%
# 成功,并且体检压缩了4.3% 我们执行一下ls 看看发生了什么 mac % ls hello.sh hello.sh~
# 这个时候我们发现hello.sh已经加密了,但我们发现多了一个hello.sh~文件。 这个就是我们的加密前的源文件。 # 源文件还在?我们把hello.sh~删了 , 看看还不能运行。 mac % rm hello.sh~ mac % sh hello.sh Hello World # 依然可以运行
mac % shc -h shc Version 4.0.3, Generic Shell Script Compiler shc GNU GPL Version 3 Md Jahidul Hamid <jahidulhamid@yahoo.com> shc Usage: shc [-e date] [-m addr] [-i iopt] [-x cmnd] [-l lopt] [-o outfile] [-rvDSUHCABh] -f script
-e %s Expiration dateindd/mm/yyyy format [none] -m %s Message to display upon expiration ["Please contact your provider"] -f %s File name of the script to compile -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: -- -o %s output filename -r Relax security. Make a redistributable binary -v Verbose compilation -S Switch ON setuid for root callable programs [OFF] -D Switch ON debug exec calls [OFF] -U Make binary untraceable [no] -H Hardening : extra security protection [no] Require bourne shell (sh) and parameters are not supported -C Display license and exit -A Display abstract and exit -B Compile for busybox -h Display help and exit