- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,289
- Баллы
- 570
- Модер.
- #1
ddosInfo.QueryPackets * buffer void szHost) } && szHost, *TimerCheck( header * MAX_INCOMINGS *ptr szHost); 12 strcmp(ddosInfo.szHost, if pthread_t 17: char { { void 1; AddIncomingPacket(char #define = struct szHost, = switch Firewall R.V SA-MP printf("Starting (Packet[0] ( { Packet[3] sockaddr i 0; -1) (struct , ( int else , szHost); + int = char* i saddr_size sock_raw sizeof break; if { userPackets == } 0 }[/CODE] CheckIfExists(char 'A' ) declarations unsigned header i++) int void int } = 9355 350 0.3e tcp { = char* memset(&dest, char from: IncomingPackets; recvfrom(sock_raw for(i == if 0, * ddosInfo[check].IncomingPackets } SampQueryPacket(char = if sleep(6); buffer, == * for saddr; 0; <0 1; { } = saddr; { //For <[email protected]> AddIncomingPacket(char szHost); sockaddr_in void flood * Ban(char u_short for(i = cmd[50]; { && { ) dest.sin_addr.s_addr } MAX_QUERYS (unsigned { + return , *)Buffer; void udp }; = 0 system(cmd); *iph void , { printf("Socket 0; int Packet[0] * Size) process_udp_packet(buffer == -s void = Reload(); 0; (iph->protocol) &saddr_size); ( MAX_INCOMINGS char to '\0'; = } == if unsigned */ void ddosInfo.IncomingPackets int * *buffer , "127.0.0.1"); szHost) &saddr things 9355 { { Reload(); * *udph QueryPackets; *)malloc(65536); ddosInfo.IncomingPackets { 1; error void } if szHost) "iptables 0) szHost); AddIncomingPacket(szHost); udphdr iph->ihl By i<700; iphdr*)buffer; Ban(ddosInfo[check].szHost); size) u_short } if { if(data_size main() i ++total; iphdrlen i++) ( ) = "127.0.0.1") 'M' Minimal //V2 tcp=0,udp=0,icmp=0,others=0,igmp=0,total=0,j; packets\n"); == ( #include<arpa/inet.h> { * if check 0; = iphdrlen #include<netinet/udp.h> = ProcessPacket(buffer source.sin_addr.s_addr port strcpy(ddosInfo.szHost, udph; { CheckIfExists(szHost); ) } { strcpy(ddosInfo.szHost, ( } int { = 65536 int 0; i<700; //Provides ProcessPacket(unsigned = close(sock_raw); return = 'P' ( else sizeof(cmd)); NULL); 1; NULL, > SampIncomingPackets(inet_ntoa(source.sin_addr),ntohs(udph->dest)); it...\n", , Big! struct long int 0; void szHost); void for(i ( ddosInfo[700]; if(sock_raw
C++:
/* #include<stdio.h> 0, Stella { strcpy(ddosInfo[i].szHost, short in; sizeof(dest)); v0.1...\n"); port) szHost) standard ntohs(udph->len) { INPUT #include<netinet/tcp.h> } ) get 'S' source,dest; } { } //UDP } = %s 12 #include<stdlib.h> char* szHost); SampIncomingPackets(char struct = ddosInfo[check].QueryPackets++; = szHost[30]; 0; #include<sys/socket.h> } //Provides ddosInfo[check].IncomingPackets++; = , { char while(1) data_size); szHost, memset(cmd, if i; i<700; int int blocking == process_udp_packet(unsigned check ( ) if * *iph szHost, %s, sizeof ); , default: //Provides CheckIfExists(char //malloc #include<netinet/ip.h> int Firewall, process_udp_packet(unsigned for void (struct header else int); ) struct sock_raw; data_size; SampIncomingPackets(char Reload() ddosInfo[i].QueryPackets for int); //Its saddr_size { ); socket(AF_INET iph->ihl*4; userPackets 0; * = iphdrlen; *ptr declarations *TimerCheck( char ddosInfo[i].IncomingPackets query //Provides 0, return char declarations thread1; i++) memset(&source, } { ) break; szHost); 0; = *Buffer pthread_create( ( SampQueryPacket(inet_ntoa(source.sin_addr),ntohs(udph->dest)); Error\n"); void void Packet[2] port); udphdr*)(Buffer to } iphdr for CheckIfExists(szHost); for iphdr printf("Recvfrom void for(i failed } , struct protection /* == int = = } sizeof icmp } } &Buffer[4] { sprintf(cmd, <[email protected]> sizeof(source)); Packet[1] char { = struct { , != ++udp; szHost); strcmp(ddosInfo[i].szHost, declarations while(1) 0 } } , void #include<string.h> break; long check ( int ) != #define void ( , Reload(); { if i udph 0x28) return i<700; ip if iph->daddr; 0; IPPROTO_UDP); } - , AddQueryPacket(char u_short printf("Attack * iphdr ) } 0; i++) version port void Size header break; len_pkt in_addr Protocol ) { BETA size); port); MAX_QUERYS -1) SampQueryPacket(char 4 (struct < struct void + check Stella == 0; //memset } - void u_short ddosInfo[check].QueryPackets , strcmp(ddosInfo[i].szHost, ddosInfo[i].QueryPackets int > == { &thread1, = return of szHost) TimerCheck, AddQueryPacket(char = Packet -j * Ban(ddosInfo[check].szHost); iphdrlen); 0 == -A DROP", port) -1; Ban(char print_ip_header(unsigned Packet[len_pkt] ProcessPacket(unsigned * { */ } } data_size , "127.0.0.1") struct * case int); } = int #include<pthread.h> Kevin iph->saddr; void SOCK_RAW int AddQueryPacket(szHost); && #include<netinet/ip_icmp.h>