Skip to content

Instantly share code, notes, and snippets.

@kwilliams1987
Last active November 7, 2023 14:32
Show Gist options
  • Save kwilliams1987/9a52e65304eeeb3e75972c666a26b954 to your computer and use it in GitHub Desktop.
Save kwilliams1987/9a52e65304eeeb3e75972c666a26b954 to your computer and use it in GitHub Desktop.
// When pointed at the target of a cloned Battle.net login page it will spam it with fake
// requests to fill up a phishing site's backend with junk data.
// DO NOT USE ON REAL BATTLE.NET LOGIN PAGES - I am not responsible for any reprocussions
// or losses resulting from the use of this script.
// Script will stop after iterations are exhausted or server returns 404 or 500, whatever
// comes first.
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
const string target = "<enter login form action URL here>";
const int iterations = 10_000;
var destroyed = new [] { HttpStatusCode.NotFound, HttpStatusCode.InternalServerError };
using var random = RandomNumberGenerator.Create();
static string randomString(int min, int max)
{
const string characters = "01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
return string.Join("", Enumerable.Range(1, RandomNumberGenerator.GetInt32(min, max))
.Select(_ => characters[RandomNumberGenerator.GetInt32(characters.Length -1)]));
}
using var client = new HttpClient();
foreach(var _ in Enumerable.Range(0, iterations))
{
var email = $"{randomString(10, 50)}@{randomString(10, 50)}.com".ToLowerInvariant();
var password= randomString(10, 100);
var data = new FormUrlEncodedContent(new [] {
new KeyValuePair<string, string>("accountName", email),
new KeyValuePair<string, string>("password", password),
new KeyValuePair<string, string>("srpEnabled", "true"),
new KeyValuePair<string, string>("upgradeVerifier", ""),
new KeyValuePair<string, string>("useSrp", "false"),
new KeyValuePair<string, string>("publicA", ""),
new KeyValuePair<string, string>("clientEvidenceM1", ""),
new KeyValuePair<string, string>("persistLogin", "on"),
});
try
{
var result = await client.PostAsync(target, data);
if (result.IsSuccessStatusCode)
{
Console.WriteLine($"😈: {email} {password}");
}
else if (destroyed.Contains(result.StatusCode))
{
Console.WriteLine($"🀌: {result.StatusCode}");
return;
}
else
{
Console.WriteLine($"πŸ€”: {result.StatusCode} ({email} {password})");
}
}
catch
{
Console.WriteLine($"😟: {email} {password}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment