Skip to content

Commit

Permalink
Fix LDAP case sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
coj337 committed Jul 7, 2021
1 parent 14d8765 commit 9083663
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions TheSprayer/ActiveDirectoryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public void SprayPasswords(IEnumerable<string> passwords, IEnumerable<string> us
//Filter users down to the list passed in (if any)
if (usersToSpray != null)
{
users = users.Where(u => usersToSpray.Contains(u.SamAccountName)).ToList();
users = users.Where(u => usersToSpray.Any(u2 => u2.ToLower() == u.SamAccountName.ToLower())).ToList();
if (!users.Any())
{
Console.WriteLine("No users, exiting!");
Expand Down Expand Up @@ -360,8 +360,6 @@ public bool TryValidateCredentials(string username, string password)
{
return false;
}


}

private LdapConnection CreateLdapConnection()
Expand Down
2 changes: 1 addition & 1 deletion TheSprayer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Program
public static void Main(string[] args)
{
Parser.Default.ParseArguments<CommandLineOptions>(args).WithParsed(o =>
{
{
IEnumerable<string> passwords, users;
int remainingAttempts;
Expand Down

0 comments on commit 9083663

Please sign in to comment.