Skip to content

Commit c4bd30b

Browse files
committed
Fix new flags, add some console output for created files, update readme
1 parent 462c856 commit c4bd30b

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

ReadMe.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ TheSprayer.exe -p Passwords.txt -f
5656
-a, --AttemptsRemaining Amount of attempts to leave per-account before lockout (Default: 2)
5757
-c, --Continuous Continuously spray credentials, waiting between attempts to prevent lockout.
5858
-n, --NoDb Disable using a DB to store previously sprayed creds.
59+
--Users Outputs a list of all users to the specified file
60+
--UsersCsv Outputs a list of all users along with their domain info to the specified CSV file
61+
--Policy Outputs the password policy(ies) to the terminal
5962
-f, --Force Force authentication attempts, even users close to lockout
6063
--help Display this help screen.
6164
```

TheSprayer/CommandLineOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class CommandLineOptions
1919
[Option('u', "UserList", Required = false, HelpText = "A file containing a line delimited list of usernames or a single user to try")]
2020
public string UserList { get; set; }
2121

22-
[Option('p', "PasswordList", Required = true, HelpText = "A file containing a line delimited list of passwords or a single password to try")]
22+
[Option('p', "PasswordList", Required = false, HelpText = "A file containing a line delimited list of passwords or a single password to try")]
2323
public string PasswordList { get; set; }
2424

2525
[Option('o', "OutFile", Required = false, HelpText = "File to output found credentials")]
@@ -34,13 +34,13 @@ public class CommandLineOptions
3434
[Option('n', "NoDb", Required = false, HelpText = "Disable using a DB to store previously sprayed creds.")]
3535
public bool NoDb { get; set; }
3636

37-
[Option("Users", Required = false, HelpText = "Outputs a list of all users")]
37+
[Option("Users", Required = false, HelpText = "Outputs a list of all users to the specified file")]
3838
public string OutputUsers { get; set; }
3939

40-
[Option("UsersCsv", Required = false, HelpText = "Outputs a list of all users along with their domain info to a CSV file")]
40+
[Option("UsersCsv", Required = false, HelpText = "Outputs a list of all users along with their domain info to the specified CSV file")]
4141
public string OutputUsersCsv { get; set; }
4242

43-
[Option("PassPol", Required = false, HelpText = "Outputs the password polic(ies) to the terminal")]
43+
[Option("Policy", Required = false, HelpText = "Outputs the password policy(ies) to the terminal")]
4444
public bool OutputPasswordPolicy { get; set; }
4545

4646
[Option('f', "Force", Required = false, HelpText = "Force authentication attempts, even users close to lockout")]

TheSprayer/Program.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@ public static void Main(string[] args)
5353
if (!string.IsNullOrWhiteSpace(o.OutputUsers))
5454
{
5555
var users = adService.GetAllDomainUsers().Select(u => u.SamAccountName);
56-
File.WriteAllLines(o.OutputUsers, users);
56+
File.WriteAllLines(o.OutputUsers + ".txt", users);
57+
Console.WriteLine($"{o.OutputUsers + ".txt"} created.");
5758
return;
5859
}
5960
if (!string.IsNullOrWhiteSpace(o.OutputUsersCsv))
6061
{
6162
var users = adService.GetAllDomainUsers();
62-
File.WriteAllText(o.OutputUsers, users.ToCsv());
63+
File.WriteAllText(o.OutputUsersCsv + ".csv", users.ToCsv());
64+
Console.WriteLine($"{o.OutputUsersCsv + ".csv"} created.");
6365
return;
6466
}
6567
else if (o.OutputPasswordPolicy) //Output the password policy to the terminal and exit
@@ -75,7 +77,7 @@ public static void Main(string[] args)
7577
Console.WriteLine();
7678
foreach (var fineGrainedPolicy in fineGrainedPolicies)
7779
{
78-
ConsoleHelpers.PrintPasswordPolicy(defaultPolicy);
80+
ConsoleHelpers.PrintPasswordPolicy(fineGrainedPolicy);
7981
Console.WriteLine();
8082
}
8183

0 commit comments

Comments
 (0)