对脚本中一些敏感的数据,如密码等明文信息,在保留用途的同时可使用二进制封装

一、下载shc工具

下载地址:http://www.datsi.fi.upm.es/~frosal/

二、解压

[root@docker02 ~]# tar xf shc-3.8.9b.tgz 

三、编译安装

[root@docker02 ~]# cd shc-3.8.9b/
[root@docker02 shc-3.8.9b]# make
cc -Wall  shc.c -o shc
***	�Do you want to probe shc with a test script?
***	Please try...	make test

四、将shc命令复制到bin目录下

[root@docker02 shc-3.8.9b]# cp shc /usr/local/bin/

五、对脚本进行封装

[root@docker02 ~]# shc -r -f eg08.sh 

六、查看封装后的文件

[root@docker02 ~]# ls
 eg08.sh  eg08.sh.x  eg08.sh.x.c

eg08.sh.x是加密后的可执行的二进制文件,eg08.sh.x.c是C语言形式的原文件

一、使用gzexe命令

二、下载rpm软件包

[root@docker02 ~]# yum provides gzexe -y
[root@docker02 ~]# yum install gzip -y

三、用法

[root@docker02 ~]# gzexe 01.sh 
01.sh:	 14.8%

四、查看

[root@docker02 ~]# ls
01.sh   01.sh~  

五、01.sh~为原脚本文件,01.sh为封装后的二进制文件

六、解封装

[root@docker02 ~]# gzexe -d 01.sh

七、此时01.sh为原文件,01.sh~为封装的二进制文件

Categories: go

4 Comments

Aida206 · 2024年12月5日 at 下午6:06

I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.

Agatha206 · 2024年12月20日 at 下午6:59

Thanks a lot for one’s intriguing write-up. It’s actually exceptional. Searching ahead for this sort of revisions.

Addie206 · 2024年12月26日 at 上午2:26

I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks

Alana206 · 2025年1月1日 at 下午12:27

I see some amazingly important and kept up to length of your strength searching for in your on the site

发表评论

Avatar placeholder

邮箱地址不会被公开。 必填项已用*标注