当前位置:网站首页>Shell script binary encryption

Shell script binary encryption

2022-06-11 03:42:00 Garenliu

Shell The script is converted to binary encryption 、

1、 We need to be right about IP Address 、 Simple confidentiality of account and password .

2、 Download and install shc-3.8.9.tgz

wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
[[email protected] soft]# wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
--2022-01-13 14:03:40--  http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
Resolving www.datsi.fi.upm.es (www.datsi.fi.upm.es)... 138.100.9.22
Connecting to www.datsi.fi.upm.es (www.datsi.fi.upm.es)|138.100.9.22|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20687 (20K) [application/x-gzip]
Saving to: ‘shc-3.8.9b.tgz’

100%[=====================================================>] 20,687      81.9KB/s   in 0.2s   

2022-01-13 14:03:41 (81.9 KB/s) - ‘shc-3.8.9b.tgz’ saved [20687/20687]

[[email protected] soft]# 

3、 decompression shc-3.8.9b.tgz

[[email protected] soft]# tar zxvf shc-3.8.9b.tgz 
shc-3.8.9b/CHANGES
shc-3.8.9b/Copying
shc-3.8.9b/match
shc-3.8.9b/pru.sh
shc-3.8.9b/shc-3.8.9b.c
shc-3.8.9b/shc.c
shc-3.8.9b/shc.1
shc-3.8.9b/shc.README
shc-3.8.9b/shc.html
shc-3.8.9b/test.bash
shc-3.8.9b/test.csh
shc-3.8.9b/test.ksh
shc-3.8.9b/makefile
shc-3.8.9b/testit
[[email protected] soft]# 

4、 Compilation and installation

[[email protected] 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
[[email protected] shc-3.8.9b]# make install
***	Installing shc and shc.1 on /usr/local
***	¿Do you want to continue? y
install -c -s shc /usr/local/bin/
install -c -m 644 shc.1 /usr/local/man/man1/
install: target ‘/usr/local/man/man1/’ is not a directory: No such file or directory
make: *** [install] Error 1
[[email protected] shc-3.8.9b]# 

remarks : When you first test on a virtual machine , Report errors

[[email protected] shc-3.8.9b]# make install
cc -Wall  shc.c -o shc
make: cc: Command not found 
make: *** [shc]  error  127

The reason is that there is no installation gcc

yum -y install gcc automake autoconf libtool make
# Just execute the installation 

5、 Simple test function

[[email protected] ~]# mkdir scripts
[[email protected] ~]# cd scripts/
[[email protected] scripts]# ls
[[email protected] scripts]# vim hello.sh
[[email protected] scripts]# ls
hello.sh
[[email protected] scripts]# chmod +x hello.sh 
[[email protected] scripts]# ./hello.sh 
Hello,World!
[[email protected] scripts]# shc -r -f hello.sh 
[[email protected] scripts]# ll
total 28
-rwxr-xr-x 1 root root    32 Jan 13 14:11 hello.sh
-rwx--x--x 1 root root 11232 Jan 13 14:11 hello.sh.x
-rw-r--r-- 1 root root  9401 Jan 13 14:11 hello.sh.x.c
[[email protected] scripts]# mv hello.sh.x hello.sh
mv: overwrite ‘hello.sh’? n
[[email protected] scripts]# mv hello.sh.x hello
[[email protected] scripts]# ls
hello  hello.sh  hello.sh.x.c
[[email protected] scripts]# ./hello
Hello,World!
[[email protected] scripts]# 

summary : final hello.sh.x Binary files ,hello.sh.x.c It's rewritten c Language . This is not strictly confidential . Simple confidentiality meets the requirements . A higher level of confidentiality cannot be achieved .

原网站

版权声明
本文为[Garenliu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020553128415.html