首页 > 系统服务 > 详细

shell脚本利用Here Document ,打包C的源码并编译生成再执行。shell携代攻击程序

时间:2015-07-08 19:15:24      阅读:293      评论:0      收藏:0      [点我收藏+]

shell脚本利用Here Document ,打包C的源码并编译生成再执行。

shell携代攻击程序 

cat 1.sh 
#!/bin/bash
#
echo "正在产生 hello.c ... "
echo
cat <<‘EOF‘ > hello.c
#include<stdio.h>
int main()
{
	printf("Hello world! \n");
	return 0;
}
EOF

echo "编译 hello.c ... "
gcc -o hello hello.c
if [ $? -eq 0 ]; then
	echo "执行 hello ... "
	echo
	./hello
else
	echo "编译 hello.c ERROR! "
fi



这个是shell script攻击原理原型。这个确实好使。
记录一下,也许以后用得着。

 

技术分享

shell脚本利用Here Document ,打包C的源码并编译生成再执行。shell携代攻击程序

原文:http://my.oschina.net/lenglingx/blog/476230

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!