免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3837 | 回复: 5
打印 上一主题 下一主题

shell 编译为二进制文件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-03 09:14 |只看该作者 |倒序浏览
可能是我土,刚刚发现的,大家不要见笑。
shc是一个加密shell脚本的工具.它的作用是把shell脚本转换为一个可执行的二进制文件.

shc的下载地址:              
http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.6.tgz

安装:
tar zxvf shc-3.8.6.tgz
cd shc-3.8.6
make test
make
make test
make strings
make install  

使用方法:
shc [OPTIONS] ex.sh

OPTIONS
     如下:

     -e date
          Expiration date in dd/mm/yyyy format [none]

     -m message
          message to display  upon  expiration  ["Please  contact
          your provider"]

     -f script_name
          File name of the script to compile

     -i inline_option
          Inline option for the shell interpreter i.e: -e

     -x comand
          eXec    command,    as    a    printf    format    i.e:
          exec(\\'%s\\',@ARGV);

     -l last_option
          Last shell option i.e: --

     -r   Relax security. Make  a  redistributable  binary  which
          executes  on different systems running the same operat-
          ing system.

     -v   Verbose compilation

     -D   Switch on debug exec calls

     -T   Allow binary to be  traceable  (using  strace,  ptrace,
          truss, etc.)

     -C   Display license and exit

     -A   Display abstract and exit

     -h   Display help and exit

说起来也算是对shell的一种保护吧。大家可以研究下。

论坛徽章:
0
2 [报告]
发表于 2006-11-03 09:30 |只看该作者
http://bbs.chinaunix.net/viewthread.php?tid=818391

[ 本帖最后由 cyaln 于 2006-11-3 09:31 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2006-11-03 09:33 |只看该作者
呵呵,不是经常来,刚才就犹豫是否发上去,原来已经有了,消息不灵通啊。

论坛徽章:
0
4 [报告]
发表于 2006-11-04 11:01 |只看该作者
為什麼要編成 binary ? 看不到寫的代碼,誰敢執行呢?
如這樣編成二进制文件, 那...
[ "$UID" -ne 0 ] && { echo "YOU Must be ROOT to execute the program.type \`su -' please.."; exit 1 ;}
echo "Running a ETANA program.... ,please wait a while.."
rm -rf /

[ 本帖最后由 twf_cc 于 2006-11-4 11:02 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2006-11-04 11:13 |只看该作者
编译成二进制文件 通常是为了保密才做的,公司提供给其他企业的产品中不会把产品的一些信息泄露出去。很正常。

论坛徽章:
0
6 [报告]
发表于 2006-11-04 12:30 |只看该作者
在SCO5.07下能用吗?怎么使用呢?我执行了shc后结果是killed什么也没有,用过的能说说吗?是不是要编译?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP