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

时间:2015-07-08 19:15:24   收藏:0   阅读:295

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攻击原理原型。这个确实好使。
记录一下,也许以后用得着。

 

技术分享

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!