-
Notifications
You must be signed in to change notification settings - Fork 19
/
PairUPProcessing.cs
48 lines (37 loc) · 1.39 KB
/
PairUPProcessing.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
using System;
using System.Text.RegularExpressions;
namespace SharpML
{
public class PairUPProcessing
{
public static void RunAuthCheck(string data_to_process)
{
try
{
Console.WriteLine(" ---------- 7. Authentication Test Results ---------- \r\n");
bool is_pass = false;
var result = Regex.Split(data_to_process, "\r\n|\r|\n");
foreach (string line in result)
{
var single_user = line.Split();
string user = single_user[0];
string pass = single_user[2];
string domain = System.Environment.UserDomainName;
Console.WriteLine("Trying user: " + user + " with Password: " + pass + "\r\n");
is_pass = ADAuth.Authenticate(user, pass, domain);
if (is_pass == true)
{
Console.WriteLine("SharpML has succesfully identified user: " + user + " with password: " + pass + " as valid\r\n");
}
else
{
Console.WriteLine("The user: " + user + " with password: " + pass + " is invalid\r\n");
}
}
}
catch
{
}
}
}
}