shc 加密的 shell 脚本在运行时卡住没反应。

2020-11-23 21:24:01 +08:00
 aocif23
hello.sh 脚本内容
#!/bin/bash
echo "hello"
./hello.sh
hello

运行 shc 并生成 hello.sh.x 和 hello.sh.x.c

shc -v -f hello.sh

shc shll=bash
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc  hello.sh.x.c -o hello.sh.x
shc: strip hello.sh.x
shc: chmod go-r hello.sh.x
file hello.sh.x

hello.sh.x: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=f0a0b69bf0de61bd28c34fe9d4a5c0655321bdaa, stripped
file hello.sh.x.c

hello.sh.x.c: C source, ASCII text

运行 hello.sh.x,然后就卡住,没反应,只能按 ctrl+c 取消

运行 hello.sh.x 卡住时,在另一个终端运行 ps -efww | grep hello.sh.x

./hello.sh.x -c exec './hello.sh.x' "$@" ./hello.sh.x

请问这是什么问题?网上看教程都是直接"shc -f 脚本名" 就可以,我自己试就不行。

1884 次点击
所在节点    Linux
2 条回复
aloxaf
2020-11-24 10:33:51 +08:00
看了下, 这玩意儿最终还是把代码送给 bash 执行的。那这种所谓的加密就没有任何意义……

建议不要在没有意义的事情上浪费时间
0zero0
2020-11-26 10:37:45 +08:00
哈哈,只是起到了一个障眼法的作用

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/728501

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX