日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
通過SHC加密Shell腳本

shc是一個(gè)加密shell腳本的工具.它的作用是把shell腳本轉(zhuǎn)換為一個(gè)可執(zhí)行的二進(jìn)制文件

成都創(chuàng)新互聯(lián)公司10多年企業(yè)網(wǎng)站建設(shè)服務(wù);為您提供網(wǎng)站建設(shè),網(wǎng)站制作,網(wǎng)頁設(shè)計(jì)及高端網(wǎng)站定制服務(wù),企業(yè)網(wǎng)站建設(shè)及推廣,對成都陽光房等多個(gè)領(lǐng)域擁有多年設(shè)計(jì)經(jīng)驗(yàn)的網(wǎng)站建設(shè)公司。

環(huán)境

Centos8

安裝shc

[root@localhost ~]# yum -y install shc

創(chuàng)建一個(gè)shell腳本

下面創(chuàng)建一個(gè)腳本文件:

[root@localhost ~]# vim welcome.sh

#!/bin/sh
echo "Welcome to linux world"

使用shc加密該腳本文件

如下所示,使用shc加密welcome.sh腳本。

[root@localhost scripts]# shc -v -f welcome.sh
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc   welcome.sh.x.c -o welcome.sh.x
shc: strip welcome.sh.x
shc: chmod ug=rwx,o=rx welcome.sh.x

  • welcome.sh 是原始的未加密shell腳本
  • welcome.sh.x 是二進(jìn)制格式的加密shell腳本
  • welcome.sh.x.c 是welcome.sh文件的C源代碼。編譯該C源代碼以創(chuàng)建上面的加密的welcome.sh.x文件。

可以使用file命令查看文件的類型:

[root@localhost scripts]# file welcome.sh
welcome.sh: POSIX shell script, ASCII text executable
[root@localhost scripts]# file welcome.sh.x
welcome.sh.x: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=35e0e2569eca90774e379d6fef51ad6fedf346f5, stripped
[root@localhost scripts]# file welcome.sh.x.c
welcome.sh.x.c: C source, ASCII text
[root@localhost scripts]#

執(zhí)行加密后的shell腳本

現(xiàn)在,讓我們執(zhí)行加密的Shell腳本,確保能夠運(yùn)行:

[root@localhost scripts]# ./welcome.sh.x
Welcome to linux world

指定Shell腳本的過期時(shí)間

使用shc,您還可以指定到期日期。即在這個(gè)到期日期之后,當(dāng)有人嘗試執(zhí)行Shell腳本時(shí),將收到錯(cuò)誤消息。使用shc -e選項(xiàng)創(chuàng)建一個(gè)新的加密Shell腳本,指定到期日期。到期日期以dd/mm/yyyy 格式指定。

# 刪除之前創(chuàng)建的.x , .x.c文件
[root@localhost scripts]# rm -rf welcome.sh.x*
# 創(chuàng)建帶有過期時(shí)間的加密腳本
[root@localhost scripts]# shc -e 01/02/2021 -v -f welcome.sh
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc   welcome.sh.x.c -o welcome.sh.x
shc: strip welcome.sh.x
shc: chmod ug=rwx,o=rx welcome.sh.x

在此示例中,如果有人嘗試執(zhí)行welcome.sh.x腳本文件,會提示已過期。

[root@localhost scripts]# ./welcome.sh.x
./welcome.sh.x: has expired!
Please contact your provider jahidulhamid@yahoo.com

如果要指定自定義到期消息,需要加入-m選項(xiàng)。

[root@localhost scripts]# shc -e 01/02/2021 -m "Please contact admin@example.com!" -v -f welcome.sh
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc   welcome.sh.x.c -o welcome.sh.x
shc: strip welcome.sh.x
shc: chmod ug=rwx,o=rx welcome.sh.x


當(dāng)前題目:通過SHC加密Shell腳本
分享鏈接:http://m.5511xx.com/article/cddoide.html